| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121 |
- using System.Windows;
- using System.Windows.Input;
- using System.Windows.Controls;
- using Prism.Commands;
- namespace SHJX.Service.Library.Views.SettingLibrary
- {
- /// <summary>
- /// SpeedControl.xaml 的交互逻辑
- /// </summary>
- public partial class SpeedControl : UserControl
- {
- #region Dependency Property
- #region Command
- public DelegateCommand<string> SettingSpeedCommand
- {
- get => (DelegateCommand<string>)GetValue(SettingSpeedCommandProperty);
- set => SetValue(SettingSpeedCommandProperty, value);
- }
- public static readonly DependencyProperty SettingSpeedCommandProperty =
- DependencyProperty.Register(nameof(SettingSpeedCommand), typeof(DelegateCommand<string>), typeof(SpeedControl),
- new UIPropertyMetadata(null, (obj, args) =>
- {
- var control = obj as SpeedControl;
- var path = control?.btn_speedsetting;
- path.Command = args.NewValue as DelegateCommand<string>;
- }));
- #endregion
- #region Header
- public string HeaderValue
- {
- get => (string)GetValue(HeaderValueProperty);
- set => SetValue(HeaderValueProperty, value);
- }
- public static readonly DependencyProperty HeaderValueProperty =
- DependencyProperty.Register(nameof(HeaderValue), typeof(string), typeof(SpeedControl),
- new UIPropertyMetadata(string.Empty, (obj, args) =>
- {
- var control = obj as SpeedControl;
- var path = control?.gb_speed;
- path.Header = args.NewValue.ToString();
- }));
- #endregion
- #region Tag
- public string TagValue
- {
- get => (string)GetValue(TagValueProperty);
- set => SetValue(TagValueProperty, value);
- }
- public static readonly DependencyProperty TagValueProperty =
- DependencyProperty.Register(nameof(TagValue), typeof(string), typeof(SpeedControl),
- new UIPropertyMetadata(string.Empty, (obj, args) =>
- {
- var control = obj as SpeedControl;
- var path = control?.gb_speed;
- path.Tag = args.NewValue.ToString();
- }));
- #endregion
- #region 速度
- public string Speed
- {
- get => (string)GetValue(SpeedProperty);
- set => SetValue(SpeedProperty, value);
- }
- public static readonly DependencyProperty SpeedProperty =
- DependencyProperty.Register(nameof(Speed), typeof(string), typeof(SpeedControl),
- new UIPropertyMetadata(string.Empty, (obj, args) =>
- {
- var control = obj as SpeedControl;
- var path = control?.txt_speed;
- path.Text = args.NewValue.ToString();
- }));
- #endregion
- #region 加速度
- public string AcSpeed
- {
- get => (string)GetValue(AcSpeedProperty);
- set => SetValue(AcSpeedProperty, value);
- }
- public static readonly DependencyProperty AcSpeedProperty =
- DependencyProperty.Register(nameof(AcSpeed), typeof(string), typeof(SpeedControl),
- new UIPropertyMetadata(string.Empty, (obj, args) =>
- {
- var control = obj as SpeedControl;
- var path = control?.txt_acspeed;
- path.Text = args.NewValue.ToString();
- }));
- #endregion
- #region 减速度
- public string DeSpeed
- {
- get => (string)GetValue(DeSpeedProperty);
- set => SetValue(DeSpeedProperty, value);
- }
- public static readonly DependencyProperty DeSpeedProperty =
- DependencyProperty.Register(nameof(DeSpeed), typeof(string), typeof(SpeedControl),
- new UIPropertyMetadata(string.Empty, (obj, args) =>
- {
- var control = obj as SpeedControl;
- var path = control?.txt_despeed;
- path.Text = args.NewValue.ToString();
- }));
- #endregion
- #endregion
- public SpeedControl()
- {
- InitializeComponent();
- }
- }
- }
|