mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 11:48:06 +01:00
[RegistryPreview]Better theme support for caption bar (#25535)
This commit is contained in:
@@ -9,6 +9,9 @@
|
|||||||
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" />
|
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" />
|
||||||
<!-- Other merged dictionaries here -->
|
<!-- Other merged dictionaries here -->
|
||||||
</ResourceDictionary.MergedDictionaries>
|
</ResourceDictionary.MergedDictionaries>
|
||||||
|
<!-- Need to set these to transparent to allow the custom title bar to be its real color -->
|
||||||
|
<SolidColorBrush x:Key="WindowCaptionBackground">Transparent</SolidColorBrush>
|
||||||
|
<SolidColorBrush x:Key="WindowCaptionBackgroundDisabled">Transparent</SolidColorBrush>
|
||||||
<!-- Other app resources here -->
|
<!-- Other app resources here -->
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
</Application.Resources>
|
</Application.Resources>
|
||||||
|
|||||||
@@ -513,12 +513,15 @@ namespace RegistryPreview
|
|||||||
string[] file = filename.Split('\\');
|
string[] file = filename.Split('\\');
|
||||||
if (file.Length > 0)
|
if (file.Length > 0)
|
||||||
{
|
{
|
||||||
appWindow.Title = file[file.Length - 1] + " - " + APPNAME;
|
titleBarText.Text = file[file.Length - 1] + " - " + APPNAME;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
appWindow.Title = filename + " - " + APPNAME;
|
titleBarText.Text = filename + " - " + APPNAME;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Continue to update the window's title, after updating the custom title bar
|
||||||
|
appWindow.Title = titleBarText.Text;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -526,6 +529,7 @@ namespace RegistryPreview
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private void UpdateWindowTitle()
|
private void UpdateWindowTitle()
|
||||||
{
|
{
|
||||||
|
titleBarText.Text = APPNAME;
|
||||||
appWindow.Title = APPNAME;
|
appWindow.Title = APPNAME;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,313 +11,338 @@
|
|||||||
<winuiex:WindowEx.Backdrop>
|
<winuiex:WindowEx.Backdrop>
|
||||||
<winuiex:MicaSystemBackdrop />
|
<winuiex:MicaSystemBackdrop />
|
||||||
</winuiex:WindowEx.Backdrop>
|
</winuiex:WindowEx.Backdrop>
|
||||||
<Grid
|
<Grid>
|
||||||
x:Name="gridPreview"
|
|
||||||
Width="Auto"
|
|
||||||
Height="Auto"
|
|
||||||
x:FieldModifier="public"
|
|
||||||
Loaded="GridPreview_Loaded"
|
|
||||||
TabFocusNavigation="Cycle">
|
|
||||||
<Grid.Resources>
|
|
||||||
<Style x:Key="GridCardStyle" TargetType="Grid">
|
|
||||||
<Style.Setters>
|
|
||||||
<Setter Property="Background" Value="{ThemeResource CardBackgroundFillColorDefaultBrush}" />
|
|
||||||
<Setter Property="BorderThickness" Value="1" />
|
|
||||||
<Setter Property="BorderBrush" Value="{ThemeResource CardStrokeColorDefaultBrush}" />
|
|
||||||
</Style.Setters>
|
|
||||||
</Style>
|
|
||||||
</Grid.Resources>
|
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<!-- Left, Splitter, Right -->
|
|
||||||
<ColumnDefinition Width="*" />
|
|
||||||
<ColumnDefinition Width="6" />
|
|
||||||
<ColumnDefinition Width="*" />
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<!-- CommandBar, Tree, Splitter, List, StackPanel -->
|
<RowDefinition Height="32" />
|
||||||
<RowDefinition Height="Auto" />
|
|
||||||
<RowDefinition Height="*" />
|
|
||||||
<RowDefinition Height="6" />
|
|
||||||
<RowDefinition Height="*" />
|
<RowDefinition Height="*" />
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
|
<Grid
|
||||||
<Grid
|
x:Name="titleBar"
|
||||||
Grid.Row="0"
|
Grid.Row="0"
|
||||||
Grid.Column="0"
|
IsHitTestVisible="True">
|
||||||
Grid.ColumnSpan="3"
|
<StackPanel
|
||||||
Margin="8,8,8,8"
|
Margin="8,8,8,8"
|
||||||
CornerRadius="{StaticResource OverlayCornerRadius}"
|
VerticalAlignment="Bottom"
|
||||||
Style="{StaticResource GridCardStyle}">
|
Orientation="Horizontal">
|
||||||
<CommandBar
|
<Image Source="app.ico"/>
|
||||||
Name="commandBar"
|
<TextBlock
|
||||||
HorizontalAlignment="Left"
|
x:Name="titleBarText"
|
||||||
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
|
Margin="8,0,0,0"
|
||||||
BorderBrush="Transparent"
|
FontSize="12"
|
||||||
BorderThickness="0"
|
Style="{StaticResource CaptionTextBlockStyle}"
|
||||||
DefaultLabelPosition="Right"
|
Text="{Binding ApplicationTitle}" />
|
||||||
IsOpen="True"
|
</StackPanel>
|
||||||
IsTabStop="False">
|
|
||||||
|
|
||||||
<AppBarButton
|
|
||||||
x:Name="openButton"
|
|
||||||
x:Uid="OpenButton"
|
|
||||||
HorizontalAlignment="Left"
|
|
||||||
Click="OpenButton_Click"
|
|
||||||
IsTabStop="False">
|
|
||||||
<AppBarButton.Icon>
|
|
||||||
<FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph=""/>
|
|
||||||
</AppBarButton.Icon>
|
|
||||||
<AppBarButton.KeyboardAccelerators>
|
|
||||||
<KeyboardAccelerator Key="O" Modifiers="Control" />
|
|
||||||
</AppBarButton.KeyboardAccelerators>
|
|
||||||
</AppBarButton>
|
|
||||||
<AppBarSeparator />
|
|
||||||
<AppBarButton
|
|
||||||
x:Name="saveButton"
|
|
||||||
x:Uid="SaveButton"
|
|
||||||
HorizontalAlignment="Left"
|
|
||||||
Click="SaveButton_Click"
|
|
||||||
IsEnabled="False"
|
|
||||||
IsTabStop="False">
|
|
||||||
<AppBarButton.Icon>
|
|
||||||
<FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph=""/>
|
|
||||||
</AppBarButton.Icon>
|
|
||||||
<AppBarButton.KeyboardAccelerators>
|
|
||||||
<KeyboardAccelerator Key="S" Modifiers="Control" />
|
|
||||||
</AppBarButton.KeyboardAccelerators>
|
|
||||||
</AppBarButton>
|
|
||||||
<AppBarButton
|
|
||||||
x:Name="saveAsButton"
|
|
||||||
x:Uid="SaveAsButton"
|
|
||||||
HorizontalAlignment="Left"
|
|
||||||
Click="SaveAsButton_Click"
|
|
||||||
IsEnabled="True"
|
|
||||||
IsTabStop="False">
|
|
||||||
<AppBarButton.Icon>
|
|
||||||
<FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph=""/>
|
|
||||||
</AppBarButton.Icon>
|
|
||||||
<AppBarButton.KeyboardAccelerators>
|
|
||||||
<KeyboardAccelerator Key="S" Modifiers="Control,Shift" />
|
|
||||||
</AppBarButton.KeyboardAccelerators>
|
|
||||||
</AppBarButton>
|
|
||||||
<AppBarButton
|
|
||||||
x:Name="editButton"
|
|
||||||
x:Uid="EditButton"
|
|
||||||
HorizontalAlignment="Left"
|
|
||||||
Click="EditButton_Click"
|
|
||||||
IsTabStop="False">
|
|
||||||
<AppBarButton.Icon>
|
|
||||||
<FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph=""/>
|
|
||||||
</AppBarButton.Icon>
|
|
||||||
<AppBarButton.KeyboardAccelerators>
|
|
||||||
<KeyboardAccelerator Key="E" Modifiers="Control" />
|
|
||||||
</AppBarButton.KeyboardAccelerators>
|
|
||||||
</AppBarButton>
|
|
||||||
<AppBarButton
|
|
||||||
x:Name="refreshButton"
|
|
||||||
x:Uid="RefreshButton"
|
|
||||||
HorizontalAlignment="Left"
|
|
||||||
Click="RefreshButton_Click"
|
|
||||||
IsTabStop="False">
|
|
||||||
<AppBarButton.Icon>
|
|
||||||
<FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph=""/>
|
|
||||||
</AppBarButton.Icon>
|
|
||||||
<AppBarButton.KeyboardAccelerators>
|
|
||||||
<KeyboardAccelerator Key="F5" />
|
|
||||||
</AppBarButton.KeyboardAccelerators>
|
|
||||||
</AppBarButton>
|
|
||||||
<AppBarSeparator />
|
|
||||||
<AppBarButton
|
|
||||||
x:Name="writeButton"
|
|
||||||
x:Uid="WriteButton"
|
|
||||||
HorizontalAlignment="Left"
|
|
||||||
Click="WriteButton_Click"
|
|
||||||
IsTabStop="False">
|
|
||||||
<AppBarButton.Icon>
|
|
||||||
<FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph=""/>
|
|
||||||
</AppBarButton.Icon>
|
|
||||||
<AppBarButton.KeyboardAccelerators>
|
|
||||||
<KeyboardAccelerator Key="W" Modifiers="Control" />
|
|
||||||
</AppBarButton.KeyboardAccelerators>
|
|
||||||
</AppBarButton>
|
|
||||||
<AppBarSeparator />
|
|
||||||
<AppBarButton
|
|
||||||
x:Name="registryButton"
|
|
||||||
x:Uid="RegistryButton"
|
|
||||||
HorizontalAlignment="Left"
|
|
||||||
Click="RegistryButton_Click"
|
|
||||||
IsTabStop="False">
|
|
||||||
<AppBarButton.Icon>
|
|
||||||
<FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph=""/>
|
|
||||||
</AppBarButton.Icon>
|
|
||||||
<AppBarButton.KeyboardAccelerators>
|
|
||||||
<KeyboardAccelerator Key="R" Modifiers="Control" />
|
|
||||||
</AppBarButton.KeyboardAccelerators>
|
|
||||||
</AppBarButton>
|
|
||||||
<AppBarButton
|
|
||||||
x:Name="registryJumpToKeyButton"
|
|
||||||
x:Uid="RegistryJumpToKeyButton"
|
|
||||||
HorizontalAlignment="Left"
|
|
||||||
Click="RegistryJumpToKeyButton_Click"
|
|
||||||
IsTabStop="False"
|
|
||||||
IsEnabled="True">
|
|
||||||
<AppBarButton.Icon>
|
|
||||||
<FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph=""/>
|
|
||||||
</AppBarButton.Icon>
|
|
||||||
<AppBarButton.KeyboardAccelerators>
|
|
||||||
<KeyboardAccelerator Key="R" Modifiers="Control,Shift" />
|
|
||||||
</AppBarButton.KeyboardAccelerators>
|
|
||||||
</AppBarButton>
|
|
||||||
</CommandBar>
|
|
||||||
</Grid>
|
</Grid>
|
||||||
<TextBox
|
|
||||||
x:Name="textBox"
|
|
||||||
x:Uid="textBox"
|
|
||||||
Grid.Row="1"
|
|
||||||
Grid.RowSpan="3"
|
|
||||||
Grid.Column="0"
|
|
||||||
Margin="8,0,0,8"
|
|
||||||
HorizontalAlignment="Stretch"
|
|
||||||
VerticalAlignment="Stretch"
|
|
||||||
AcceptsReturn="True"
|
|
||||||
CanBeScrollAnchor="False"
|
|
||||||
FontFamily="Cascadia Mono, Consolas, Courier New"
|
|
||||||
IsSpellCheckEnabled="False"
|
|
||||||
IsTabStop="True"
|
|
||||||
IsTextPredictionEnabled="False"
|
|
||||||
PlaceholderText="{Binding PlaceholderText}"
|
|
||||||
ScrollViewer.HorizontalScrollBarVisibility="Visible"
|
|
||||||
ScrollViewer.IsHorizontalRailEnabled="True"
|
|
||||||
ScrollViewer.IsVerticalRailEnabled="True"
|
|
||||||
ScrollViewer.VerticalScrollBarVisibility="Visible"
|
|
||||||
TabIndex="0"
|
|
||||||
TextWrapping="NoWrap"
|
|
||||||
CornerRadius="{StaticResource OverlayCornerRadius}"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<Grid
|
<Grid
|
||||||
Grid.Row="1"
|
Grid.Row="1"
|
||||||
Grid.Column="2"
|
x:Name="gridPreview"
|
||||||
Margin="0,0,8,0"
|
Width="Auto"
|
||||||
CornerRadius="{StaticResource OverlayCornerRadius}"
|
Height="Auto"
|
||||||
Style="{StaticResource GridCardStyle}">
|
x:FieldModifier="public"
|
||||||
<TreeView
|
Loaded="GridPreview_Loaded"
|
||||||
x:Name="treeView"
|
TabFocusNavigation="Cycle">
|
||||||
Padding="0,0,0,0"
|
<Grid.Resources>
|
||||||
AllowDrop="False"
|
<Style x:Key="GridCardStyle" TargetType="Grid">
|
||||||
AllowFocusOnInteraction="True"
|
<Style.Setters>
|
||||||
Background="Transparent"
|
<Setter Property="Background" Value="{ThemeResource CardBackgroundFillColorDefaultBrush}" />
|
||||||
CanDragItems="False"
|
<Setter Property="BorderThickness" Value="1" />
|
||||||
CanReorderItems="False"
|
<Setter Property="BorderBrush" Value="{ThemeResource CardStrokeColorDefaultBrush}" />
|
||||||
IsEnabled="True"
|
</Style.Setters>
|
||||||
IsTabStop="False"
|
</Style>
|
||||||
ItemInvoked="TreeView_ItemInvoked"
|
</Grid.Resources>
|
||||||
ScrollViewer.BringIntoViewOnFocusChange="True"
|
<Grid.ColumnDefinitions>
|
||||||
ScrollViewer.HorizontalScrollBarVisibility="Visible"
|
<!-- Left, Splitter, Right -->
|
||||||
ScrollViewer.HorizontalScrollMode="Enabled"
|
<ColumnDefinition Width="*" />
|
||||||
ScrollViewer.VerticalScrollBarVisibility="Visible"
|
<ColumnDefinition Width="6" />
|
||||||
ScrollViewer.VerticalScrollMode="Auto"
|
<ColumnDefinition Width="*" />
|
||||||
TabIndex="1">
|
</Grid.ColumnDefinitions>
|
||||||
<TreeView.ItemTemplate>
|
<Grid.RowDefinitions>
|
||||||
<DataTemplate>
|
<!-- CommandBar, Tree, Splitter, List, StackPanel -->
|
||||||
<StackPanel
|
<RowDefinition Height="Auto" />
|
||||||
Padding="0,0,0,0"
|
<RowDefinition Height="*" />
|
||||||
VerticalAlignment="Center"
|
<RowDefinition Height="6" />
|
||||||
IsTabStop="False"
|
<RowDefinition Height="*" />
|
||||||
Orientation="Horizontal">
|
</Grid.RowDefinitions>
|
||||||
<Image
|
|
||||||
MaxWidth="16"
|
<Grid
|
||||||
MaxHeight="16"
|
Grid.Row="0"
|
||||||
Source="{Binding Path=Content.Image}"
|
Grid.Column="0"
|
||||||
ToolTipService.ToolTip="{Binding Path=Content.ToolTipText}" />
|
Grid.ColumnSpan="3"
|
||||||
<TextBlock Padding="5,0,0,0" Text="{Binding Path=Content.Name}" />
|
Margin="8,0,8,8"
|
||||||
</StackPanel>
|
|
||||||
</DataTemplate>
|
|
||||||
</TreeView.ItemTemplate>
|
|
||||||
</TreeView>
|
|
||||||
</Grid>
|
|
||||||
<Grid
|
|
||||||
Grid.Row="3"
|
|
||||||
Grid.RowSpan="2"
|
|
||||||
Grid.Column="2"
|
|
||||||
Margin="0,0,8,8"
|
|
||||||
CornerRadius="{StaticResource OverlayCornerRadius}"
|
|
||||||
Style="{StaticResource GridCardStyle}">
|
|
||||||
<controls:DataGrid
|
|
||||||
x:Name="dataGrid"
|
|
||||||
AllowDrop="False"
|
|
||||||
AreRowDetailsFrozen="True"
|
|
||||||
AutoGenerateColumns="False"
|
|
||||||
Background="Transparent"
|
|
||||||
CanDrag="False"
|
|
||||||
CornerRadius="{StaticResource OverlayCornerRadius}"
|
CornerRadius="{StaticResource OverlayCornerRadius}"
|
||||||
HeadersVisibility="Column"
|
Style="{StaticResource GridCardStyle}">
|
||||||
IsReadOnly="True"
|
<CommandBar
|
||||||
IsTabStop="true"
|
Name="commandBar"
|
||||||
ItemsSource="{x:Bind listRegistryValues}"
|
HorizontalAlignment="Left"
|
||||||
RowDetailsVisibilityMode="Collapsed"
|
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
|
||||||
SelectionMode="Single"
|
BorderBrush="Transparent"
|
||||||
TabIndex="2">
|
BorderThickness="0"
|
||||||
<controls:DataGrid.Columns>
|
DefaultLabelPosition="Right"
|
||||||
<controls:DataGridTemplateColumn
|
IsOpen="True"
|
||||||
x:Uid="NameColumn"
|
IsTabStop="False">
|
||||||
Width="Auto"
|
|
||||||
IsReadOnly="True">
|
<AppBarButton
|
||||||
<controls:DataGridTemplateColumn.CellTemplate>
|
x:Name="openButton"
|
||||||
<DataTemplate>
|
x:Uid="OpenButton"
|
||||||
<StackPanel VerticalAlignment="Center" Orientation="Horizontal">
|
HorizontalAlignment="Left"
|
||||||
<TextBlock
|
Click="OpenButton_Click"
|
||||||
Padding="10,0,0,0"
|
IsTabStop="False">
|
||||||
FontSize="14"
|
<AppBarButton.Icon>
|
||||||
IsTabStop="False"
|
<FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph=""/>
|
||||||
Text=" " />
|
</AppBarButton.Icon>
|
||||||
<Image
|
<AppBarButton.KeyboardAccelerators>
|
||||||
MaxWidth="16"
|
<KeyboardAccelerator Key="O" Modifiers="Control" />
|
||||||
MaxHeight="16"
|
</AppBarButton.KeyboardAccelerators>
|
||||||
IsTabStop="False"
|
</AppBarButton>
|
||||||
Source="{Binding ImageUri}"
|
<AppBarSeparator />
|
||||||
ToolTipService.ToolTip="{Binding ToolTipText}" />
|
<AppBarButton
|
||||||
<TextBlock
|
x:Name="saveButton"
|
||||||
Padding="5,0,10,0"
|
x:Uid="SaveButton"
|
||||||
FontSize="14"
|
HorizontalAlignment="Left"
|
||||||
IsTabStop="False"
|
Click="SaveButton_Click"
|
||||||
Text="{Binding Name}" />
|
IsEnabled="False"
|
||||||
</StackPanel>
|
IsTabStop="False">
|
||||||
</DataTemplate>
|
<AppBarButton.Icon>
|
||||||
</controls:DataGridTemplateColumn.CellTemplate>
|
<FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph=""/>
|
||||||
</controls:DataGridTemplateColumn>
|
</AppBarButton.Icon>
|
||||||
<controls:DataGridTextColumn
|
<AppBarButton.KeyboardAccelerators>
|
||||||
x:Uid="TypeColumn"
|
<KeyboardAccelerator Key="S" Modifiers="Control" />
|
||||||
Width="Auto"
|
</AppBarButton.KeyboardAccelerators>
|
||||||
Binding="{Binding Type}"
|
</AppBarButton>
|
||||||
FontSize="14" />
|
<AppBarButton
|
||||||
<controls:DataGridTextColumn
|
x:Name="saveAsButton"
|
||||||
x:Uid="ValueColumn"
|
x:Uid="SaveAsButton"
|
||||||
Width="Auto"
|
HorizontalAlignment="Left"
|
||||||
Binding="{Binding Value}"
|
Click="SaveAsButton_Click"
|
||||||
FontSize="14" />
|
IsEnabled="True"
|
||||||
</controls:DataGrid.Columns>
|
IsTabStop="False">
|
||||||
</controls:DataGrid>
|
<AppBarButton.Icon>
|
||||||
|
<FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph=""/>
|
||||||
|
</AppBarButton.Icon>
|
||||||
|
<AppBarButton.KeyboardAccelerators>
|
||||||
|
<KeyboardAccelerator Key="S" Modifiers="Control,Shift" />
|
||||||
|
</AppBarButton.KeyboardAccelerators>
|
||||||
|
</AppBarButton>
|
||||||
|
<AppBarButton
|
||||||
|
x:Name="editButton"
|
||||||
|
x:Uid="EditButton"
|
||||||
|
HorizontalAlignment="Left"
|
||||||
|
Click="EditButton_Click"
|
||||||
|
IsTabStop="False">
|
||||||
|
<AppBarButton.Icon>
|
||||||
|
<FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph=""/>
|
||||||
|
</AppBarButton.Icon>
|
||||||
|
<AppBarButton.KeyboardAccelerators>
|
||||||
|
<KeyboardAccelerator Key="E" Modifiers="Control" />
|
||||||
|
</AppBarButton.KeyboardAccelerators>
|
||||||
|
</AppBarButton>
|
||||||
|
<AppBarButton
|
||||||
|
x:Name="refreshButton"
|
||||||
|
x:Uid="RefreshButton"
|
||||||
|
HorizontalAlignment="Left"
|
||||||
|
Click="RefreshButton_Click"
|
||||||
|
IsTabStop="False">
|
||||||
|
<AppBarButton.Icon>
|
||||||
|
<FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph=""/>
|
||||||
|
</AppBarButton.Icon>
|
||||||
|
<AppBarButton.KeyboardAccelerators>
|
||||||
|
<KeyboardAccelerator Key="F5" />
|
||||||
|
</AppBarButton.KeyboardAccelerators>
|
||||||
|
</AppBarButton>
|
||||||
|
<AppBarSeparator />
|
||||||
|
<AppBarButton
|
||||||
|
x:Name="writeButton"
|
||||||
|
x:Uid="WriteButton"
|
||||||
|
HorizontalAlignment="Left"
|
||||||
|
Click="WriteButton_Click"
|
||||||
|
IsTabStop="False">
|
||||||
|
<AppBarButton.Icon>
|
||||||
|
<FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph=""/>
|
||||||
|
</AppBarButton.Icon>
|
||||||
|
<AppBarButton.KeyboardAccelerators>
|
||||||
|
<KeyboardAccelerator Key="W" Modifiers="Control" />
|
||||||
|
</AppBarButton.KeyboardAccelerators>
|
||||||
|
</AppBarButton>
|
||||||
|
<AppBarSeparator />
|
||||||
|
<AppBarButton
|
||||||
|
x:Name="registryButton"
|
||||||
|
x:Uid="RegistryButton"
|
||||||
|
HorizontalAlignment="Left"
|
||||||
|
Click="RegistryButton_Click"
|
||||||
|
IsTabStop="False">
|
||||||
|
<AppBarButton.Icon>
|
||||||
|
<FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph=""/>
|
||||||
|
</AppBarButton.Icon>
|
||||||
|
<AppBarButton.KeyboardAccelerators>
|
||||||
|
<KeyboardAccelerator Key="R" Modifiers="Control" />
|
||||||
|
</AppBarButton.KeyboardAccelerators>
|
||||||
|
</AppBarButton>
|
||||||
|
<AppBarButton
|
||||||
|
x:Name="registryJumpToKeyButton"
|
||||||
|
x:Uid="RegistryJumpToKeyButton"
|
||||||
|
HorizontalAlignment="Left"
|
||||||
|
Click="RegistryJumpToKeyButton_Click"
|
||||||
|
IsTabStop="False"
|
||||||
|
IsEnabled="True">
|
||||||
|
<AppBarButton.Icon>
|
||||||
|
<FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph=""/>
|
||||||
|
</AppBarButton.Icon>
|
||||||
|
<AppBarButton.KeyboardAccelerators>
|
||||||
|
<KeyboardAccelerator Key="R" Modifiers="Control,Shift" />
|
||||||
|
</AppBarButton.KeyboardAccelerators>
|
||||||
|
</AppBarButton>
|
||||||
|
</CommandBar>
|
||||||
|
</Grid>
|
||||||
|
<TextBox
|
||||||
|
x:Name="textBox"
|
||||||
|
x:Uid="textBox"
|
||||||
|
Grid.Row="1"
|
||||||
|
Grid.RowSpan="3"
|
||||||
|
Grid.Column="0"
|
||||||
|
Margin="8,0,0,8"
|
||||||
|
HorizontalAlignment="Stretch"
|
||||||
|
VerticalAlignment="Stretch"
|
||||||
|
AcceptsReturn="True"
|
||||||
|
CanBeScrollAnchor="False"
|
||||||
|
FontFamily="Cascadia Mono, Consolas, Courier New"
|
||||||
|
IsSpellCheckEnabled="False"
|
||||||
|
IsTabStop="True"
|
||||||
|
IsTextPredictionEnabled="False"
|
||||||
|
PlaceholderText="{Binding PlaceholderText}"
|
||||||
|
ScrollViewer.HorizontalScrollBarVisibility="Visible"
|
||||||
|
ScrollViewer.IsHorizontalRailEnabled="True"
|
||||||
|
ScrollViewer.IsVerticalRailEnabled="True"
|
||||||
|
ScrollViewer.VerticalScrollBarVisibility="Visible"
|
||||||
|
TabIndex="0"
|
||||||
|
TextWrapping="NoWrap"
|
||||||
|
CornerRadius="{StaticResource OverlayCornerRadius}"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<Grid
|
||||||
|
Grid.Row="1"
|
||||||
|
Grid.Column="2"
|
||||||
|
Margin="0,0,8,0"
|
||||||
|
CornerRadius="{StaticResource OverlayCornerRadius}"
|
||||||
|
Style="{StaticResource GridCardStyle}">
|
||||||
|
<TreeView
|
||||||
|
x:Name="treeView"
|
||||||
|
Padding="0,0,0,0"
|
||||||
|
AllowDrop="False"
|
||||||
|
AllowFocusOnInteraction="True"
|
||||||
|
Background="Transparent"
|
||||||
|
CanDragItems="False"
|
||||||
|
CanReorderItems="False"
|
||||||
|
IsEnabled="True"
|
||||||
|
IsTabStop="False"
|
||||||
|
ItemInvoked="TreeView_ItemInvoked"
|
||||||
|
ScrollViewer.BringIntoViewOnFocusChange="True"
|
||||||
|
ScrollViewer.HorizontalScrollBarVisibility="Visible"
|
||||||
|
ScrollViewer.HorizontalScrollMode="Enabled"
|
||||||
|
ScrollViewer.VerticalScrollBarVisibility="Visible"
|
||||||
|
ScrollViewer.VerticalScrollMode="Auto"
|
||||||
|
TabIndex="1">
|
||||||
|
<TreeView.ItemTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<StackPanel
|
||||||
|
Padding="0,0,0,0"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
IsTabStop="False"
|
||||||
|
Orientation="Horizontal">
|
||||||
|
<Image
|
||||||
|
MaxWidth="16"
|
||||||
|
MaxHeight="16"
|
||||||
|
Source="{Binding Path=Content.Image}"
|
||||||
|
ToolTipService.ToolTip="{Binding Path=Content.ToolTipText}" />
|
||||||
|
<TextBlock Padding="5,0,0,0" Text="{Binding Path=Content.Name}" />
|
||||||
|
</StackPanel>
|
||||||
|
</DataTemplate>
|
||||||
|
</TreeView.ItemTemplate>
|
||||||
|
</TreeView>
|
||||||
|
</Grid>
|
||||||
|
<Grid
|
||||||
|
Grid.Row="3"
|
||||||
|
Grid.RowSpan="2"
|
||||||
|
Grid.Column="2"
|
||||||
|
Margin="0,0,8,8"
|
||||||
|
CornerRadius="{StaticResource OverlayCornerRadius}"
|
||||||
|
Style="{StaticResource GridCardStyle}">
|
||||||
|
<controls:DataGrid
|
||||||
|
x:Name="dataGrid"
|
||||||
|
AllowDrop="False"
|
||||||
|
AreRowDetailsFrozen="True"
|
||||||
|
AutoGenerateColumns="False"
|
||||||
|
Background="Transparent"
|
||||||
|
CanDrag="False"
|
||||||
|
CornerRadius="{StaticResource OverlayCornerRadius}"
|
||||||
|
HeadersVisibility="Column"
|
||||||
|
IsReadOnly="True"
|
||||||
|
IsTabStop="true"
|
||||||
|
ItemsSource="{x:Bind listRegistryValues}"
|
||||||
|
RowDetailsVisibilityMode="Collapsed"
|
||||||
|
SelectionMode="Single"
|
||||||
|
TabIndex="2">
|
||||||
|
<controls:DataGrid.Columns>
|
||||||
|
<controls:DataGridTemplateColumn
|
||||||
|
x:Uid="NameColumn"
|
||||||
|
Width="Auto"
|
||||||
|
IsReadOnly="True">
|
||||||
|
<controls:DataGridTemplateColumn.CellTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<StackPanel VerticalAlignment="Center" Orientation="Horizontal">
|
||||||
|
<TextBlock
|
||||||
|
Padding="10,0,0,0"
|
||||||
|
FontSize="14"
|
||||||
|
IsTabStop="False"
|
||||||
|
Text=" " />
|
||||||
|
<Image
|
||||||
|
MaxWidth="16"
|
||||||
|
MaxHeight="16"
|
||||||
|
IsTabStop="False"
|
||||||
|
Source="{Binding ImageUri}"
|
||||||
|
ToolTipService.ToolTip="{Binding ToolTipText}" />
|
||||||
|
<TextBlock
|
||||||
|
Padding="5,0,10,0"
|
||||||
|
FontSize="14"
|
||||||
|
IsTabStop="False"
|
||||||
|
Text="{Binding Name}" />
|
||||||
|
</StackPanel>
|
||||||
|
</DataTemplate>
|
||||||
|
</controls:DataGridTemplateColumn.CellTemplate>
|
||||||
|
</controls:DataGridTemplateColumn>
|
||||||
|
<controls:DataGridTextColumn
|
||||||
|
x:Uid="TypeColumn"
|
||||||
|
Width="Auto"
|
||||||
|
Binding="{Binding Type}"
|
||||||
|
FontSize="14" />
|
||||||
|
<controls:DataGridTextColumn
|
||||||
|
x:Uid="ValueColumn"
|
||||||
|
Width="Auto"
|
||||||
|
Binding="{Binding Value}"
|
||||||
|
FontSize="14" />
|
||||||
|
</controls:DataGrid.Columns>
|
||||||
|
</controls:DataGrid>
|
||||||
|
</Grid>
|
||||||
|
<controls:GridSplitter
|
||||||
|
x:Name="verticalSplitter"
|
||||||
|
Grid.Row="1"
|
||||||
|
Grid.RowSpan="4"
|
||||||
|
Grid.Column="1"
|
||||||
|
VerticalAlignment="Stretch"
|
||||||
|
Background="Transparent"
|
||||||
|
CursorBehavior="ChangeOnSplitterHover"
|
||||||
|
GripperCursor="SizeWestEast"
|
||||||
|
IsTabStop="False" />
|
||||||
|
<controls:GridSplitter
|
||||||
|
x:Name="horizontalSplitter"
|
||||||
|
Grid.Row="2"
|
||||||
|
Grid.Column="2"
|
||||||
|
HorizontalAlignment="Stretch"
|
||||||
|
Background="Transparent"
|
||||||
|
CornerRadius="4"
|
||||||
|
CursorBehavior="ChangeOnSplitterHover"
|
||||||
|
GripperCursor="SizeNorthSouth"
|
||||||
|
IsTabStop="False" />
|
||||||
</Grid>
|
</Grid>
|
||||||
<controls:GridSplitter
|
|
||||||
x:Name="verticalSplitter"
|
|
||||||
Grid.Row="1"
|
|
||||||
Grid.RowSpan="4"
|
|
||||||
Grid.Column="1"
|
|
||||||
VerticalAlignment="Stretch"
|
|
||||||
Background="Transparent"
|
|
||||||
CursorBehavior="ChangeOnSplitterHover"
|
|
||||||
GripperCursor="SizeWestEast"
|
|
||||||
IsTabStop="False" />
|
|
||||||
<controls:GridSplitter
|
|
||||||
x:Name="horizontalSplitter"
|
|
||||||
Grid.Row="2"
|
|
||||||
Grid.Column="2"
|
|
||||||
HorizontalAlignment="Stretch"
|
|
||||||
Background="Transparent"
|
|
||||||
CornerRadius="4"
|
|
||||||
CursorBehavior="ChangeOnSplitterHover"
|
|
||||||
GripperCursor="SizeNorthSouth"
|
|
||||||
IsTabStop="False" />
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</winuiex:WindowEx>
|
</winuiex:WindowEx>
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using Microsoft.UI;
|
using Microsoft.UI;
|
||||||
using Microsoft.UI.Xaml;
|
|
||||||
using Microsoft.UI.Xaml.Controls;
|
using Microsoft.UI.Xaml.Controls;
|
||||||
using Windows.ApplicationModel.Resources;
|
using Windows.ApplicationModel.Resources;
|
||||||
using Windows.Data.Json;
|
using Windows.Data.Json;
|
||||||
@@ -54,6 +53,10 @@ namespace RegistryPreview
|
|||||||
appWindow.SetIcon("app.ico");
|
appWindow.SetIcon("app.ico");
|
||||||
appWindow.Closing += AppWindow_Closing;
|
appWindow.Closing += AppWindow_Closing;
|
||||||
|
|
||||||
|
// Extend the canvas to include the title bar so the app can support theming
|
||||||
|
ExtendsContentIntoTitleBar = true;
|
||||||
|
SetTitleBar(titleBar);
|
||||||
|
|
||||||
// if have settings, update the location of the window
|
// if have settings, update the location of the window
|
||||||
if (jsonSettings != null)
|
if (jsonSettings != null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -189,6 +189,9 @@
|
|||||||
<data name="textBox.PlaceholderText" xml:space="preserve">
|
<data name="textBox.PlaceholderText" xml:space="preserve">
|
||||||
<value>Registry file text will appear here...</value>
|
<value>Registry file text will appear here...</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="titleBarText.ApplicationTitle" xml:space="preserve">
|
||||||
|
<value>Registry Preview</value>
|
||||||
|
</data>
|
||||||
<data name="ToolTipAddedKey" xml:space="preserve">
|
<data name="ToolTipAddedKey" xml:space="preserve">
|
||||||
<value>Key will be added, if needed</value>
|
<value>Key will be added, if needed</value>
|
||||||
</data>
|
</data>
|
||||||
|
|||||||
Reference in New Issue
Block a user