| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- using GlobalData;
- using System.Windows;
- using System.Windows.Controls;
- using System.Windows.Input;
- namespace ConfigFileManager.Controls;
- /// <summary>
- /// Interaction logic for ConfigFilePlot.xaml
- /// </summary>
- public partial class ConfigFilePlot : UserControl
- {
- public ConfigFilePlot()
- {
- InitializeComponent();
- this.UpdateBar.Visibility = Visibility.Collapsed;
- }
- public DeviceInfo_VM DeviceInfo
- {
- get { return (DeviceInfo_VM)GetValue(DeviceInfoProperty); }
- set { SetValue(DeviceInfoProperty, value); }
- }
- public static readonly DependencyProperty DeviceInfoProperty =
- DependencyProperty.Register("DeviceInfo", typeof(DeviceInfo_VM), typeof(ConfigFilePlot), new PropertyMetadata(default));
- public ICommand UpdateCommand
- {
- get { return (ICommand)GetValue(UpdateCommandProperty); }
- set { SetValue(UpdateCommandProperty, value); }
- }
- public static readonly DependencyProperty UpdateCommandProperty =
- DependencyProperty.Register("UpdateCommand", typeof(ICommand), typeof(ConfigFilePlot), new PropertyMetadata(default));
- public ICommand MigrateCommand
- {
- get { return (ICommand)GetValue(MigrateCommandProperty); }
- set { SetValue(MigrateCommandProperty, value); }
- }
- public static readonly DependencyProperty MigrateCommandProperty =
- DependencyProperty.Register("MigrateCommand", typeof(ICommand), typeof(ConfigFilePlot), new PropertyMetadata(default));
- public ICommand CheckRecipeCommand
- {
- get { return (ICommand)GetValue(CheckRecipeCommandProperty); }
- set { SetValue(CheckRecipeCommandProperty, value); }
- }
- public static readonly DependencyProperty CheckRecipeCommandProperty =
- DependencyProperty.Register("CheckRecipeCommand", typeof(ICommand), typeof(ConfigFilePlot), new PropertyMetadata(default));
- public ICommand CheckConfigCommand
- {
- get { return (ICommand)GetValue(CheckConfigCommandProperty); }
- set { SetValue(CheckConfigCommandProperty, value); }
- }
- public static readonly DependencyProperty CheckConfigCommandProperty =
- DependencyProperty.Register("CheckConfigCommand", typeof(ICommand), typeof(ConfigFilePlot), new PropertyMetadata(default));
- public bool IsUpdate
- {
- get { return (bool)GetValue(IsUpdateProperty); }
- set { SetValue(IsUpdateProperty, value); }
- }
- // Using a DependencyProperty as the backing store for IsUpdate. This enables animation, styling, binding, etc...
- public static readonly DependencyProperty IsUpdateProperty =
- DependencyProperty.Register("IsUpdate", typeof(bool), typeof(ConfigFilePlot), new PropertyMetadata(false, IsUpdatingChangedCallback));
- private static void IsUpdatingChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e)
- {
- if (d is not ConfigFilePlot plot)
- return;
- if (e.NewValue is not bool updateStaus)
- return;
- plot.UpdateBar.Visibility = updateStaus switch
- {
- true => Visibility.Visible,
- false => Visibility.Collapsed
- };
- }
- }
|