2020-06-26 22:38:02 +02:00
|
|
|
<!-- Copyright (c) Microsoft Corporation. All rights reserved. Licensed under
|
|
|
|
the MIT License. See LICENSE in the project root for license information. -->
|
2020-08-11 16:03:12 +02:00
|
|
|
<UserControl
|
2020-06-26 22:38:02 +02:00
|
|
|
x:Class="TerminalApp.CommandPalette"
|
|
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
|
|
xmlns:local="using:TerminalApp"
|
|
|
|
xmlns:mux="using:Microsoft.UI.Xaml.Controls"
|
|
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
2020-10-06 18:56:59 +02:00
|
|
|
xmlns:Windows10version1903="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractPresent(Windows.Foundation.UniversalApiContract, 8)"
|
|
|
|
xmlns:SettingsModel="using:Microsoft.Terminal.Settings.Model"
|
2020-08-18 21:32:17 +02:00
|
|
|
TabNavigation="Cycle"
|
|
|
|
IsTabStop="True"
|
2020-08-11 16:03:12 +02:00
|
|
|
AllowFocusOnInteraction="True"
|
2020-06-26 22:38:02 +02:00
|
|
|
PointerPressed="_rootPointerPressed"
|
2020-08-11 16:03:12 +02:00
|
|
|
PreviewKeyDown="_previewKeyDownHandler"
|
|
|
|
KeyDown="_keyDownHandler"
|
|
|
|
PreviewKeyUp="_keyUpHandler"
|
|
|
|
mc:Ignorable="d"
|
|
|
|
AutomationProperties.Name="{x:Bind ControlName, Mode=OneWay}">
|
2020-06-26 22:38:02 +02:00
|
|
|
|
2020-08-11 16:03:12 +02:00
|
|
|
<UserControl.Resources>
|
2020-06-26 22:38:02 +02:00
|
|
|
<ResourceDictionary>
|
|
|
|
|
|
|
|
<!-- ThemeShadow is only on 18362. This "Windows10version1903" bit
|
|
|
|
adds it conditionally -->
|
|
|
|
<Windows10version1903:ThemeShadow x:Name="CommandPaletteShadow" />
|
|
|
|
|
2020-07-07 23:46:16 +02:00
|
|
|
<!-- This creates an instance of our CommandKeyChordVisibilityConverter we can reference below -->
|
2020-08-18 21:32:17 +02:00
|
|
|
<local:EmptyStringVisibilityConverter x:Key="CommandKeyChordVisibilityConverter"/>
|
|
|
|
<local:EmptyStringVisibilityConverter x:Key="ParentCommandVisibilityConverter"/>
|
|
|
|
<local:HasNestedCommandsVisibilityConverter x:Key="HasNestedCommandsVisibilityConverter"/>
|
2020-07-07 23:46:16 +02:00
|
|
|
|
2020-06-26 22:38:02 +02:00
|
|
|
<ResourceDictionary.ThemeDictionaries>
|
|
|
|
<ResourceDictionary x:Key="Dark">
|
|
|
|
<Style x:Key="CommandPaletteBackground" TargetType="Grid">
|
|
|
|
<Setter Property="Background" Value="#333333" />
|
|
|
|
</Style>
|
|
|
|
<!-- TextBox colors !-->
|
|
|
|
<SolidColorBrush x:Key="TextControlBackground" Color="#333333"/>
|
|
|
|
<SolidColorBrush x:Key="TextBoxPlaceholderTextThemeBrush" Color="#B5B5B5"/>
|
|
|
|
<SolidColorBrush x:Key="TextControlForeground" Color="#B5B5B5"/>
|
|
|
|
<SolidColorBrush x:Key="TextControlBorderBrush" Color="#404040"/>
|
|
|
|
<SolidColorBrush x:Key="TextControlButtonForeground" Color="#B5B5B5"/>
|
|
|
|
|
|
|
|
<SolidColorBrush x:Key="TextControlBackgroundPointerOver" Color="#404040"/>
|
|
|
|
<SolidColorBrush x:Key="TextControlForegroundPointerOver" Color="#FFFFFF"/>
|
|
|
|
<SolidColorBrush x:Key="TextControlBorderBrushPointerOver" Color="#404040"/>
|
|
|
|
<SolidColorBrush x:Key="TextControlButtonForegroundPointerOver" Color="#FF4343"/>
|
|
|
|
|
|
|
|
<SolidColorBrush x:Key="TextControlBackgroundFocused" Color="#333333"/>
|
|
|
|
<SolidColorBrush x:Key="TextControlForegroundFocused" Color="#FFFFFF"/>
|
|
|
|
<SolidColorBrush x:Key="TextControlBorderBrushFocused" Color="#404040"/>
|
|
|
|
<SolidColorBrush x:Key="TextControlButtonForegroundPressed" Color="#FFFFFF"/>
|
|
|
|
<SolidColorBrush x:Key="TextControlButtonBackgroundPressed" Color="#FF4343"/>
|
|
|
|
|
Tweak the Palette's KeyChord for High Contrast mode (#6910)
<!-- Enter a brief description/summary of your PR here. What does it fix/what does it change/how was it tested (even manually, if necessary)? -->
## Summary of the Pull Request
Update the Palette to be readable under High Contrast mode
<!-- Other than the issue solved, is this relevant to any other issues/existing PRs? -->
## References
Regressed in #6833
<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist
* [X] Closes #6892
* [X] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA
* [ ] Tests added/passed
* [ ] Documentation updated. If checked, please file a pull request on [our docs repo](https://github.com/MicrosoftDocs/terminal) and link it here: #xxx
* [ ] Schema updated.
* [X] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #6892
<!-- Provide a more detailed description of the PR, other things fixed or any additional comments/features here -->
## Detailed Description of the Pull Request / Additional comments
I pulled the styling of the KeyChord text into a Style, so we can give it a different style under High Contrast. Under HC, I just left all the colors at their default, so ListView can do its thing. (IMHO, the HC style now looks better than the non-HC mode, but maybe I'm biased ;) )
<!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well -->
## Validation Steps Performed
| | Old | New |
|---|:---:|:---:|
| Light | ![light](https://user-images.githubusercontent.com/10259764/87398203-6b8f9a80-c56a-11ea-99d0-2eeefcfea269.png) | ![newlight](https://user-images.githubusercontent.com/10259764/87399212-e3aa9000-c56b-11ea-9e94-c8fae8825cd1.png) |
| Dark | ![dark](https://user-images.githubusercontent.com/10259764/87398269-819d5b00-c56a-11ea-9180-5c6ec1071b95.png) | ![newdark](https://user-images.githubusercontent.com/10259764/87399227-ead19e00-c56b-11ea-996d-ad52bc2dcbf3.png) |
| HC White | ![oldwhite](https://user-images.githubusercontent.com/10259764/87398320-92e66780-c56a-11ea-9d52-e2f6e31ae487.png) | ![newwhite](https://user-images.githubusercontent.com/10259764/87398340-98dc4880-c56a-11ea-87e2-ed257ad89c4a.png) |
| HC Black | ![oldblack](https://user-images.githubusercontent.com/10259764/87398357-9f6ac000-c56a-11ea-848c-1ccef6a65442.png) | ![newblack](https://user-images.githubusercontent.com/10259764/87398370-a396dd80-c56a-11ea-9540-8aa9bb934791.png) |
2020-07-14 18:21:59 +02:00
|
|
|
<!-- KeyChordText styles -->
|
|
|
|
<Style x:Key="KeyChordBorderStyle" TargetType="Border">
|
|
|
|
<Setter Property="BorderThickness" Value="1" />
|
|
|
|
<Setter Property="CornerRadius" Value="1" />
|
|
|
|
<Setter Property="Background" Value="{ThemeResource SystemControlBackgroundBaseLowBrush}" />
|
|
|
|
<Setter Property="BorderBrush" Value="{ThemeResource SystemControlForegroundBaseMediumBrush}" />
|
|
|
|
</Style>
|
|
|
|
<Style x:Key="KeyChordTextBlockStyle" TargetType="TextBlock">
|
|
|
|
<Setter Property="Foreground" Value="{ThemeResource SystemControlForegroundBaseMediumBrush}" />
|
|
|
|
</Style>
|
|
|
|
|
2020-06-26 22:38:02 +02:00
|
|
|
</ResourceDictionary>
|
|
|
|
<ResourceDictionary x:Key="Light">
|
|
|
|
<Style x:Key="CommandPaletteBackground" TargetType="Grid">
|
|
|
|
<Setter Property="Background" Value="#CCCCCC" />
|
|
|
|
</Style>
|
|
|
|
<!-- TextBox colors !-->
|
|
|
|
<SolidColorBrush x:Key="TextControlBackground" Color="#CCCCCC"/>
|
|
|
|
<SolidColorBrush x:Key="TextBoxPlaceholderTextThemeBrush" Color="#636363"/>
|
|
|
|
<SolidColorBrush x:Key="TextControlBorderBrush" Color="#636363"/>
|
|
|
|
<SolidColorBrush x:Key="TextControlButtonForeground" Color="#636363"/>
|
|
|
|
|
|
|
|
<SolidColorBrush x:Key="TextControlBackgroundPointerOver" Color="#DADADA"/>
|
|
|
|
<SolidColorBrush x:Key="TextControlBorderBrushPointerOver" Color="#636363"/>
|
|
|
|
<SolidColorBrush x:Key="TextControlButtonForegroundPointerOver" Color="#FF4343"/>
|
|
|
|
|
|
|
|
<SolidColorBrush x:Key="TextControlBackgroundFocused" Color="#CCCCCC"/>
|
|
|
|
<SolidColorBrush x:Key="TextControlBorderBrushFocused" Color="#636363"/>
|
|
|
|
<SolidColorBrush x:Key="TextControlButtonForegroundPressed" Color="#FFFFFF"/>
|
|
|
|
<SolidColorBrush x:Key="TextControlButtonBackgroundPressed" Color="#FF4343"/>
|
|
|
|
|
Tweak the Palette's KeyChord for High Contrast mode (#6910)
<!-- Enter a brief description/summary of your PR here. What does it fix/what does it change/how was it tested (even manually, if necessary)? -->
## Summary of the Pull Request
Update the Palette to be readable under High Contrast mode
<!-- Other than the issue solved, is this relevant to any other issues/existing PRs? -->
## References
Regressed in #6833
<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist
* [X] Closes #6892
* [X] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA
* [ ] Tests added/passed
* [ ] Documentation updated. If checked, please file a pull request on [our docs repo](https://github.com/MicrosoftDocs/terminal) and link it here: #xxx
* [ ] Schema updated.
* [X] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #6892
<!-- Provide a more detailed description of the PR, other things fixed or any additional comments/features here -->
## Detailed Description of the Pull Request / Additional comments
I pulled the styling of the KeyChord text into a Style, so we can give it a different style under High Contrast. Under HC, I just left all the colors at their default, so ListView can do its thing. (IMHO, the HC style now looks better than the non-HC mode, but maybe I'm biased ;) )
<!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well -->
## Validation Steps Performed
| | Old | New |
|---|:---:|:---:|
| Light | ![light](https://user-images.githubusercontent.com/10259764/87398203-6b8f9a80-c56a-11ea-99d0-2eeefcfea269.png) | ![newlight](https://user-images.githubusercontent.com/10259764/87399212-e3aa9000-c56b-11ea-9e94-c8fae8825cd1.png) |
| Dark | ![dark](https://user-images.githubusercontent.com/10259764/87398269-819d5b00-c56a-11ea-9180-5c6ec1071b95.png) | ![newdark](https://user-images.githubusercontent.com/10259764/87399227-ead19e00-c56b-11ea-996d-ad52bc2dcbf3.png) |
| HC White | ![oldwhite](https://user-images.githubusercontent.com/10259764/87398320-92e66780-c56a-11ea-9d52-e2f6e31ae487.png) | ![newwhite](https://user-images.githubusercontent.com/10259764/87398340-98dc4880-c56a-11ea-87e2-ed257ad89c4a.png) |
| HC Black | ![oldblack](https://user-images.githubusercontent.com/10259764/87398357-9f6ac000-c56a-11ea-848c-1ccef6a65442.png) | ![newblack](https://user-images.githubusercontent.com/10259764/87398370-a396dd80-c56a-11ea-9540-8aa9bb934791.png) |
2020-07-14 18:21:59 +02:00
|
|
|
<!-- KeyChordText styles -->
|
|
|
|
<Style x:Key="KeyChordBorderStyle" TargetType="Border">
|
|
|
|
<Setter Property="BorderThickness" Value="1" />
|
|
|
|
<Setter Property="CornerRadius" Value="1" />
|
|
|
|
<Setter Property="Background" Value="{ThemeResource SystemControlBackgroundBaseLowBrush}" />
|
|
|
|
<Setter Property="BorderBrush" Value="{ThemeResource SystemControlForegroundBaseMediumBrush}" />
|
|
|
|
</Style>
|
|
|
|
<Style x:Key="KeyChordTextBlockStyle" TargetType="TextBlock">
|
|
|
|
<Setter Property="Foreground" Value="{ThemeResource SystemControlForegroundBaseMediumBrush}" />
|
|
|
|
</Style>
|
|
|
|
|
2020-06-26 22:38:02 +02:00
|
|
|
</ResourceDictionary>
|
|
|
|
<ResourceDictionary x:Key="HighContrast">
|
|
|
|
<Style x:Key="CommandPaletteBackground" TargetType="Grid">
|
|
|
|
<Setter Property="Background" Value="{ThemeResource SystemColorWindowColor}" />
|
|
|
|
</Style>
|
Tweak the Palette's KeyChord for High Contrast mode (#6910)
<!-- Enter a brief description/summary of your PR here. What does it fix/what does it change/how was it tested (even manually, if necessary)? -->
## Summary of the Pull Request
Update the Palette to be readable under High Contrast mode
<!-- Other than the issue solved, is this relevant to any other issues/existing PRs? -->
## References
Regressed in #6833
<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist
* [X] Closes #6892
* [X] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA
* [ ] Tests added/passed
* [ ] Documentation updated. If checked, please file a pull request on [our docs repo](https://github.com/MicrosoftDocs/terminal) and link it here: #xxx
* [ ] Schema updated.
* [X] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #6892
<!-- Provide a more detailed description of the PR, other things fixed or any additional comments/features here -->
## Detailed Description of the Pull Request / Additional comments
I pulled the styling of the KeyChord text into a Style, so we can give it a different style under High Contrast. Under HC, I just left all the colors at their default, so ListView can do its thing. (IMHO, the HC style now looks better than the non-HC mode, but maybe I'm biased ;) )
<!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well -->
## Validation Steps Performed
| | Old | New |
|---|:---:|:---:|
| Light | ![light](https://user-images.githubusercontent.com/10259764/87398203-6b8f9a80-c56a-11ea-99d0-2eeefcfea269.png) | ![newlight](https://user-images.githubusercontent.com/10259764/87399212-e3aa9000-c56b-11ea-9e94-c8fae8825cd1.png) |
| Dark | ![dark](https://user-images.githubusercontent.com/10259764/87398269-819d5b00-c56a-11ea-9180-5c6ec1071b95.png) | ![newdark](https://user-images.githubusercontent.com/10259764/87399227-ead19e00-c56b-11ea-996d-ad52bc2dcbf3.png) |
| HC White | ![oldwhite](https://user-images.githubusercontent.com/10259764/87398320-92e66780-c56a-11ea-9d52-e2f6e31ae487.png) | ![newwhite](https://user-images.githubusercontent.com/10259764/87398340-98dc4880-c56a-11ea-87e2-ed257ad89c4a.png) |
| HC Black | ![oldblack](https://user-images.githubusercontent.com/10259764/87398357-9f6ac000-c56a-11ea-848c-1ccef6a65442.png) | ![newblack](https://user-images.githubusercontent.com/10259764/87398370-a396dd80-c56a-11ea-9540-8aa9bb934791.png) |
2020-07-14 18:21:59 +02:00
|
|
|
|
|
|
|
<!-- KeyChordText styles (use XAML defaults for High Contrast theme) -->
|
|
|
|
<Style x:Key="KeyChordBorderStyle" TargetType="Border"/>
|
|
|
|
<Style x:Key="KeyChordTextBlockStyle" TargetType="TextBlock"/>
|
|
|
|
|
2020-06-26 22:38:02 +02:00
|
|
|
</ResourceDictionary>
|
|
|
|
</ResourceDictionary.ThemeDictionaries>
|
|
|
|
</ResourceDictionary>
|
2020-08-11 16:03:12 +02:00
|
|
|
</UserControl.Resources>
|
2020-06-26 22:38:02 +02:00
|
|
|
|
2020-08-11 16:03:12 +02:00
|
|
|
<Grid>
|
2020-06-26 22:38:02 +02:00
|
|
|
|
2020-08-11 16:03:12 +02:00
|
|
|
<Grid.ColumnDefinitions>
|
|
|
|
<ColumnDefinition Width="2*" />
|
|
|
|
<ColumnDefinition Width="6*" />
|
|
|
|
<ColumnDefinition Width="2*" />
|
|
|
|
</Grid.ColumnDefinitions>
|
2020-06-26 22:38:02 +02:00
|
|
|
|
2020-08-11 16:03:12 +02:00
|
|
|
<Grid.RowDefinitions>
|
|
|
|
<RowDefinition Height="8*"/>
|
|
|
|
<RowDefinition Height="2*"/>
|
|
|
|
</Grid.RowDefinitions>
|
2020-06-26 22:38:02 +02:00
|
|
|
|
2020-08-11 16:03:12 +02:00
|
|
|
<!-- Setting the row/col span of this shadow backdrop is a bit of a hack. In
|
|
|
|
order to receive pointer events, an element needs to be _not_ transparent.
|
|
|
|
However, we want to be able to eat all the clicks outside the immediate
|
|
|
|
bounds of the command palette, and we don't want a semi-transparent overlay
|
|
|
|
over all of the UI. Fortunately, if we make this _shadowBackdrop the size of
|
|
|
|
the entire page, then it can be mostly transparent, and cause the root grid
|
|
|
|
to receive clicks _anywhere_ in its bounds. -->
|
2020-06-26 22:38:02 +02:00
|
|
|
|
2020-08-11 16:03:12 +02:00
|
|
|
<Grid
|
2020-06-26 22:38:02 +02:00
|
|
|
x:Name="_shadowBackdrop"
|
|
|
|
Background="Transparent"
|
|
|
|
Grid.Column="0"
|
|
|
|
Grid.Row="0"
|
|
|
|
Grid.ColumnSpan="3"
|
|
|
|
Grid.RowSpan="2"
|
|
|
|
HorizontalAlignment="Stretch"
|
|
|
|
VerticalAlignment="Stretch">
|
|
|
|
</Grid>
|
|
|
|
|
2020-08-11 16:03:12 +02:00
|
|
|
<Grid
|
2020-06-26 22:38:02 +02:00
|
|
|
x:Name="_backdrop"
|
|
|
|
Style="{ThemeResource CommandPaletteBackground}"
|
|
|
|
CornerRadius="{ThemeResource ControlCornerRadius}"
|
|
|
|
PointerPressed="_backdropPointerPressed"
|
|
|
|
Margin="8"
|
|
|
|
Grid.Column="1"
|
|
|
|
Grid.Row="0"
|
|
|
|
Windows10version1903:Shadow="{StaticResource CommandPaletteShadow}"
|
|
|
|
HorizontalAlignment="Stretch"
|
|
|
|
VerticalAlignment="Top">
|
|
|
|
|
2020-08-11 16:03:12 +02:00
|
|
|
<Grid.RowDefinitions>
|
|
|
|
<RowDefinition Height="Auto"/>
|
|
|
|
<RowDefinition Height="Auto"/>
|
|
|
|
<RowDefinition Height="*"/>
|
|
|
|
</Grid.RowDefinitions>
|
2020-06-26 22:38:02 +02:00
|
|
|
|
2020-08-11 16:03:12 +02:00
|
|
|
<TextBox
|
2020-06-26 22:38:02 +02:00
|
|
|
Grid.Row="0"
|
|
|
|
x:Name="_searchBox"
|
|
|
|
Margin="8"
|
|
|
|
IsSpellCheckEnabled="False"
|
|
|
|
TextChanged="_filterTextChanged"
|
2020-08-11 16:03:12 +02:00
|
|
|
PlaceholderText="{x:Bind SearchBoxText, Mode=OneWay}"
|
2020-06-26 22:38:02 +02:00
|
|
|
Text="">
|
2020-08-11 16:03:12 +02:00
|
|
|
</TextBox>
|
2020-06-26 22:38:02 +02:00
|
|
|
|
2020-08-11 16:03:12 +02:00
|
|
|
<TextBlock
|
2020-08-18 21:32:17 +02:00
|
|
|
Padding="16, 0, 16, 4"
|
|
|
|
x:Name="_parentCommandText"
|
|
|
|
FontStyle="Italic"
|
|
|
|
Visibility="{x:Bind ParentCommandName,
|
|
|
|
Mode=OneWay,
|
|
|
|
Converter={StaticResource ParentCommandVisibilityConverter}}"
|
|
|
|
Grid.Row="1"
|
|
|
|
Text="{x:Bind ParentCommandName, Mode=OneWay}">
|
|
|
|
</TextBlock>
|
|
|
|
|
|
|
|
<TextBlock
|
|
|
|
Padding="16"
|
|
|
|
x:Name="_noMatchesText"
|
|
|
|
FontStyle="Italic"
|
|
|
|
Visibility="Collapsed"
|
|
|
|
Grid.Row="1"
|
|
|
|
Text="{x:Bind NoMatchesText, Mode=OneWay}">
|
2020-08-11 16:03:12 +02:00
|
|
|
</TextBlock>
|
2020-06-26 22:38:02 +02:00
|
|
|
|
2020-08-11 16:03:12 +02:00
|
|
|
<ListView
|
2020-06-26 22:38:02 +02:00
|
|
|
Grid.Row="2"
|
|
|
|
x:Name="_filteredActionsView"
|
|
|
|
HorizontalAlignment="Stretch"
|
|
|
|
VerticalAlignment="Stretch"
|
|
|
|
SelectionMode="Single"
|
|
|
|
CanReorderItems="False"
|
|
|
|
AllowDrop="False"
|
|
|
|
IsItemClickEnabled="True"
|
|
|
|
ItemClick="_listItemClicked"
|
2020-08-11 16:03:12 +02:00
|
|
|
PreviewKeyDown="_keyDownHandler"
|
2020-06-26 22:38:02 +02:00
|
|
|
ItemsSource="{x:Bind FilteredActions}">
|
|
|
|
|
2020-08-11 16:03:12 +02:00
|
|
|
<ItemsControl.ItemTemplate >
|
2020-10-06 18:56:59 +02:00
|
|
|
<DataTemplate x:DataType="SettingsModel:Command">
|
2020-06-26 22:38:02 +02:00
|
|
|
|
2020-08-11 16:03:12 +02:00
|
|
|
<!-- This HorizontalContentAlignment="Stretch" is important
|
2020-08-21 20:08:02 +02:00
|
|
|
to make sure it takes the entire width of the line -->
|
2020-08-11 16:03:12 +02:00
|
|
|
<ListViewItem HorizontalContentAlignment="Stretch"
|
2020-06-26 22:38:02 +02:00
|
|
|
AutomationProperties.Name="{x:Bind Name, Mode=OneWay}"
|
|
|
|
AutomationProperties.AcceleratorKey="{x:Bind KeyChordText, Mode=OneWay}">
|
|
|
|
|
2020-08-11 16:03:12 +02:00
|
|
|
<Grid HorizontalAlignment="Stretch" ColumnSpacing="8" >
|
2020-06-26 22:38:02 +02:00
|
|
|
|
2020-08-11 16:03:12 +02:00
|
|
|
<Grid.ColumnDefinitions>
|
|
|
|
<ColumnDefinition Width="16"/> <!-- icon -->
|
|
|
|
<ColumnDefinition Width="Auto"/> <!-- command label -->
|
|
|
|
<ColumnDefinition Width="*"/> <!-- key chord -->
|
|
|
|
<ColumnDefinition Width="16"/> <!-- gutter for scrollbar -->
|
|
|
|
</Grid.ColumnDefinitions>
|
2020-06-26 22:38:02 +02:00
|
|
|
|
2020-08-11 16:03:12 +02:00
|
|
|
<IconSourceElement
|
2020-08-21 20:08:02 +02:00
|
|
|
Grid.Column="0"
|
|
|
|
Width="16"
|
|
|
|
Height="16"
|
|
|
|
IconSource="{x:Bind IconSource, Mode=OneWay}"/>
|
2020-06-26 22:38:02 +02:00
|
|
|
|
2020-08-11 16:03:12 +02:00
|
|
|
<TextBlock Grid.Column="1"
|
2020-06-26 22:38:02 +02:00
|
|
|
HorizontalAlignment="Left"
|
|
|
|
Text="{x:Bind Name, Mode=OneWay}" />
|
|
|
|
|
2020-08-11 16:03:12 +02:00
|
|
|
<!-- The block for the key chord is only visible
|
2020-08-21 20:08:02 +02:00
|
|
|
when there's actual text set as the label. See
|
|
|
|
CommandKeyChordVisibilityConverter for details. -->
|
2020-08-11 16:03:12 +02:00
|
|
|
<Border
|
2020-08-21 20:08:02 +02:00
|
|
|
Grid.Column="2"
|
|
|
|
Visibility="{x:Bind KeyChordText,
|
|
|
|
Mode=OneWay,
|
|
|
|
Converter={StaticResource CommandKeyChordVisibilityConverter}}"
|
|
|
|
Style="{ThemeResource KeyChordBorderStyle}"
|
|
|
|
Padding="2,0,2,0"
|
|
|
|
HorizontalAlignment="Right"
|
|
|
|
VerticalAlignment="Center">
|
2020-06-26 22:38:02 +02:00
|
|
|
|
2020-08-11 16:03:12 +02:00
|
|
|
<TextBlock
|
2020-08-21 20:08:02 +02:00
|
|
|
Style="{ThemeResource KeyChordTextBlockStyle}"
|
|
|
|
FontSize="12"
|
|
|
|
Text="{x:Bind KeyChordText, Mode=OneWay}" />
|
2020-08-11 16:03:12 +02:00
|
|
|
</Border>
|
2020-06-26 22:38:02 +02:00
|
|
|
|
2020-08-18 21:32:17 +02:00
|
|
|
<!-- xE70E is ChevronUp. Rotated 90 degrees, it's _ChevronRight_ -->
|
|
|
|
<FontIcon
|
|
|
|
FontFamily="Segoe MDL2 Assets"
|
|
|
|
Glyph=""
|
|
|
|
HorizontalAlignment="Right"
|
|
|
|
Visibility="{x:Bind HasNestedCommands,
|
|
|
|
Mode=OneWay,
|
|
|
|
Converter={StaticResource HasNestedCommandsVisibilityConverter}}"
|
|
|
|
Grid.Column="2">
|
|
|
|
|
|
|
|
<FontIcon.RenderTransform>
|
|
|
|
<RotateTransform CenterX="0.5" CenterY="0.5" Angle="90"/>
|
|
|
|
</FontIcon.RenderTransform>
|
|
|
|
</FontIcon>
|
|
|
|
|
2020-08-11 16:03:12 +02:00
|
|
|
</Grid>
|
|
|
|
</ListViewItem>
|
|
|
|
</DataTemplate>
|
|
|
|
</ItemsControl.ItemTemplate>
|
|
|
|
</ListView>
|
2020-06-26 22:38:02 +02:00
|
|
|
|
2020-08-11 16:03:12 +02:00
|
|
|
</Grid>
|
2020-06-26 22:38:02 +02:00
|
|
|
|
|
|
|
|
2020-08-11 16:03:12 +02:00
|
|
|
</Grid>
|
|
|
|
</UserControl>
|