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 { /// /// Interaction logic for ComboboxEditable.xaml /// 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)); } }