■ ■ ■ ■ ■ ■
Source/NETworkManager/Controls/WebConsoleControl.xaml
skipped 5 lines 6 6 xmlns:networkManagerControls="clr-namespace:NETworkManager.Controls;assembly=NETworkManager" 7 7 xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls" 8 8 xmlns:localization="clr-namespace:NETworkManager.Localization.Resources;assembly=NETworkManager.Localization" 9 + xmlns:validators="clr-namespace:NETworkManager.Validators;assembly=NETworkManager.Validators" 9 10 xmlns:converters="clr-namespace:NETworkManager.Converters;assembly=NETworkManager.Converters" 10 11 xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks" 11 12 xmlns:webview="clr-namespace:Microsoft.Web.WebView2.Wpf;assembly=Microsoft.Web.WebView2.Wpf" 12 13 mah:DialogParticipation.Register="{Binding}" 13 14 mc:Ignorable="d" Loaded="UserControl_Loaded" d:DataContext="{d:DesignInstance networkManagerControls:WebConsoleControl}"> 14 15 <UserControl.Resources> 16 + <converters:BooleanReverseConverter x:Key="BooleanReverseConverter" /> 15 17 <converters:BooleanReverseToVisibilityCollapsedConverter x:Key="BooleanReverseToVisibilityCollapsedConverter" /> 16 18 <converters:BooleanToVisibilityCollapsedConverter x:Key="BooleanToVisibilityCollapsedConverter" /> 19 + <converters:BooleanToVisibilityHiddenConverter x:Key="BooleanToVisibilityHiddenConverter" /> 17 20 </UserControl.Resources> 18 21 <Grid> 19 22 <Grid.RowDefinitions> skipped 1 lines 21 24 <RowDefinition Height="Auto" /> 22 25 <RowDefinition Height="*" /> 23 26 </Grid.RowDefinitions> 24 - <Grid Grid.Row="0" Margin="10"> 27 + <Grid Grid.Row="0" Margin="10, 10 , 10 , 5 "> 25 28 <Grid.ColumnDefinitions> 26 29 <ColumnDefinition Width="Auto" /> 27 30 <ColumnDefinition Width="10" /> skipped 6 lines 34 37 <ColumnDefinition Width="Auto" /> 35 38 </Grid.ColumnDefinitions> 36 39 <Button Command="{Binding GoBackCommand}" Grid.Column="0" Style="{StaticResource CleanButton}"> 37 - <Rectangle Width="24 " Height="24 " > 40 + <Rectangle Width="20 " Height="20 " > 38 41 <Rectangle.OpacityMask> 39 42 <VisualBrush Stretch="Uniform" Visual="{iconPacks:Material Kind=ArrowLeftCircleOutline}" /> 40 43 </Rectangle.OpacityMask> skipped 9 lines 50 53 </Rectangle.Style> 51 54 </Rectangle> 52 55 </Button> 53 - <Button Command="{Binding GoForwardCommand}" Grid.Column="2" Style="{StaticResource CleanButton}"> 54 - <Rectangle Width="24 " Height="24 " > 56 + <Button Command="{Binding GoForwardCommand}" Grid.Column="2" Style="{StaticResource CleanButton}"> 57 + <Rectangle Width="20 " Height="20 " > 55 58 <Rectangle.OpacityMask> 56 59 <VisualBrush Stretch="Uniform" Visual="{iconPacks:Material Kind=ArrowRightCircleOutline}" /> 57 60 </Rectangle.OpacityMask> skipped 10 lines 68 71 </Rectangle> 69 72 </Button> 70 73 <Button Command="{Binding ReloadCommand}" Grid.Column="4" Style="{StaticResource CleanButton}"> 71 - <Rectangle Width="24 " Height="24 " > 74 + <Rectangle Width="20 " Height="20 " > 72 75 <Rectangle.OpacityMask> 73 76 <VisualBrush Stretch="Uniform" Visual="{iconPacks:Material Kind=Refresh}" /> 74 77 </Rectangle.OpacityMask> skipped 9 lines 84 87 </Rectangle.Style> 85 88 </Rectangle> 86 89 </Button> 87 - <TextBox x:Name="txtBoxAddress " Text = " { Binding Url , UpdateSourceTrigger = PropertyChanged } " Grid.Column="6" Style="{StaticResource DefaultTextBox}" / > 88 - <Button Command="{Binding NavigateCommand}" IsDefault="True" Grid.Column="8" Style="{StaticResource CleanButton}"> 89 - <Rectangle Width="24" Height="24" > 90 + <TextBox x:Name="TextBoxUrl " Grid.Column="6" Style="{StaticResource DefaultTextBox}"> 91 + <TextBox.Text> 92 + <Binding Path="Url" Mode="TwoWay" UpdateSourceTrigger="PropertyChanged"> 93 + <Binding.ValidationRules> 94 + <validators:EmptyValidator ValidatesOnTargetUpdated="True" /> 95 + <validators:HttpAndHttpsUriValidator ValidatesOnTargetUpdated="True" /> 96 + </Binding.ValidationRules> 97 + </Binding> 98 + </TextBox.Text> 99 + </TextBox> 100 + <Button Command="{Binding NavigateCommand}" IsDefault="{Binding IsLoading, Converter={StaticResource BooleanReverseConverter}}" Visibility="{Binding IsLoading,Converter={StaticResource BooleanReverseToVisibilityCollapsedConverter}}" Grid.Column="8"> 101 + <Button.Style> 102 + <Style TargetType="{x:Type Button}" BasedOn="{StaticResource CleanButton}"> 103 + <Setter Property="IsEnabled" Value="False" /> 104 + <Style.Triggers> 105 + <DataTrigger Binding="{Binding Path=(Validation.HasError), ElementName=TextBoxUrl}" Value="False"> 106 + <Setter Property="IsEnabled" Value="True" /> 107 + </DataTrigger> 108 + </Style.Triggers> 109 + </Style> 110 + </Button.Style> 111 + <Rectangle Width="20" Height="20" > 90 112 <Rectangle.OpacityMask> 91 113 <VisualBrush Stretch="Uniform" Visual="{iconPacks:Material Kind=Play}" /> 92 114 </Rectangle.OpacityMask> 93 115 <Rectangle.Style> 94 116 <Style TargetType="{x:Type Rectangle}"> 95 117 <Setter Property="Fill" Value="{DynamicResource MahApps.Brushes.Gray3}" /> 118 + <Setter Property="IsEnabled" Value="True" /> 96 119 <Style.Triggers> 97 120 <DataTrigger Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Button}}, Path=IsMouseOver}" Value="True"> 98 121 <Setter Property="Fill" Value="{DynamicResource MahApps.Brushes.Gray5}" /> skipped 3 lines 102 125 </Rectangle.Style> 103 126 </Rectangle> 104 127 </Button> 128 + <Button Command="{Binding StopCommand}" IsCancel="{Binding IsLoading}" Style="{StaticResource CleanButton}" Visibility="{Binding IsLoading,Converter={StaticResource BooleanToVisibilityCollapsedConverter}}" Grid.Column="8"> 129 + <Rectangle Width="20" Height="20" > 130 + <Rectangle.OpacityMask> 131 + <VisualBrush Stretch="Uniform" Visual="{iconPacks:Material Kind=WindowClose}" /> 132 + </Rectangle.OpacityMask> 133 + <Rectangle.Style> 134 + <Style TargetType="{x:Type Rectangle}"> 135 + <Setter Property="Fill" Value="{DynamicResource MahApps.Brushes.Gray3}" /> 136 + <Setter Property="IsEnabled" Value="True" /> 137 + <Style.Triggers> 138 + <DataTrigger Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Button}}, Path=IsMouseOver}" Value="True"> 139 + <Setter Property="Fill" Value="Red" /> 140 + </DataTrigger> 141 + </Style.Triggers> 142 + </Style> 143 + </Rectangle.Style> 144 + </Rectangle> 145 + </Button> 105 146 </Grid> 106 - <mah:MetroProgressBar Grid.Row="1" IsIndeterminate="True" Visibility="{Binding IsLoading, Converter={StaticResource BooleanToVisibilityCollapsedConverter }}" Margin="0,0,0,10 "/> 147 + <mah:MetroProgressBar Grid.Row="1" IsIndeterminate="True" Visibility="{Binding IsLoading, Converter={StaticResource BooleanToVisibilityHiddenConverter }}" Margin="0,0,0,5 " /> 107 148 <webview:WebView2 Grid.Row="2" x:Name="Browser2"> 108 149 <webview:WebView2.Style> 109 150 <Style TargetType="{x:Type webview:WebView2}"> skipped 11 lines