|
| 1 | +<Page x:Class="wv2util.AppOverridesPage" |
| 2 | + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
| 3 | + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| 4 | + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
| 5 | + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
| 6 | + xmlns:local="clr-namespace:wv2util" |
| 7 | + xmlns:scm="clr-namespace:System.ComponentModel;assembly=WindowsBase" |
| 8 | + mc:Ignorable="d" |
| 9 | + d:DesignHeight="450" d:DesignWidth="800" |
| 10 | + Title="AppOverridesPage"> |
| 11 | + <Page.Resources> |
| 12 | + <ObjectDataProvider x:Key="AppOverrideList" ObjectType="{x:Type local:AppState}" MethodName="GetAppOverrideList"/> |
| 13 | + <ObjectDataProvider x:Key="HostAppList" ObjectType="{x:Type local:AppState}" MethodName="GetHostAppList"/> |
| 14 | + <ObjectDataProvider x:Key="RuntimeList" ObjectType="{x:Type local:AppState}" MethodName="GetRuntimeList"/> |
| 15 | + |
| 16 | + <CollectionViewSource Source="{StaticResource AppOverrideList}" x:Key="AppOverrideSortedList"> |
| 17 | + <CollectionViewSource.SortDescriptions> |
| 18 | + <scm:SortDescription PropertyName="PrecedenceCategory" Direction="Ascending"/> |
| 19 | + </CollectionViewSource.SortDescriptions> |
| 20 | + </CollectionViewSource> |
| 21 | + |
| 22 | + <local:NullToBooleanConverter x:Key="NullToBooleanConverter"/> |
| 23 | + |
| 24 | + <DataTemplate x:Key="AppOverrideListTemplate"> |
| 25 | + <TextBlock Text="{Binding Path=DisplayLabel}" /> |
| 26 | + </DataTemplate> |
| 27 | + </Page.Resources> |
| 28 | + |
| 29 | + <Grid DataContext="{Binding Source={StaticResource AppOverrideSortedList}}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"> |
| 30 | + <ListBox |
| 31 | + x:Name="AppOverrideListBox" |
| 32 | + ItemsSource="{Binding}" |
| 33 | + ItemTemplate="{StaticResource AppOverrideListTemplate}" |
| 34 | + IsSynchronizedWithCurrentItem="True" |
| 35 | + SelectedIndex="0" |
| 36 | + HorizontalAlignment="Left" Width="322" Margin="10,10,0,30"> |
| 37 | + </ListBox> |
| 38 | + <Button x:Name="AddNew" Content="Add New" HorizontalAlignment="Left" VerticalAlignment="Bottom" Width="75" Margin="10,0,0,5" Click="AddNewButton_Click"/> |
| 39 | + <Button x:Name="RemoveButton" IsEnabled="{Binding Path=/CanRemove}" Content="Remove" HorizontalAlignment="Left" VerticalAlignment="Bottom" Width="75" Margin="257,0,0,5" RenderTransformOrigin="0.597,-3.701" Click="RemoveButton_Click"/> |
| 40 | + |
| 41 | + <Label Content="Host app exe" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="337,17,0,0" Width="126" /> |
| 42 | + <local:TextComboBox x:Name="AppOverrideHostAppComboBox" IsEditable="true" ItemsSource="{Binding Source={StaticResource HostAppList}}" DisplayMemberPath="ExecutableName" TextSearch.TextPath="ExecutableName" ToolTip="E.g. 'example.exe'\nThe filename (not full path) of the executable of the desired host application." Text="{Binding Path=/HostApp, UpdateSourceTrigger=PropertyChanged}" IsEnabled="{Binding Path=/CanChangeHostApp,UpdateSourceTrigger=PropertyChanged}" VerticalAlignment="Top" Margin="468,17,68,0" ScrollViewer.CanContentScroll="True" VerticalContentAlignment="Center" Height="26"/> |
| 43 | + |
| 44 | + <GroupBox Height="180" VerticalAlignment="Top" Margin="339,48,10,0"> |
| 45 | + <GroupBox.Header> |
| 46 | + <Label>Runtime</Label> |
| 47 | + </GroupBox.Header> |
| 48 | + <Grid> |
| 49 | + <RadioButton Name="RuntimeScenarioEvergreen" IsChecked="{Binding Path=/IsRuntimeEvergreen, UpdateSourceTrigger=PropertyChanged}" Content="Evergreen (Stable)" ToolTip="Use the installed WebView2 Runtime or if not available the first of Beta, Dev, or Canary Edge browser install." GroupName="RuntimeScenario" Margin="10,0" VerticalAlignment="Top" Height="26" VerticalContentAlignment="Center"/> |
| 50 | + <RadioButton Name="RuntimeScenarioEvergreenPreview" IsChecked="{Binding Path=/IsRuntimeEvergreenPreview, UpdateSourceTrigger=PropertyChanged}" Content="Evergreen with preview build" ToolTip="Use the first of Canary, Dev, or Beta Edge browser install or if none of those then the WebView2 Runtime." GroupName="RuntimeScenario" Margin="10,26,-10,0" VerticalAlignment="Top" Height="26" VerticalContentAlignment="Center"/> |
| 51 | + <CheckBox IsEnabled="{Binding Path=/IsRuntimeEvergreenPreview}" Name="RuntimeScenarioReverseSearchOrder" IsChecked="{Binding Path=/ReverseSearchOrder, UpdateSourceTrigger=PropertyChanged}" Content="Reverse search order" ToolTip="Reverse the channels search order to prefer least stable build." Margin="55,52,-10,0" VerticalAlignment="Top" Height="26" VerticalContentAlignment="Center"/> |
| 52 | + <CheckBox IsEnabled="{Binding Path=/IsRuntimeEvergreenPreview}" Name="RuntimeScenarioEvergreenPreviewCanary" IsChecked="{Binding Path=/IsRuntimeCanary, UpdateSourceTrigger=PropertyChanged}" Content="Canary" ToolTip="Use Canary Edge browser install or the WebView2 Runtime if Dev is not available." Margin="55,78,-10,0" VerticalAlignment="Top" Height="26" VerticalContentAlignment="Center"/> |
| 53 | + <CheckBox IsEnabled="{Binding Path=/IsRuntimeEvergreenPreview}" Name="RuntimeScenarioEvergreenPreviewDev" IsChecked="{Binding Path=/IsRuntimeDev, UpdateSourceTrigger=PropertyChanged}" Content="Dev" ToolTip="Use Dev Edge browser install or the WebView2 Runtime if Dev is not available." Margin="140,78,-10,0" VerticalAlignment="Top" Height="26" VerticalContentAlignment="Center"/> |
| 54 | + <CheckBox IsEnabled="{Binding Path=/IsRuntimeEvergreenPreview}" Name="RuntimeScenarioEvergreenPreviewBeta" IsChecked="{Binding Path=/IsRuntimeBeta, UpdateSourceTrigger=PropertyChanged}" Content="Beta" ToolTip="Use Beta Edge browser install or the WebView2 Runtime if Dev is not available." Margin="210,78,-10,0" VerticalAlignment="Top" Height="26" VerticalContentAlignment="Center"/> |
| 55 | + <CheckBox IsEnabled="{Binding Path=/IsRuntimeEvergreenPreview}" Name="RuntimeScenarioEvergreenPreviewStable" IsChecked="{Binding Path=/IsRuntimeStable, UpdateSourceTrigger=PropertyChanged}" Content="Stable" ToolTip="Use the stable WebView2 Runtime." Margin="280,78,-10,0" VerticalAlignment="Top" Height="26" VerticalContentAlignment="Center"/> |
| 56 | + <RadioButton Name="RuntimeScenarioFixedVersion" IsChecked="{Binding Path=/IsRuntimeFixedVersion, UpdateSourceTrigger=PropertyChanged}" Content="Fixed Version" ToolTip="Use the WebView2 Runtime at the specified path" GroupName="RuntimeScenario" Margin="10,106,-10,0" VerticalAlignment="Top" Height="26" VerticalContentAlignment="Center"/> |
| 57 | + </Grid> |
| 58 | + </GroupBox> |
| 59 | + <local:TextComboBox x:Name="AppOverrideRuntimePathComboBox" IsEditable="true" ItemsSource="{Binding Source={StaticResource RuntimeList}}" DisplayMemberPath="RuntimeLocation" TextSearch.TextPath="RuntimeLocation" ToolTip="The full path of the WebView2 Runtime or non-stable browser. The path should contain msedgewebview2.exe." IsEnabled="{Binding Path=/IsRuntimeFixedVersion, UpdateSourceTrigger=PropertyChanged}" Text="{Binding Path=/RuntimePath, UpdateSourceTrigger=PropertyChanged}" Height="26" VerticalAlignment="Top" Margin="468,185,68,0" VerticalContentAlignment="Center"/> |
| 60 | + <Button IsEnabled="{Binding Path=/IsRuntimeFixedVersion}" x:Name="AppOverrideRuntimePathButton" Content="..." HorizontalAlignment="Right" VerticalAlignment="Top" Width="37" Margin="0,188,21,0" Click="AppOverrideRuntimePathButton_Click"/> |
| 61 | + |
| 62 | + <GroupBox Height="120" VerticalAlignment="Top" Margin="339,227,10,0"> |
| 63 | + <GroupBox.Header> |
| 64 | + <Label Content="Browser arguments"/> |
| 65 | + </GroupBox.Header> |
| 66 | + </GroupBox> |
| 67 | + <Label Content="Arguments" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="354,251,0,0" Width="109" /> |
| 68 | + <TextBox ToolTip="Additional arguments to include on the command line for msedgewebview2.exe." x:Name="AppOverrideBrowserArgumentsTextBox" Text="{Binding Path=/BrowserArguments, UpdateSourceTrigger=PropertyChanged}" Height="26" TextWrapping="Wrap" VerticalAlignment="Top" Margin="468,251,68,0" ScrollViewer.CanContentScroll="True" MaxLines="1" VerticalContentAlignment="Center"/> |
| 69 | + <Button x:Name="AppOverrideBrowserArgumentsButton" Content="?" HorizontalAlignment="Right" VerticalAlignment="Top" Width="36" Margin="0,254,21,0" Click="AppOverrideBrowserArgumentsButton_Click"/> |
| 70 | + <CheckBox x:Name="AppOverrideArgumentsAutoOpenDevTools" Content="Auto open DevTools" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="354,293,0,0" IsChecked="{Binding /IsCommonBrowserArgumentEnabledAutoOpenDevTools}"/> |
| 71 | + <CheckBox x:Name="AppOverrideArgumentsLogging" Content="Logging" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="354,320,0,0" IsChecked="{Binding /IsCommonBrowserArgumentEnabledLogging}"/> |
| 72 | + |
| 73 | + <Label Content="User data path" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="337,358,0,0" Width="126"/> |
| 74 | + <TextBox ToolTip="The full path of the user data folder. The selected folder should contain an EBWebView subfolder." x:Name="AppOverrideUserDataPathTextBox" Text="{Binding Path=/UserDataPath, UpdateSourceTrigger=PropertyChanged}" Height="26" TextWrapping="Wrap" VerticalAlignment="Top" Margin="468,358,68,0" ScrollViewer.CanContentScroll="True" MaxLines="1" VerticalContentAlignment="Center"/> |
| 75 | + <Button x:Name="AppOverrideUserDataPathButton" Content="..." HorizontalAlignment="Right" VerticalAlignment="Top" Width="36" Margin="0,361,21,0" Click="AppOverrideUserDataPathButton_Click"/> |
| 76 | + |
| 77 | + <Label Content="{Binding Path=/StorageKindDescription,UpdateSourceTrigger=PropertyChanged}" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="337,389,0,0" Width="747"/> |
| 78 | + |
| 79 | + <Button x:Name="EnvVarButton" Content="Edit Env Var" HorizontalAlignment="Right" VerticalAlignment="Bottom" Width="100" Margin="0,0,120,5" Click="EnvVarButton_Click"/> |
| 80 | + <Button x:Name="RegEditButton" Content="Launch RegEdit" HorizontalAlignment="Right" VerticalAlignment="Bottom" Width="100" Margin="0,0,10,5" Click="RegEditButton_Click"/> |
| 81 | + |
| 82 | + </Grid> |
| 83 | +</Page> |
0 commit comments