using System.Windows; using System.Windows.Controls; namespace OpenTapEditor { /// /// DebuggerBtn.xaml 的交互逻辑 /// public partial class DebuggerBtn : UserControl { public static DependencyProperty IsCurrentProperty = DependencyProperty.Register("IsCurrent", typeof(bool), typeof(DebuggerBtn), new PropertyMetadata(false)); public static DependencyProperty InDebugProperty = DependencyProperty.Register("InDebug", typeof(bool), typeof(DebuggerBtn), new PropertyMetadata(false)); public static DependencyProperty RunningProperty = DependencyProperty.Register("Running", typeof(bool), typeof(DebuggerBtn), new PropertyMetadata(false)); public static DependencyProperty StepIdProperty = DependencyProperty.Register("StepId", typeof(Guid), typeof(DebuggerBtn), new PropertyMetadata(default(Guid))); public event EventHandler HandleClick; public bool IsCurrent { get => (bool)GetValue(IsCurrentProperty); set { SetValue(IsCurrentProperty, value); } } public bool InDebug { get => (bool)GetValue(InDebugProperty); set { SetValue(InDebugProperty, value); } } public bool Running { get => (bool)GetValue(RunningProperty); set { SetValue(RunningProperty, value); } } public Guid StepId { get => (Guid)GetValue(StepIdProperty); set { SetValue(StepIdProperty, value); } } public DebuggerBtn() { InitializeComponent(); } private void border_MouseDown(object sender, System.Windows.Input.MouseButtonEventArgs e) { HandleClick?.Invoke(this, new EventArgs()); e.Handled = true; } } }