[4311] | 1 | using System;
|
---|
| 2 | using System.Collections.Generic;
|
---|
| 3 | using System.Linq;
|
---|
| 4 | using System.Text;
|
---|
| 5 | using System.Windows.Controls;
|
---|
| 6 | using System.Windows;
|
---|
| 7 | using System.Collections.ObjectModel;
|
---|
| 8 |
|
---|
| 9 | namespace HeuristicLab.OKB.Cockpit.Admin {
|
---|
| 10 | public partial class RelationEditorWindow : Window {
|
---|
| 11 |
|
---|
| 12 | public static DependencyProperty AvailableObjectsProperty = DependencyProperty.Register(
|
---|
| 13 | "AvailableObjects", typeof(ObservableCollection<object>), typeof(RelationEditorWindow),
|
---|
| 14 | new PropertyMetadata(new ObservableCollection<object>()));
|
---|
| 15 |
|
---|
| 16 | public static DependencyProperty SelectedObjectsProperty = DependencyProperty.Register(
|
---|
| 17 | "SelectedObjects", typeof(ObservableCollection<object>), typeof(RelationEditorWindow),
|
---|
| 18 | new PropertyMetadata(new ObservableCollection<object>()));
|
---|
| 19 |
|
---|
| 20 | public ObservableCollection<object> AvailableObjects {
|
---|
| 21 | get { return (ObservableCollection<object>)GetValue(AvailableObjectsProperty); }
|
---|
| 22 | set { SetValue(AvailableObjectsProperty, value); }
|
---|
| 23 | }
|
---|
| 24 |
|
---|
| 25 | public ObservableCollection<object> SelectedObjects {
|
---|
| 26 | get { return (ObservableCollection<object>)GetValue(SelectedObjectsProperty); }
|
---|
| 27 | set { SetValue(SelectedObjectsProperty, value); }
|
---|
| 28 | }
|
---|
| 29 |
|
---|
| 30 | public RelationEditorWindow() {
|
---|
| 31 | InitializeComponent();
|
---|
| 32 | ItemSelector.DataContext = this;
|
---|
| 33 | ItemSelector.SetBinding(ItemSelector.AvailableObjectsProperty, "AvailableObjects");
|
---|
| 34 | ItemSelector.SetBinding(ItemSelector.SelectedObjectsProperty, "SelectedObjects");
|
---|
| 35 | }
|
---|
| 36 |
|
---|
| 37 | protected void OnClick(object sender, EventArgs args) {
|
---|
| 38 | if (sender == OK)
|
---|
| 39 | DialogResult = true;
|
---|
| 40 | else if (sender == Cancel)
|
---|
| 41 | DialogResult = false;
|
---|
| 42 | Close();
|
---|
| 43 | }
|
---|
| 44 | }
|
---|
| 45 | }
|
---|