mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-07 19:57:07 +02:00
Hosts file editor (#20462)
This commit is contained in:
committed by
GitHub
parent
ab41b61e84
commit
b2e1337d4e
79
src/settings-ui/Settings.UI/Views/HostsPage.xaml
Normal file
79
src/settings-ui/Settings.UI/Views/HostsPage.xaml
Normal file
@@ -0,0 +1,79 @@
|
||||
<Page
|
||||
x:Class="Microsoft.PowerToys.Settings.UI.Views.HostsPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:Microsoft.PowerToys.Settings.UI.Views"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
|
||||
mc:Ignorable="d"
|
||||
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
||||
|
||||
<controls:SettingsPageControl x:Uid="Hosts" IsTabStop="False"
|
||||
ModuleImageSource="ms-appx:///Assets/Modules/AlwaysOnTop.png">
|
||||
<controls:SettingsPageControl.ModuleContent>
|
||||
<StackPanel Orientation="Vertical">
|
||||
|
||||
<controls:Setting x:Uid="Hosts_EnableToggleControl_HeaderText">
|
||||
<controls:Setting.Icon>
|
||||
<BitmapIcon UriSource="ms-appx:///Assets/FluentIcons/FluentIconsAlwaysOnTop.png" ShowAsMonochrome="False" />
|
||||
</controls:Setting.Icon>
|
||||
<controls:Setting.ActionContent>
|
||||
<ToggleSwitch IsOn="{x:Bind ViewModel.IsEnabled, Mode=TwoWay}" x:Uid="ToggleSwitch"/>
|
||||
</controls:Setting.ActionContent>
|
||||
</controls:Setting>
|
||||
|
||||
<controls:SettingsGroup x:Uid="Hosts_Activation_GroupSettings"
|
||||
IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}">
|
||||
<Button x:Uid="Hosts_LaunchButton_Accessible"
|
||||
Style="{StaticResource SettingButtonStyle}"
|
||||
Command="{x:Bind ViewModel.LaunchEventHandler}">
|
||||
<controls:Setting x:Uid="Hosts_LaunchButtonControl"
|
||||
Style="{StaticResource ExpanderHeaderSettingStyle}"
|
||||
Icon="">
|
||||
<controls:Setting.ActionContent>
|
||||
<FontIcon Glyph=""
|
||||
FontSize="18"
|
||||
FontFamily="{ThemeResource SymbolThemeFontFamily}" />
|
||||
</controls:Setting.ActionContent>
|
||||
</controls:Setting>
|
||||
</Button>
|
||||
|
||||
<controls:Setting x:Uid="Hosts_Toggle_LaunchAdministrator"
|
||||
Icon=""
|
||||
IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.LaunchAdministratorEnabled}">
|
||||
<controls:Setting.ActionContent>
|
||||
<ToggleSwitch x:Uid="ToggleSwitch" IsOn="{x:Bind Mode=TwoWay, Path=ViewModel.LaunchAdministrator}" />
|
||||
</controls:Setting.ActionContent>
|
||||
</controls:Setting>
|
||||
|
||||
<controls:Setting x:Uid="Hosts_Toggle_ShowStartupWarning"
|
||||
Icon=""
|
||||
IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}">
|
||||
<controls:Setting.ActionContent>
|
||||
<ToggleSwitch x:Uid="ToggleSwitch" IsOn="{x:Bind Mode=TwoWay, Path=ViewModel.ShowStartupWarning}" />
|
||||
</controls:Setting.ActionContent>
|
||||
</controls:Setting>
|
||||
</controls:SettingsGroup>
|
||||
|
||||
<controls:SettingsGroup x:Uid="Hosts_File_GroupSettings"
|
||||
IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}">
|
||||
<controls:Setting x:Uid="Hosts_AdditionalLinesPosition" Icon="" >
|
||||
<controls:Setting.ActionContent>
|
||||
<ComboBox MinWidth="{StaticResource SettingActionControlMinWidth}"
|
||||
SelectedIndex="{x:Bind Path=ViewModel.AdditionalLinesPosition, Mode=TwoWay}" >
|
||||
<ComboBoxItem x:Uid="Hosts_AdditionalLinesPosition_Top" />
|
||||
<ComboBoxItem x:Uid="Hosts_AdditionalLinesPosition_Bottom" />
|
||||
</ComboBox>
|
||||
</controls:Setting.ActionContent>
|
||||
</controls:Setting>
|
||||
</controls:SettingsGroup>
|
||||
|
||||
</StackPanel>
|
||||
</controls:SettingsPageControl.ModuleContent>
|
||||
|
||||
<controls:SettingsPageControl.PrimaryLinks>
|
||||
<controls:PageLink x:Uid="LearnMore_Hosts" Link="https://aka.ms/PowerToysOverview_HostsFileEditor"/>
|
||||
</controls:SettingsPageControl.PrimaryLinks>
|
||||
</controls:SettingsPageControl>
|
||||
</Page>
|
||||
Reference in New Issue
Block a user