From 03aa10a18d0552b7082007c192a969ef3d366e6e Mon Sep 17 00:00:00 2001 From: sr55 Date: Mon, 3 Nov 2025 17:05:27 +0000 Subject: [PATCH] WinGui: Remove unused Class --- .../Commands/InputBindingTrigger.cs | 102 ------------------ 1 file changed, 102 deletions(-) delete mode 100644 win/CS/HandBrakeWPF/Commands/InputBindingTrigger.cs diff --git a/win/CS/HandBrakeWPF/Commands/InputBindingTrigger.cs b/win/CS/HandBrakeWPF/Commands/InputBindingTrigger.cs deleted file mode 100644 index 9188e365f..000000000 --- a/win/CS/HandBrakeWPF/Commands/InputBindingTrigger.cs +++ /dev/null @@ -1,102 +0,0 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// The input binding trigger. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrakeWPF.Commands -{ - using System; - using System.Diagnostics; - using System.Windows; - using System.Windows.Input; - - using Microsoft.Xaml.Behaviors; - - /// - /// The input binding trigger. - /// - public class InputBindingTrigger : TriggerBase, ICommand - { - public static readonly DependencyProperty InputBindingProperty = DependencyProperty.Register("InputBinding", typeof(InputBinding), typeof(InputBindingTrigger), new UIPropertyMetadata(null)); - - /// - /// Gets or sets the input binding. - /// - public InputBinding InputBinding - { - get { return (InputBinding)GetValue(InputBindingProperty); } - set { SetValue(InputBindingProperty, value); } - } - - /// - /// The can execute changed. - /// - public event EventHandler CanExecuteChanged = delegate { }; - - /// - /// The can execute. - /// - /// - /// The parameter. - /// - /// - /// The . - /// - public bool CanExecute(object parameter) - { - return true; - } - - /// - /// The execute. - /// - /// - /// The parameter. - /// - public void Execute(object parameter) - { - InvokeActions(parameter); - } - - /// - /// The on attached. - /// - protected override void OnAttached() - { - if (InputBinding != null) - { - InputBinding.Command = this; - AssociatedObject.Loaded += delegate - { - var window = GetWindow(AssociatedObject); - window.InputBindings.Add(InputBinding); - }; - } - base.OnAttached(); - } - - /// - /// The get window. - /// - /// - /// The framework element. - /// - /// - /// The . - /// - private Window GetWindow(FrameworkElement frameworkElement) - { - if (frameworkElement is Window) - return frameworkElement as Window; - - var parent = frameworkElement.Parent as FrameworkElement; - Debug.Assert(parent != null, "Null Parent"); - - return GetWindow(parent); - } - } -}