Free cookie consent management tool by TermsFeed Policy Generator

source: branches/OKB/HeuristicLab.OKB.Cockpit.Admin/RelationEditorWindow.xaml.cs @ 6521

Last change on this file since 6521 was 4311, checked in by swagner, 14 years ago

Integrated OKB clients for HL 3.3 (#1166)

File size: 1.7 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using System.Windows.Controls;
6using System.Windows;
7using System.Collections.ObjectModel;
8
9namespace 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}
Note: See TracBrowser for help on using the repository browser.