2022-10-13 13:05:43 +02:00
|
|
|
<Page
|
|
|
|
|
x:Class="Hosts.Views.MainPage"
|
|
|
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
|
|
|
xmlns:converters="using:CommunityToolkit.WinUI.UI.Converters"
|
|
|
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
|
|
|
xmlns:helpers="using:Hosts.Helpers"
|
|
|
|
|
xmlns:i="using:Microsoft.Xaml.Interactivity"
|
|
|
|
|
xmlns:ic="using:Microsoft.Xaml.Interactions.Core"
|
|
|
|
|
xmlns:local="using:Hosts.Views"
|
|
|
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
|
|
|
xmlns:models="using:Hosts.Models"
|
|
|
|
|
x:Name="Page"
|
|
|
|
|
Loaded="Page_Loaded"
|
|
|
|
|
mc:Ignorable="d">
|
|
|
|
|
<i:Interaction.Behaviors>
|
|
|
|
|
<ic:EventTriggerBehavior EventName="Loaded">
|
|
|
|
|
<ic:InvokeCommandAction Command="{x:Bind ViewModel.ReadHostsCommand}" />
|
|
|
|
|
</ic:EventTriggerBehavior>
|
|
|
|
|
</i:Interaction.Behaviors>
|
|
|
|
|
|
|
|
|
|
<Page.Resources>
|
|
|
|
|
<converters:StringVisibilityConverter
|
|
|
|
|
x:Key="StringVisibilityConverter"
|
|
|
|
|
EmptyValue="Collapsed"
|
|
|
|
|
NotEmptyValue="Visible" />
|
|
|
|
|
<converters:BoolNegationConverter x:Key="BoolNegationConverter" />
|
|
|
|
|
<converters:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter" />
|
2023-02-22 17:19:01 +01:00
|
|
|
<converters:BoolToVisibilityConverter
|
|
|
|
|
x:Key="BoolToInvertedVisibilityConverter"
|
|
|
|
|
TrueValue="Collapsed"
|
|
|
|
|
FalseValue="Visible" />
|
2023-06-11 17:59:30 +02:00
|
|
|
<converters:DoubleToVisibilityConverter
|
|
|
|
|
x:Key="DoubleToVisibilityConverter"
|
|
|
|
|
FalseValue="Visible"
|
|
|
|
|
GreaterThan="0"
|
|
|
|
|
TrueValue="Collapsed" />
|
2022-10-13 13:05:43 +02:00
|
|
|
</Page.Resources>
|
|
|
|
|
|
2023-07-19 07:45:53 +02:00
|
|
|
<Grid
|
|
|
|
|
Margin="16"
|
|
|
|
|
RowSpacing="8">
|
2022-10-13 13:05:43 +02:00
|
|
|
<Grid.RowDefinitions>
|
2023-07-19 07:45:53 +02:00
|
|
|
<RowDefinition Height="Auto" /><!-- buttons -->
|
|
|
|
|
<RowDefinition Height="*" /><!-- content -->
|
2022-10-13 13:05:43 +02:00
|
|
|
</Grid.RowDefinitions>
|
|
|
|
|
|
2023-07-19 07:45:53 +02:00
|
|
|
<Grid><!-- buttons -->
|
2022-10-13 13:05:43 +02:00
|
|
|
<Button
|
|
|
|
|
x:Uid="AddEntryBtn"
|
|
|
|
|
Command="{x:Bind NewDialogCommand}">
|
2022-11-07 12:26:09 +01:00
|
|
|
<StackPanel
|
|
|
|
|
Orientation="Horizontal"
|
2023-05-09 16:40:18 +02:00
|
|
|
Spacing="8">
|
|
|
|
|
<FontIcon
|
2022-10-13 13:05:43 +02:00
|
|
|
x:Name="Icon"
|
|
|
|
|
FontSize="16"
|
|
|
|
|
Foreground="{ThemeResource AccentTextFillColorPrimaryBrush}"
|
2023-05-09 16:40:18 +02:00
|
|
|
Glyph="" />
|
2022-10-13 13:05:43 +02:00
|
|
|
<TextBlock x:Uid="AddEntry" />
|
|
|
|
|
</StackPanel>
|
2023-06-05 14:08:41 +02:00
|
|
|
<Button.KeyboardAccelerators>
|
|
|
|
|
<KeyboardAccelerator
|
|
|
|
|
Modifiers="Control"
|
|
|
|
|
Key="N" />
|
|
|
|
|
</Button.KeyboardAccelerators>
|
2022-10-13 13:05:43 +02:00
|
|
|
</Button>
|
|
|
|
|
|
|
|
|
|
<StackPanel
|
|
|
|
|
HorizontalAlignment="Right"
|
2023-07-19 07:45:53 +02:00
|
|
|
Orientation="Horizontal"
|
|
|
|
|
Spacing="4">
|
2022-10-13 13:05:43 +02:00
|
|
|
<Button
|
|
|
|
|
x:Uid="AdditionalLinesBtn"
|
2023-07-19 07:45:53 +02:00
|
|
|
Height="32"
|
2022-10-13 13:05:43 +02:00
|
|
|
Command="{x:Bind AdditionalLinesDialogCommand}"
|
|
|
|
|
Style="{StaticResource SubtleButtonStyle}">
|
|
|
|
|
<FontIcon
|
2023-05-09 16:40:18 +02:00
|
|
|
FontSize="16"
|
2022-10-13 13:05:43 +02:00
|
|
|
Glyph="" />
|
|
|
|
|
</Button>
|
|
|
|
|
|
|
|
|
|
<Button
|
|
|
|
|
x:Uid="FilterBtn"
|
2023-07-19 07:45:53 +02:00
|
|
|
Height="32"
|
2022-10-13 13:05:43 +02:00
|
|
|
Style="{StaticResource SubtleButtonStyle}">
|
|
|
|
|
<FontIcon
|
2023-05-09 16:40:18 +02:00
|
|
|
FontSize="16"
|
2022-10-13 13:05:43 +02:00
|
|
|
Glyph="" />
|
|
|
|
|
<Button.Flyout>
|
|
|
|
|
<Flyout>
|
|
|
|
|
<StackPanel
|
|
|
|
|
Width="320"
|
|
|
|
|
HorizontalAlignment="Stretch"
|
|
|
|
|
Spacing="12">
|
|
|
|
|
<AutoSuggestBox
|
|
|
|
|
x:Uid="AddressFilter"
|
|
|
|
|
PlaceholderText=""
|
|
|
|
|
QueryIcon="Find"
|
|
|
|
|
Text="{x:Bind ViewModel.AddressFilter, Mode=TwoWay}">
|
|
|
|
|
<i:Interaction.Behaviors>
|
|
|
|
|
<ic:EventTriggerBehavior EventName="TextChanged">
|
|
|
|
|
<ic:InvokeCommandAction Command="{x:Bind ViewModel.ApplyFiltersCommand}" />
|
|
|
|
|
</ic:EventTriggerBehavior>
|
|
|
|
|
</i:Interaction.Behaviors>
|
|
|
|
|
</AutoSuggestBox>
|
|
|
|
|
<AutoSuggestBox
|
|
|
|
|
x:Uid="HostsFilter"
|
|
|
|
|
QueryIcon="Find"
|
|
|
|
|
Text="{x:Bind ViewModel.HostsFilter, Mode=TwoWay}">
|
|
|
|
|
<i:Interaction.Behaviors>
|
|
|
|
|
<ic:EventTriggerBehavior EventName="TextChanged">
|
|
|
|
|
<ic:InvokeCommandAction Command="{x:Bind ViewModel.ApplyFiltersCommand}" />
|
|
|
|
|
</ic:EventTriggerBehavior>
|
|
|
|
|
</i:Interaction.Behaviors>
|
|
|
|
|
</AutoSuggestBox>
|
|
|
|
|
<AutoSuggestBox
|
|
|
|
|
x:Uid="CommentFilter"
|
|
|
|
|
QueryIcon="Find"
|
|
|
|
|
Text="{x:Bind ViewModel.CommentFilter, Mode=TwoWay}">
|
|
|
|
|
<i:Interaction.Behaviors>
|
|
|
|
|
<ic:EventTriggerBehavior EventName="TextChanged">
|
|
|
|
|
<ic:InvokeCommandAction Command="{x:Bind ViewModel.ApplyFiltersCommand}" />
|
|
|
|
|
</ic:EventTriggerBehavior>
|
|
|
|
|
</i:Interaction.Behaviors>
|
|
|
|
|
</AutoSuggestBox>
|
2022-12-14 16:52:00 +01:00
|
|
|
<ToggleSwitch
|
|
|
|
|
x:Uid="ShowOnlyDuplicates"
|
|
|
|
|
IsOn="{x:Bind ViewModel.ShowOnlyDuplicates, Mode=TwoWay}" />
|
2022-10-13 13:05:43 +02:00
|
|
|
<Button
|
|
|
|
|
x:Uid="ClearFiltersBtn"
|
|
|
|
|
HorizontalAlignment="Right"
|
|
|
|
|
Command="{x:Bind ViewModel.ClearFiltersCommand}"
|
2023-07-19 07:45:53 +02:00
|
|
|
Style="{StaticResource AccentButtonStyle}"
|
|
|
|
|
IsEnabled="{x:Bind ViewModel.Filtered, Mode=OneWay}"/>
|
2022-10-13 13:05:43 +02:00
|
|
|
</StackPanel>
|
|
|
|
|
</Flyout>
|
|
|
|
|
</Button.Flyout>
|
|
|
|
|
</Button>
|
2022-11-07 12:26:09 +01:00
|
|
|
|
2022-10-24 20:09:00 +02:00
|
|
|
<Button
|
|
|
|
|
x:Uid="OpenHostsFileBtn"
|
2023-07-19 07:45:53 +02:00
|
|
|
Height="32"
|
2022-10-24 20:09:00 +02:00
|
|
|
Command="{x:Bind ViewModel.OpenHostsFileCommand}"
|
|
|
|
|
Style="{StaticResource SubtleButtonStyle}">
|
|
|
|
|
<FontIcon
|
2023-05-09 16:40:18 +02:00
|
|
|
FontSize="16"
|
2022-10-24 20:09:00 +02:00
|
|
|
Glyph="" />
|
|
|
|
|
</Button>
|
2022-11-07 12:26:09 +01:00
|
|
|
|
2022-10-13 13:05:43 +02:00
|
|
|
<Button
|
|
|
|
|
x:Uid="SettingsBtn"
|
2023-07-19 07:45:53 +02:00
|
|
|
Height="32"
|
2022-10-13 13:05:43 +02:00
|
|
|
Command="{x:Bind ViewModel.OpenSettingsCommand}"
|
|
|
|
|
Style="{StaticResource SubtleButtonStyle}">
|
|
|
|
|
<FontIcon
|
2023-05-09 16:40:18 +02:00
|
|
|
FontSize="16"
|
2022-10-13 13:05:43 +02:00
|
|
|
Glyph="" />
|
|
|
|
|
</Button>
|
|
|
|
|
</StackPanel>
|
|
|
|
|
</Grid>
|
|
|
|
|
|
|
|
|
|
<!--
|
|
|
|
|
https://github.com/microsoft/microsoft-ui-xaml/issues/7690
|
|
|
|
|
AllowDrop="{x:Bind ViewModel.Filtered, Mode=OneWay, Converter={StaticResource BoolNegationConverter}}"
|
|
|
|
|
CanDragItems="{x:Bind ViewModel.Filtered, Mode=OneWay, Converter={StaticResource BoolNegationConverter}}"
|
|
|
|
|
CanReorderItems="{x:Bind ViewModel.Filtered, Mode=OneWay, Converter={StaticResource BoolNegationConverter}}"
|
|
|
|
|
-->
|
2023-06-11 17:59:30 +02:00
|
|
|
<Grid
|
2022-10-13 13:05:43 +02:00
|
|
|
Grid.Row="1"
|
2023-07-19 07:45:53 +02:00
|
|
|
Visibility="{x:Bind ViewModel.IsLoading, Converter={StaticResource BoolToInvertedVisibilityConverter}, Mode=OneWay}">
|
|
|
|
|
<Grid.RowDefinitions>
|
|
|
|
|
<RowDefinition Height="*" />
|
|
|
|
|
<RowDefinition Height="Auto" />
|
|
|
|
|
</Grid.RowDefinitions>
|
|
|
|
|
|
2023-06-11 17:59:30 +02:00
|
|
|
<ListView
|
|
|
|
|
x:Name="Entries"
|
|
|
|
|
x:Uid="Entries"
|
|
|
|
|
Background="{ThemeResource LayerFillColorDefaultBrush}"
|
|
|
|
|
BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}"
|
|
|
|
|
BorderThickness="1"
|
2023-07-19 07:45:53 +02:00
|
|
|
CornerRadius="{StaticResource OverlayCornerRadius}"
|
2023-06-11 17:59:30 +02:00
|
|
|
IsItemClickEnabled="True"
|
|
|
|
|
ItemClick="Entries_ItemClick"
|
|
|
|
|
KeyDown="Entries_KeyDown"
|
|
|
|
|
GotFocus="Entries_GotFocus"
|
|
|
|
|
ItemsSource="{x:Bind ViewModel.Entries, Mode=TwoWay}"
|
2023-07-19 07:45:53 +02:00
|
|
|
SelectedItem="{x:Bind ViewModel.Selected, Mode=TwoWay}">
|
2023-06-11 17:59:30 +02:00
|
|
|
<ListView.ItemTemplate>
|
|
|
|
|
<DataTemplate x:DataType="models:Entry">
|
|
|
|
|
<Grid
|
|
|
|
|
AutomationProperties.Name="{x:Bind Address, Mode=OneWay}"
|
|
|
|
|
Background="Transparent"
|
|
|
|
|
IsRightTapEnabled="True"
|
2023-07-19 07:45:53 +02:00
|
|
|
RightTapped="Grid_RightTapped"
|
|
|
|
|
ColumnSpacing="8">
|
2023-06-11 17:59:30 +02:00
|
|
|
<Grid.ColumnDefinitions>
|
2023-07-19 07:45:53 +02:00
|
|
|
<ColumnDefinition Width="256"/><!--address-->
|
|
|
|
|
<ColumnDefinition Width="*"/><!--comment-->
|
|
|
|
|
<ColumnDefinition Width="Auto"/><!--status-->
|
|
|
|
|
<ColumnDefinition Width="Auto"/><!--duplicate-->
|
|
|
|
|
<ColumnDefinition Width="Auto"/><!--toggleswitch-->
|
2023-06-11 17:59:30 +02:00
|
|
|
</Grid.ColumnDefinitions>
|
|
|
|
|
<FlyoutBase.AttachedFlyout>
|
|
|
|
|
<MenuFlyout Opened="MenuFlyout_Opened">
|
|
|
|
|
<MenuFlyoutItem
|
|
|
|
|
x:Uid="Edit"
|
|
|
|
|
Click="Edit_Click"
|
|
|
|
|
Icon="Edit">
|
|
|
|
|
<MenuFlyoutItem.KeyboardAccelerators>
|
|
|
|
|
<KeyboardAccelerator
|
|
|
|
|
Modifiers="Control"
|
|
|
|
|
Key="E" />
|
|
|
|
|
</MenuFlyoutItem.KeyboardAccelerators>
|
|
|
|
|
</MenuFlyoutItem>
|
|
|
|
|
<MenuFlyoutItem
|
|
|
|
|
x:Uid="Ping"
|
|
|
|
|
Click="Ping_Click"
|
|
|
|
|
Icon="TwoBars">
|
|
|
|
|
<MenuFlyoutItem.KeyboardAccelerators>
|
|
|
|
|
<KeyboardAccelerator
|
|
|
|
|
Modifiers="Control"
|
|
|
|
|
Key="P" />
|
|
|
|
|
</MenuFlyoutItem.KeyboardAccelerators>
|
|
|
|
|
</MenuFlyoutItem>
|
|
|
|
|
<MenuFlyoutItem
|
|
|
|
|
x:Uid="MoveUp"
|
|
|
|
|
Click="ReorderButtonUp_Click"
|
|
|
|
|
IsEnabled="{Binding DataContext.Filtered, ElementName=Page, Mode=OneWay, Converter={StaticResource BoolNegationConverter}}">
|
|
|
|
|
<MenuFlyoutItem.Icon>
|
|
|
|
|
<FontIcon Glyph="" />
|
|
|
|
|
</MenuFlyoutItem.Icon>
|
|
|
|
|
</MenuFlyoutItem>
|
|
|
|
|
<MenuFlyoutItem
|
|
|
|
|
x:Uid="MoveDown"
|
|
|
|
|
Click="ReorderButtonDown_Click"
|
|
|
|
|
IsEnabled="{Binding DataContext.Filtered, ElementName=Page, Mode=OneWay, Converter={StaticResource BoolNegationConverter}}">
|
|
|
|
|
<MenuFlyoutItem.Icon>
|
|
|
|
|
<FontIcon Glyph="" />
|
|
|
|
|
</MenuFlyoutItem.Icon>
|
|
|
|
|
</MenuFlyoutItem>
|
|
|
|
|
<MenuFlyoutSeparator />
|
|
|
|
|
<MenuFlyoutItem
|
|
|
|
|
x:Uid="Delete"
|
|
|
|
|
Click="Delete_Click"
|
|
|
|
|
Icon="Delete">
|
2023-07-19 07:45:53 +02:00
|
|
|
<MenuFlyoutItem.KeyboardAccelerators>
|
2023-06-11 17:59:30 +02:00
|
|
|
<KeyboardAccelerator Key="Delete" />
|
|
|
|
|
</MenuFlyoutItem.KeyboardAccelerators>
|
|
|
|
|
</MenuFlyoutItem>
|
|
|
|
|
</MenuFlyout>
|
|
|
|
|
</FlyoutBase.AttachedFlyout>
|
|
|
|
|
<TextBlock
|
|
|
|
|
Grid.Column="0"
|
|
|
|
|
VerticalAlignment="Center"
|
|
|
|
|
Text="{x:Bind Address, Mode=OneWay}"
|
|
|
|
|
TextWrapping="Wrap" />
|
|
|
|
|
<TextBlock
|
|
|
|
|
Grid.Column="1"
|
|
|
|
|
VerticalAlignment="Center"
|
|
|
|
|
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
|
|
|
|
|
Style="{StaticResource CaptionTextBlockStyle}"
|
|
|
|
|
Text="{x:Bind helpers:StringHelper.GetHostsWithComment(Hosts, Comment), Mode=OneWay}"
|
|
|
|
|
TextWrapping="WrapWholeWords" />
|
|
|
|
|
<ProgressRing
|
|
|
|
|
Grid.Column="2"
|
|
|
|
|
Width="20"
|
|
|
|
|
Height="20"
|
|
|
|
|
IsActive="{x:Bind Pinging, Mode=OneWay}" />
|
|
|
|
|
<FontIcon
|
|
|
|
|
x:Uid="PingIcon"
|
|
|
|
|
x:Name="PingIcon"
|
|
|
|
|
Grid.Column="2"
|
2023-07-19 07:45:53 +02:00
|
|
|
FontSize="16"
|
2023-06-11 17:59:30 +02:00
|
|
|
Visibility="Collapsed">
|
|
|
|
|
<i:Interaction.Behaviors>
|
|
|
|
|
<ic:DataTriggerBehavior
|
|
|
|
|
Binding="{x:Bind Ping, Mode=OneWay}"
|
|
|
|
|
ComparisonCondition="Equal"
|
|
|
|
|
Value="True">
|
|
|
|
|
<ic:ChangePropertyAction
|
|
|
|
|
PropertyName="Glyph"
|
|
|
|
|
TargetObject="{Binding ElementName=PingIcon}"
|
|
|
|
|
Value="" />
|
|
|
|
|
<ic:ChangePropertyAction
|
|
|
|
|
PropertyName="Visibility"
|
|
|
|
|
TargetObject="{Binding ElementName=PingIcon}"
|
|
|
|
|
Value="Visible" />
|
|
|
|
|
<ic:ChangePropertyAction
|
|
|
|
|
PropertyName="Foreground"
|
|
|
|
|
TargetObject="{Binding ElementName=PingIcon}"
|
|
|
|
|
Value="{StaticResource SystemFillColorSuccessBrush}" />
|
|
|
|
|
</ic:DataTriggerBehavior>
|
|
|
|
|
<ic:DataTriggerBehavior
|
|
|
|
|
Binding="{x:Bind Ping, Mode=OneWay}"
|
|
|
|
|
ComparisonCondition="Equal"
|
|
|
|
|
Value="False">
|
|
|
|
|
<ic:ChangePropertyAction
|
|
|
|
|
PropertyName="Glyph"
|
|
|
|
|
TargetObject="{Binding ElementName=PingIcon}"
|
|
|
|
|
Value="" />
|
|
|
|
|
<ic:ChangePropertyAction
|
|
|
|
|
PropertyName="Visibility"
|
|
|
|
|
TargetObject="{Binding ElementName=PingIcon}"
|
|
|
|
|
Value="Visible" />
|
|
|
|
|
<ic:ChangePropertyAction
|
|
|
|
|
PropertyName="Foreground"
|
|
|
|
|
TargetObject="{Binding ElementName=PingIcon}"
|
|
|
|
|
Value="{StaticResource SystemFillColorCriticalBrush}" />
|
|
|
|
|
</ic:DataTriggerBehavior>
|
|
|
|
|
<ic:DataTriggerBehavior
|
|
|
|
|
Binding="{x:Bind Ping, Mode=OneWay}"
|
|
|
|
|
ComparisonCondition="Equal"
|
|
|
|
|
Value="{x:Null}">
|
|
|
|
|
<ic:ChangePropertyAction
|
|
|
|
|
PropertyName="Visibility"
|
|
|
|
|
TargetObject="{Binding ElementName=PingIcon}"
|
|
|
|
|
Value="Collapsed" />
|
|
|
|
|
</ic:DataTriggerBehavior>
|
|
|
|
|
</i:Interaction.Behaviors>
|
|
|
|
|
</FontIcon>
|
|
|
|
|
<FontIcon
|
|
|
|
|
x:Uid="DuplicateEntryIcon"
|
|
|
|
|
Grid.Column="3"
|
|
|
|
|
Foreground="{StaticResource SystemControlErrorTextForegroundBrush}"
|
2023-07-19 07:45:53 +02:00
|
|
|
FontSize="16"
|
2023-06-11 17:59:30 +02:00
|
|
|
Glyph=""
|
|
|
|
|
Visibility="{x:Bind Duplicate, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}}" />
|
|
|
|
|
<ToggleSwitch
|
|
|
|
|
x:Uid="ActiveToggle"
|
|
|
|
|
Grid.Column="4"
|
|
|
|
|
Width="40"
|
|
|
|
|
MinWidth="0"
|
|
|
|
|
HorizontalAlignment="Right"
|
|
|
|
|
IsOn="{x:Bind Active, Mode=TwoWay}"
|
|
|
|
|
OffContent=""
|
|
|
|
|
OnContent="" />
|
|
|
|
|
</Grid>
|
|
|
|
|
</DataTemplate>
|
|
|
|
|
</ListView.ItemTemplate>
|
|
|
|
|
</ListView>
|
2023-07-19 07:45:53 +02:00
|
|
|
|
2023-06-11 17:59:30 +02:00
|
|
|
<StackPanel
|
|
|
|
|
HorizontalAlignment="Center"
|
|
|
|
|
VerticalAlignment="Center"
|
|
|
|
|
Visibility="{x:Bind ViewModel.Entries.Count, Mode=OneWay, Converter={StaticResource DoubleToVisibilityConverter}}">
|
|
|
|
|
<StackPanel
|
|
|
|
|
HorizontalAlignment="Center"
|
|
|
|
|
VerticalAlignment="Center"
|
|
|
|
|
Spacing="8"
|
|
|
|
|
Visibility="{x:Bind ViewModel.Filtered, Mode=OneWay, Converter={StaticResource BoolToInvertedVisibilityConverter}}">
|
|
|
|
|
<FontIcon
|
|
|
|
|
FontSize="32"
|
|
|
|
|
Glyph="" />
|
|
|
|
|
<TextBlock
|
|
|
|
|
x:Uid="EmptyHosts"
|
|
|
|
|
HorizontalAlignment="Center"
|
|
|
|
|
TextWrapping="Wrap"
|
|
|
|
|
Foreground="{ThemeResource TextFillColorSecondaryBrush}" />
|
|
|
|
|
<HyperlinkButton
|
|
|
|
|
x:Uid="AddEntryLink"
|
|
|
|
|
HorizontalAlignment="Center"
|
|
|
|
|
Command="{x:Bind NewDialogCommand}" />
|
|
|
|
|
</StackPanel>
|
2023-07-19 07:45:53 +02:00
|
|
|
|
2023-06-11 17:59:30 +02:00
|
|
|
<StackPanel
|
|
|
|
|
HorizontalAlignment="Center"
|
|
|
|
|
VerticalAlignment="Center"
|
|
|
|
|
Spacing="8"
|
|
|
|
|
Visibility="{x:Bind ViewModel.Filtered, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}}">
|
|
|
|
|
<FontIcon
|
|
|
|
|
FontSize="32"
|
|
|
|
|
Glyph="" />
|
|
|
|
|
<TextBlock
|
|
|
|
|
x:Uid="EmptyFilterResults"
|
|
|
|
|
HorizontalAlignment="Center"
|
|
|
|
|
TextWrapping="Wrap"
|
|
|
|
|
Foreground="{ThemeResource TextFillColorSecondaryBrush}" />
|
|
|
|
|
<HyperlinkButton
|
|
|
|
|
x:Uid="ClearFiltersLink"
|
|
|
|
|
HorizontalAlignment="Center"
|
|
|
|
|
Command="{x:Bind ViewModel.ClearFiltersCommand}" />
|
|
|
|
|
</StackPanel>
|
|
|
|
|
</StackPanel>
|
2023-07-19 07:45:53 +02:00
|
|
|
|
|
|
|
|
<StackPanel
|
|
|
|
|
Grid.Row="1">
|
|
|
|
|
<InfoBar
|
|
|
|
|
x:Uid="FileSaveError"
|
|
|
|
|
Margin="0,8,0,0"
|
|
|
|
|
Severity="Error"
|
|
|
|
|
IsOpen="{x:Bind ViewModel.Error, Mode=TwoWay}"
|
|
|
|
|
Visibility="{x:Bind ViewModel.Error, Mode=TwoWay, Converter={StaticResource BoolToVisibilityConverter}}" />
|
|
|
|
|
|
|
|
|
|
<InfoBar
|
|
|
|
|
x:Uid="FileChanged"
|
|
|
|
|
Margin="0,8,0,0"
|
|
|
|
|
Severity="Informational"
|
|
|
|
|
IsOpen="{x:Bind ViewModel.FileChanged, Mode=TwoWay}"
|
|
|
|
|
Visibility="{x:Bind ViewModel.FileChanged, Mode=TwoWay, Converter={StaticResource BoolToVisibilityConverter}}">
|
|
|
|
|
<InfoBar.ActionButton>
|
|
|
|
|
<Button
|
|
|
|
|
x:Uid="Reload"
|
|
|
|
|
Command="{x:Bind ViewModel.ReadHostsCommand}" />
|
|
|
|
|
</InfoBar.ActionButton>
|
|
|
|
|
</InfoBar>
|
|
|
|
|
</StackPanel>
|
2023-06-11 17:59:30 +02:00
|
|
|
</Grid>
|
2023-07-19 07:45:53 +02:00
|
|
|
|
2023-02-22 17:19:01 +01:00
|
|
|
<ProgressRing
|
|
|
|
|
Width="48"
|
|
|
|
|
Height="48"
|
|
|
|
|
Grid.Row="1"
|
|
|
|
|
IsActive="{x:Bind ViewModel.IsLoading, Mode=OneWay}" />
|
2023-07-19 07:45:53 +02:00
|
|
|
|
2022-10-13 13:05:43 +02:00
|
|
|
<ContentDialog
|
|
|
|
|
x:Name="EntryDialog"
|
|
|
|
|
x:Uid="EntryDialog"
|
2023-06-05 14:08:41 +02:00
|
|
|
IsPrimaryButtonEnabled="{Binding Valid, Mode=OneWay}"
|
2022-10-13 13:05:43 +02:00
|
|
|
PrimaryButtonStyle="{StaticResource AccentButtonStyle}">
|
|
|
|
|
<ContentDialog.DataContext>
|
|
|
|
|
<models:Entry />
|
|
|
|
|
</ContentDialog.DataContext>
|
2023-07-19 07:45:53 +02:00
|
|
|
<ScrollViewer>
|
2022-10-20 01:43:22 +02:00
|
|
|
<StackPanel
|
2023-07-19 07:45:53 +02:00
|
|
|
MinWidth="320"
|
2022-10-20 01:43:22 +02:00
|
|
|
HorizontalAlignment="Stretch"
|
2023-07-19 07:45:53 +02:00
|
|
|
Spacing="12">
|
2022-10-20 01:43:22 +02:00
|
|
|
<TextBox
|
|
|
|
|
x:Uid="Address"
|
|
|
|
|
IsSpellCheckEnabled="False"
|
|
|
|
|
Text="{Binding Address, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
|
|
|
|
|
<TextBox
|
|
|
|
|
x:Uid="Hosts"
|
|
|
|
|
IsSpellCheckEnabled="False"
|
2023-06-23 21:54:45 +02:00
|
|
|
AcceptsReturn="False"
|
|
|
|
|
TextWrapping="Wrap"
|
|
|
|
|
ScrollViewer.IsVerticalRailEnabled="True"
|
|
|
|
|
ScrollViewer.VerticalScrollBarVisibility="Visible"
|
|
|
|
|
ScrollViewer.VerticalScrollMode="Enabled"
|
2022-10-20 01:43:22 +02:00
|
|
|
Text="{Binding Hosts, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
|
|
|
|
|
<TextBox
|
|
|
|
|
x:Uid="Comment"
|
2023-06-23 21:54:45 +02:00
|
|
|
IsSpellCheckEnabled="False"
|
|
|
|
|
AcceptsReturn="False"
|
|
|
|
|
TextWrapping="Wrap"
|
|
|
|
|
ScrollViewer.IsVerticalRailEnabled="True"
|
|
|
|
|
ScrollViewer.VerticalScrollBarVisibility="Visible"
|
|
|
|
|
ScrollViewer.VerticalScrollMode="Enabled"
|
2022-10-20 01:43:22 +02:00
|
|
|
Text="{Binding Comment, Mode=TwoWay}" />
|
|
|
|
|
<ToggleSwitch
|
|
|
|
|
x:Uid="Active"
|
|
|
|
|
IsOn="{Binding Active, Mode=TwoWay}"
|
|
|
|
|
OffContent=""
|
|
|
|
|
OnContent="" />
|
|
|
|
|
</StackPanel>
|
|
|
|
|
</ScrollViewer>
|
2022-10-13 13:05:43 +02:00
|
|
|
</ContentDialog>
|
|
|
|
|
|
|
|
|
|
<ContentDialog
|
|
|
|
|
x:Name="DeleteDialog"
|
|
|
|
|
x:Uid="DeleteDialog"
|
|
|
|
|
PrimaryButtonCommand="{x:Bind DeleteCommand}"
|
|
|
|
|
PrimaryButtonStyle="{StaticResource AccentButtonStyle}">
|
|
|
|
|
<TextBlock x:Uid="DeleteDialogAreYouSure" />
|
|
|
|
|
</ContentDialog>
|
|
|
|
|
|
|
|
|
|
<ContentDialog
|
|
|
|
|
x:Name="AdditionalLinesDialog"
|
|
|
|
|
x:Uid="AdditionalLinesDialog"
|
|
|
|
|
PrimaryButtonCommand="{x:Bind UpdateAdditionalLinesCommand}"
|
|
|
|
|
PrimaryButtonStyle="{StaticResource AccentButtonStyle}">
|
|
|
|
|
|
|
|
|
|
<TextBox
|
|
|
|
|
x:Name="AdditionalLines"
|
|
|
|
|
HorizontalAlignment="Stretch"
|
2023-07-19 07:45:53 +02:00
|
|
|
MinHeight="40"
|
|
|
|
|
Padding="16,0"
|
2022-10-13 13:05:43 +02:00
|
|
|
AcceptsReturn="True"
|
2022-11-07 12:26:09 +01:00
|
|
|
ScrollViewer.IsVerticalRailEnabled="True"
|
2022-11-04 17:32:53 +01:00
|
|
|
ScrollViewer.VerticalScrollBarVisibility="Visible"
|
|
|
|
|
ScrollViewer.VerticalScrollMode="Enabled"
|
2022-11-07 12:26:09 +01:00
|
|
|
TextWrapping="Wrap" />
|
2022-10-13 13:05:43 +02:00
|
|
|
</ContentDialog>
|
2023-07-19 07:45:53 +02:00
|
|
|
|
2023-06-23 21:54:45 +02:00
|
|
|
<TeachingTip
|
|
|
|
|
x:Uid="TooManyHostsTeachingTip"
|
|
|
|
|
IsOpen="{x:Bind ViewModel.ShowSplittedEntriesTooltip, Mode=OneWay}"
|
|
|
|
|
PreferredPlacement="Top"
|
|
|
|
|
PlacementMargin="20">
|
|
|
|
|
<TeachingTip.IconSource>
|
|
|
|
|
<FontIconSource Glyph="" />
|
|
|
|
|
</TeachingTip.IconSource>
|
|
|
|
|
<TeachingTip.Content>
|
|
|
|
|
<TextBlock x:Uid="TooManyHostsTeachingTipContent"
|
2023-07-19 07:45:53 +02:00
|
|
|
TextWrapping="Wrap"/>
|
2023-06-23 21:54:45 +02:00
|
|
|
</TeachingTip.Content>
|
|
|
|
|
</TeachingTip>
|
2022-10-13 13:05:43 +02:00
|
|
|
</Grid>
|
|
|
|
|
</Page>
|