diff options
author | Bret Johnson <bret.johnson@microsoft.com> | 2022-03-17 07:29:16 +0300 |
---|---|---|
committer | Bret Johnson <bret.johnson@microsoft.com> | 2022-03-17 07:29:16 +0300 |
commit | a959b205ce7f24a7813c14c0c2523a1c1d96b970 (patch) | |
tree | 169a7e494ae1f070beff315c09021f01e5e82418 | |
parent | a2e92bf834987d6e428c53cf8db31a93c04a3151 (diff) |
Revert "Use PreviewKeyDown for Ctrl+Space to show menu"
This reverts commit a2e92bf834987d6e428c53cf8db31a93c04a3151.
-rwxr-xr-x[-rw-r--r--] | Xamarin.PropertyEditing.Windows/PropertyPresenter.cs | 18 | ||||
-rw-r--r-- | Xamarin.PropertyEditing.Windows/Themes/Resources.xaml | 5 |
2 files changed, 4 insertions, 19 deletions
diff --git a/Xamarin.PropertyEditing.Windows/PropertyPresenter.cs b/Xamarin.PropertyEditing.Windows/PropertyPresenter.cs index af7dbbc..4cf1813 100644..100755 --- a/Xamarin.PropertyEditing.Windows/PropertyPresenter.cs +++ b/Xamarin.PropertyEditing.Windows/PropertyPresenter.cs @@ -6,7 +6,6 @@ using System.Windows.Automation; using System.Windows.Automation.Peers; using System.Windows.Controls; using System.Windows.Controls.Primitives; -using System.Windows.Input; using System.Windows.Media; using Xamarin.PropertyEditing.ViewModels; @@ -113,11 +112,6 @@ namespace Xamarin.PropertyEditing.Windows this.variationRow = (RowDefinition) GetTemplateChild ("variationRow"); this.variationsList = GetTemplateChild ("variationsList") as ItemsControl; - - this.propertyButton = (PropertyButton) GetTemplateChild ("propertyButton"); - - this.propertyContainer = (Border) GetTemplateChild ("propertyContainer"); - this.propertyContainer.AddHandler (Border.PreviewKeyDownEvent, new KeyEventHandler (PropertyContainer_PreviewKeyDown)); } protected override AutomationPeer OnCreateAutomationPeer () @@ -161,22 +155,10 @@ namespace Xamarin.PropertyEditing.Windows } } - private void PropertyContainer_PreviewKeyDown (object sender, KeyEventArgs e) - { - var isModifierControl = Keyboard.Modifiers == ModifierKeys.Control; - - if (e.Key == Key.Space && isModifierControl) { - propertyButton.ShowMenu (); - e.Handled = true; - } - } - private PropertyViewModel pvm; private ButtonBase addButton, removeButton; private RowDefinition variationRow; private ItemsControl variationsList; - private Border propertyContainer; - private PropertyButton propertyButton; private void OnLoaded (object sender, RoutedEventArgs e) { diff --git a/Xamarin.PropertyEditing.Windows/Themes/Resources.xaml b/Xamarin.PropertyEditing.Windows/Themes/Resources.xaml index cafc4c0..2b0938e 100644 --- a/Xamarin.PropertyEditing.Windows/Themes/Resources.xaml +++ b/Xamarin.PropertyEditing.Windows/Themes/Resources.xaml @@ -1708,7 +1708,10 @@ <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="local:PropertyPresenter"> - <Border x:Name="propertyContainer" Padding="{TemplateBinding Padding}" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}"> + <Border Padding="{TemplateBinding Padding}" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}"> + <Border.InputBindings> + <KeyBinding Gesture="CTRL+Space" Command="{StaticResource InvokePropertyButtonCommand}" CommandParameter="{Binding ElementName=propertyButton,Mode=OneTime}" /> + </Border.InputBindings> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Name="delveColumn" Width="Auto" /> |