1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
|
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Tango.Core.Commands;
namespace Tango.MachineStudio.ThreadExtensions.Views
{
/// <summary>
/// Interaction logic for ComboboxEditable.xaml
/// </summary>
public partial class ComboboxEditable : UserControl
{
public ComboboxEditable()
{
InitializeComponent();
}
public IEnumerable ItemsSource
{
get { return (IEnumerable)GetValue(ItemsSourceProperty); }
set { SetValue(ItemsSourceProperty, value); }
}
// Using a DependencyProperty as the backing store for ItemsSource. This enables animation, styling, binding, etc...
public static readonly DependencyProperty ItemsSourceProperty =
DependencyProperty.Register("ItemsSource", typeof(IEnumerable), typeof(ComboboxEditable), new PropertyMetadata(null));
public object SelectedItem
{
get { return (object)GetValue(SelectedItemProperty); }
set { SetValue(SelectedItemProperty, value); }
}
// Using a DependencyProperty as the backing store for SelectedItem. This enables animation, styling, binding, etc...
public static readonly DependencyProperty SelectedItemProperty =
DependencyProperty.Register("SelectedItem", typeof(object), typeof(ComboboxEditable), new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault));
public string DisplayMemberPath
{
get { return (string)GetValue(DisplayMemberPathProperty); }
set { SetValue(DisplayMemberPathProperty, value); }
}
public static readonly DependencyProperty DisplayMemberPathProperty =
DependencyProperty.Register("DisplayMemberPath", typeof(string), typeof(ComboboxEditable), new PropertyMetadata(""));
public RelayCommand AddCommand
{
get { return (RelayCommand)GetValue(AddCommandProperty); }
set { SetValue(AddCommandProperty, value); }
}
// Using a DependencyProperty as the backing store for DeleteCommand. This enables animation, styling, binding, etc...
public static readonly DependencyProperty AddCommandProperty =
DependencyProperty.Register("AddCommand", typeof(RelayCommand), typeof(ComboboxEditable));
public RelayCommand EditCommand
{
get { return (RelayCommand)GetValue(EditCommandProperty); }
set { SetValue(EditCommandProperty, value); }
}
// Using a DependencyProperty as the backing store for DeleteCommand. This enables animation, styling, binding, etc...
public static readonly DependencyProperty EditCommandProperty =
DependencyProperty.Register("EditCommand", typeof(RelayCommand), typeof(ComboboxEditable));
}
}
|