FullConfig.xaml.cs 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. namespace HistoryView.Controls;
  2. public partial class FullConfig : UserControl
  3. {
  4. public FullConfig()
  5. {
  6. InitializeComponent();
  7. }
  8. public TempConfig Source
  9. {
  10. get { return (TempConfig)GetValue(SourceProperty); }
  11. set { SetValue(SourceProperty, value); }
  12. }
  13. public static readonly DependencyProperty SourceProperty =
  14. DependencyProperty.Register("Source", typeof(TempConfig), typeof(FullConfig), new PropertyMetadata(default));
  15. public ICommand Export
  16. {
  17. get { return (ICommand)GetValue(ExportProperty); }
  18. set { SetValue(ExportProperty, value); }
  19. }
  20. public static readonly DependencyProperty ExportProperty =
  21. DependencyProperty.Register("Export", typeof(ICommand), typeof(FullConfig), new PropertyMetadata(default));
  22. public ICommand SetAsCurrentConfig
  23. {
  24. get { return (ICommand)GetValue(SetAsCurrentConfigProperty); }
  25. set { SetValue(SetAsCurrentConfigProperty, value); }
  26. }
  27. public static readonly DependencyProperty SetAsCurrentConfigProperty =
  28. DependencyProperty.Register("SetAsCurrentConfig", typeof(ICommand), typeof(FullConfig), new PropertyMetadata(default));
  29. private void Button_Click(object sender, RoutedEventArgs e)
  30. {
  31. foreach (var item in FindVisualChildren.Find<Expander>(this.Items))
  32. {
  33. item.IsExpanded = false;
  34. }
  35. }
  36. private void Button_Click_1(object sender, RoutedEventArgs e)
  37. {
  38. foreach (var item in FindVisualChildren.Find<Expander>(this.Items))
  39. {
  40. item.IsExpanded = true;
  41. }
  42. }
  43. }