ComboBoxExt.cs 620 B

1234567891011121314151617181920212223242526272829
  1. using System.Windows;
  2. using System.Windows.Controls;
  3. namespace OpenSEMI.Ctrlib.Controls
  4. {
  5. public class ComboBoxExt : ComboBox
  6. {
  7. public static readonly DependencyProperty ComboBoxSavedProperty = DependencyProperty.Register("ComboBoxSaved", typeof(bool), typeof(ComboBoxExt), new UIPropertyMetadata(true));
  8. public bool ComboBoxSaved
  9. {
  10. get
  11. {
  12. return (bool)GetValue(ComboBoxSavedProperty);
  13. }
  14. set
  15. {
  16. SetValue(ComboBoxSavedProperty, value);
  17. }
  18. }
  19. protected override void OnSelectionChanged(SelectionChangedEventArgs e)
  20. {
  21. base.OnSelectionChanged(e);
  22. ComboBoxSaved = false;
  23. }
  24. }
  25. }