ComboBoxExt.cs 866 B

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