mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 10:46:33 +02:00
* Handled NewWindowRequested WebView2 event, to allow links opened through Registry Preview to open in the system default web browser, rather than a new WebView2 window. * Modified RegistryPreview implementatiion to use the open URI dialog that is currently used in Peek.
41 lines
1.6 KiB
XML
41 lines
1.6 KiB
XML
<UserControl
|
|
x:Class="RegistryPreviewUILib.MonacoEditorControl"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:controls="using:Microsoft.UI.Xaml.Controls"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:local="using:RegistryPreviewUILib"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
xmlns:tkconverters="using:CommunityToolkit.WinUI.Converters"
|
|
mc:Ignorable="d">
|
|
|
|
<UserControl.Resources>
|
|
<tkconverters:BoolToVisibilityConverter
|
|
x:Key="BoolToInvertedVisibilityConverter"
|
|
FalseValue="Visible"
|
|
TrueValue="Collapsed" />
|
|
</UserControl.Resources>
|
|
|
|
<Grid>
|
|
<ProgressRing
|
|
Width="48"
|
|
Height="48"
|
|
Visibility="{x:Bind IsLoading, Mode=OneWay}" />
|
|
<Border
|
|
BorderBrush="{ThemeResource SurfaceStrokeColorDefaultBrush}"
|
|
BorderThickness="1"
|
|
Visibility="{x:Bind IsLoading, Mode=OneWay, Converter={StaticResource BoolToInvertedVisibilityConverter}}">
|
|
<controls:WebView2
|
|
x:Name="Browser"
|
|
HorizontalAlignment="Stretch"
|
|
VerticalAlignment="Stretch"
|
|
Loaded="Browser_Loaded" />
|
|
</Border>
|
|
<ContentDialog
|
|
x:Name="OpenUriDialog"
|
|
x:Uid="OpenUriDialog"
|
|
PrimaryButtonStyle="{ThemeResource AccentButtonStyle}"
|
|
SecondaryButtonClick="OpenUriDialog_SecondaryButtonClick" />
|
|
</Grid>
|
|
</UserControl>
|