You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
downkyi/DownKyi/Views/Settings/ViewNetwork.xaml

444 lines
22 KiB

<UserControl
x:Class="DownKyi.Views.Settings.ViewNetwork"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
xmlns:prism="http://prismlibrary.com/"
prism:ViewModelLocator.AutoWireViewModel="True">
<ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto">
<StackPanel Margin="50,0" Orientation="Vertical">
<StackPanel Margin="0,20,0,0" Orientation="Horizontal">
<TextBlock
FontSize="18"
Foreground="{DynamicResource BrushTextDark}"
Text="{DynamicResource Network}" />
</StackPanel>
<StackPanel Margin="0,20,0,0" Orientation="Vertical">
<TextBlock
FontSize="12"
Foreground="{DynamicResource BrushTextDark}"
Text="{DynamicResource SelectDownloader}" />
<GroupBox
Margin="0,10,0,0"
BorderBrush="{x:Null}"
BorderThickness="0">
<StackPanel Orientation="Horizontal">
<RadioButton
Command="{Binding SelectDownloaderCommand}"
CommandParameter="Builtin"
Content="{DynamicResource BuiltinDownloader}"
FontSize="12"
Foreground="{DynamicResource BrushTextDark}"
IsChecked="{Binding Builtin}"
Style="{StaticResource RadioStyle}" />
<RadioButton
Margin="20,0,0,0"
Command="{Binding SelectDownloaderCommand}"
CommandParameter="Aria2c"
Content="{DynamicResource Aria2cDownloader}"
FontSize="12"
Foreground="{DynamicResource BrushTextDark}"
IsChecked="{Binding Aria2c}"
Style="{StaticResource RadioStyle}" />
</StackPanel>
</GroupBox>
</StackPanel>
<TextBlock
Height="1"
Margin="0,20,0,0"
Background="{DynamicResource BrushBorder}" />
<StackPanel x:Name="nameBuiltin">
<StackPanel.Style>
<Style TargetType="{x:Type StackPanel}">
<Style.Triggers>
<DataTrigger Binding="{Binding Builtin}" Value="True">
<Setter Property="Visibility" Value="Visible" />
</DataTrigger>
<DataTrigger Binding="{Binding Builtin}" Value="False">
<Setter Property="Visibility" Value="Collapsed" />
</DataTrigger>
</Style.Triggers>
</Style>
</StackPanel.Style>
<StackPanel Margin="0,20,0,0" Orientation="Horizontal">
<TextBlock
Width="100"
VerticalAlignment="Center"
FontSize="12"
Foreground="{DynamicResource BrushTextDark}"
Text="{DynamicResource MaxCurrentDownloads}" />
<ComboBox
Name="nameMaxCurrentDownloads"
Width="100"
VerticalContentAlignment="Center"
ItemsSource="{Binding MaxCurrentDownloads}"
SelectedValue="{Binding SelectedMaxCurrentDownload}">
<i:Interaction.Triggers>
<i:EventTrigger EventName="SelectionChanged">
<i:InvokeCommandAction Command="{Binding MaxCurrentDownloadsCommand}" CommandParameter="{Binding ElementName=nameMaxCurrentDownloads, Path=SelectedValue}" />
</i:EventTrigger>
</i:Interaction.Triggers>
</ComboBox>
</StackPanel>
<StackPanel Margin="0,20,0,0" Orientation="Horizontal">
<TextBlock
Width="100"
VerticalAlignment="Center"
FontSize="12"
Foreground="{DynamicResource BrushTextDark}"
Text="{DynamicResource Split}" />
<ComboBox
Name="nameSplits"
Width="100"
VerticalContentAlignment="Center"
ItemsSource="{Binding Splits}"
SelectedValue="{Binding SelectedSplit}">
<i:Interaction.Triggers>
<i:EventTrigger EventName="SelectionChanged">
<i:InvokeCommandAction Command="{Binding SplitsCommand}" CommandParameter="{Binding ElementName=nameSplits, Path=SelectedValue}" />
</i:EventTrigger>
</i:Interaction.Triggers>
</ComboBox>
</StackPanel>
<CheckBox
Name="nameIsHttpProxy"
Margin="0,20,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Command="{Binding IsHttpProxyCommand}"
Content="{DynamicResource IsHttpProxy}"
FontSize="12"
Foreground="{DynamicResource BrushTextDark}"
IsChecked="{Binding IsHttpProxy, Mode=TwoWay}"
Style="{StaticResource CheckBoxStyle}" />
<StackPanel
Name="nameHttpProxyPanel"
Margin="0,20,0,0"
Orientation="Horizontal"
ToolTip="{DynamicResource PressEnterToApplySettingTip}">
<StackPanel.Style>
<Style TargetType="{x:Type StackPanel}">
<Style.Triggers>
<DataTrigger Binding="{Binding ElementName=nameIsHttpProxy, Path=IsChecked}" Value="false">
<Setter Property="Visibility" Value="Collapsed" />
</DataTrigger>
<DataTrigger Binding="{Binding ElementName=nameIsHttpProxy, Path=IsChecked}" Value="true">
<Setter Property="Visibility" Value="Visible" />
</DataTrigger>
</Style.Triggers>
</Style>
</StackPanel.Style>
<StackPanel Orientation="Horizontal">
<TextBlock
VerticalAlignment="Center"
FontSize="12"
Foreground="{DynamicResource BrushTextDark}"
Text="{DynamicResource HttpProxy}" />
<TextBox
Name="nameHttpProxy"
Width="200"
Height="20"
VerticalContentAlignment="Center"
Text="{Binding HttpProxy}">
<TextBox.InputBindings>
<KeyBinding
Key="Enter"
Command="{Binding HttpProxyCommand}"
CommandParameter="{Binding ElementName=nameHttpProxy, Path=Text}" />
</TextBox.InputBindings>
</TextBox>
</StackPanel>
<StackPanel Margin="30,0,0,0" Orientation="Horizontal">
<TextBlock
VerticalAlignment="Center"
FontSize="12"
Foreground="{DynamicResource BrushTextDark}"
Text="{DynamicResource HttpProxyPort}" />
<TextBox
Name="nameHttpProxyPort"
Width="100"
Height="20"
VerticalContentAlignment="Center"
Text="{Binding HttpProxyPort}">
<TextBox.InputBindings>
<KeyBinding
Key="Enter"
Command="{Binding HttpProxyPortCommand}"
CommandParameter="{Binding ElementName=nameHttpProxyPort, Path=Text}" />
</TextBox.InputBindings>
</TextBox>
</StackPanel>
</StackPanel>
</StackPanel>
<StackPanel x:Name="nameAria">
<StackPanel.Style>
<Style TargetType="{x:Type StackPanel}">
<Style.Triggers>
<DataTrigger Binding="{Binding Aria2c}" Value="True">
<Setter Property="Visibility" Value="Visible" />
</DataTrigger>
<DataTrigger Binding="{Binding Aria2c}" Value="False">
<Setter Property="Visibility" Value="Collapsed" />
</DataTrigger>
</Style.Triggers>
</Style>
</StackPanel.Style>
<StackPanel
Margin="0,20,0,0"
Orientation="Horizontal"
ToolTip="{DynamicResource PressEnterToApplySettingTip}">
<TextBlock
Width="100"
VerticalAlignment="Center"
FontSize="12"
Foreground="{DynamicResource BrushTextDark}"
Text="{DynamicResource AriaServerPort}" />
<TextBox
Name="nameAriaListenPort"
Width="100"
Height="20"
VerticalContentAlignment="Center"
Text="{Binding AriaListenPort}">
<TextBox.InputBindings>
<KeyBinding
Key="Enter"
Command="{Binding AriaListenPortCommand}"
CommandParameter="{Binding ElementName=nameAriaListenPort, Path=Text}" />
</TextBox.InputBindings>
</TextBox>
</StackPanel>
<StackPanel Margin="0,20,0,0" Orientation="Horizontal">
<TextBlock
Width="100"
VerticalAlignment="Center"
FontSize="12"
Foreground="{DynamicResource BrushTextDark}"
Text="{DynamicResource AriaLogLevel}" />
<ComboBox
Name="nameAriaLogLevels"
Width="100"
VerticalContentAlignment="Center"
ItemsSource="{Binding AriaLogLevels}"
SelectedValue="{Binding SelectedAriaLogLevel}">
<i:Interaction.Triggers>
<i:EventTrigger EventName="SelectionChanged">
<i:InvokeCommandAction Command="{Binding AriaLogLevelsCommand}" CommandParameter="{Binding ElementName=nameAriaLogLevels, Path=SelectedValue}" />
</i:EventTrigger>
</i:Interaction.Triggers>
</ComboBox>
</StackPanel>
<StackPanel Margin="0,20,0,0" Orientation="Horizontal">
<TextBlock
Width="100"
VerticalAlignment="Center"
FontSize="12"
Foreground="{DynamicResource BrushTextDark}"
Text="{DynamicResource AriaMaxConcurrentDownloads}" />
<ComboBox
Name="nameAriaMaxConcurrentDownloads"
Width="100"
VerticalContentAlignment="Center"
ItemsSource="{Binding AriaMaxConcurrentDownloads}"
SelectedValue="{Binding SelectedAriaMaxConcurrentDownload}">
<i:Interaction.Triggers>
<i:EventTrigger EventName="SelectionChanged">
<i:InvokeCommandAction Command="{Binding AriaMaxConcurrentDownloadsCommand}" CommandParameter="{Binding ElementName=nameAriaMaxConcurrentDownloads, Path=SelectedValue}" />
</i:EventTrigger>
</i:Interaction.Triggers>
</ComboBox>
</StackPanel>
<StackPanel Margin="0,20,0,0" Orientation="Horizontal">
<TextBlock
Width="100"
VerticalAlignment="Center"
FontSize="12"
Foreground="{DynamicResource BrushTextDark}"
Text="{DynamicResource AriaSplit}" />
<ComboBox
Name="nameAriaSplits"
Width="100"
VerticalContentAlignment="Center"
ItemsSource="{Binding AriaSplits}"
SelectedValue="{Binding SelectedAriaSplit}">
<i:Interaction.Triggers>
<i:EventTrigger EventName="SelectionChanged">
<i:InvokeCommandAction Command="{Binding AriaSplitsCommand}" CommandParameter="{Binding ElementName=nameAriaSplits, Path=SelectedValue}" />
</i:EventTrigger>
</i:Interaction.Triggers>
</ComboBox>
</StackPanel>
<GroupBox
Margin="0,20,0,0"
Padding="10,5"
HorizontalAlignment="Left">
<GroupBox.Header>
<TextBlock
FontSize="12"
Foreground="{DynamicResource BrushTextDark}"
Text="{DynamicResource AriaDownloadLimit}" />
</GroupBox.Header>
<StackPanel>
<StackPanel Margin="0,10,0,0" Orientation="Horizontal">
<TextBlock
Width="300"
VerticalAlignment="Center"
FontSize="12"
Foreground="{DynamicResource BrushTextDark}"
Text="{DynamicResource AriaMaxOverallDownloadLimit}" />
<TextBox
Name="nameAriaMaxOverallDownloadLimit"
Width="100"
Height="20"
VerticalContentAlignment="Center"
Text="{Binding AriaMaxOverallDownloadLimit}"
ToolTip="{DynamicResource PressEnterToApplySettingTip}">
<TextBox.InputBindings>
<KeyBinding
Key="Enter"
Command="{Binding AriaMaxOverallDownloadLimitCommand}"
CommandParameter="{Binding ElementName=nameAriaMaxOverallDownloadLimit, Path=Text}" />
</TextBox.InputBindings>
</TextBox>
</StackPanel>
<StackPanel Margin="0,10,0,5" Orientation="Horizontal">
<TextBlock
Width="300"
VerticalAlignment="Center"
FontSize="12"
Foreground="{DynamicResource BrushTextDark}"
Text="{DynamicResource AriaMaxDownloadLimit}" />
<TextBox
Name="nameAriaMaxDownloadLimit"
Width="100"
Height="20"
VerticalContentAlignment="Center"
Text="{Binding AriaMaxDownloadLimit}"
ToolTip="{DynamicResource PressEnterToApplySettingTip}">
<TextBox.InputBindings>
<KeyBinding
Key="Enter"
Command="{Binding AriaMaxDownloadLimitCommand}"
CommandParameter="{Binding ElementName=nameAriaMaxDownloadLimit, Path=Text}" />
</TextBox.InputBindings>
</TextBox>
</StackPanel>
</StackPanel>
</GroupBox>
<CheckBox
Name="nameIsAriaHttpProxy"
Margin="0,20,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Command="{Binding IsAriaHttpProxyCommand}"
Content="{DynamicResource IsHttpProxy}"
FontSize="12"
Foreground="{DynamicResource BrushTextDark}"
IsChecked="{Binding IsAriaHttpProxy, Mode=TwoWay}"
Style="{StaticResource CheckBoxStyle}" />
<StackPanel
Name="nameAriaHttpProxyPanel"
Margin="0,20,0,0"
Orientation="Horizontal"
ToolTip="{DynamicResource PressEnterToApplySettingTip}">
<StackPanel.Style>
<Style TargetType="{x:Type StackPanel}">
<Style.Triggers>
<DataTrigger Binding="{Binding ElementName=nameIsAriaHttpProxy, Path=IsChecked}" Value="false">
<Setter Property="Visibility" Value="Collapsed" />
</DataTrigger>
<DataTrigger Binding="{Binding ElementName=nameIsAriaHttpProxy, Path=IsChecked}" Value="true">
<Setter Property="Visibility" Value="Visible" />
</DataTrigger>
</Style.Triggers>
</Style>
</StackPanel.Style>
<StackPanel Orientation="Horizontal">
<TextBlock
VerticalAlignment="Center"
FontSize="12"
Foreground="{DynamicResource BrushTextDark}"
Text="{DynamicResource HttpProxy}" />
<TextBox
Name="nameAriaHttpProxy"
Width="200"
Height="20"
VerticalContentAlignment="Center"
Text="{Binding AriaHttpProxy}">
<TextBox.InputBindings>
<KeyBinding
Key="Enter"
Command="{Binding AriaHttpProxyCommand}"
CommandParameter="{Binding ElementName=nameAriaHttpProxy, Path=Text}" />
</TextBox.InputBindings>
</TextBox>
</StackPanel>
<StackPanel Margin="30,0,0,0" Orientation="Horizontal">
<TextBlock
VerticalAlignment="Center"
FontSize="12"
Foreground="{DynamicResource BrushTextDark}"
Text="{DynamicResource HttpProxyPort}" />
<TextBox
Name="nameAriaHttpProxyPort"
Width="100"
Height="20"
VerticalContentAlignment="Center"
Text="{Binding AriaHttpProxyPort}">
<TextBox.InputBindings>
<KeyBinding
Key="Enter"
Command="{Binding AriaHttpProxyPortCommand}"
CommandParameter="{Binding ElementName=nameAriaHttpProxyPort, Path=Text}" />
</TextBox.InputBindings>
</TextBox>
</StackPanel>
</StackPanel>
<StackPanel Margin="0,20,0,0" Orientation="Horizontal">
<TextBlock
Width="100"
VerticalAlignment="Center"
FontSize="12"
Foreground="{DynamicResource BrushTextDark}"
Text="{DynamicResource AriaFileAllocation}" />
<ComboBox
Name="nameAriaFileAllocations"
Width="100"
VerticalContentAlignment="Center"
ItemsSource="{Binding AriaFileAllocations}"
SelectedValue="{Binding SelectedAriaFileAllocation}">
<i:Interaction.Triggers>
<i:EventTrigger EventName="SelectionChanged">
<i:InvokeCommandAction Command="{Binding AriaFileAllocationsCommand}" CommandParameter="{Binding ElementName=nameAriaFileAllocations, Path=SelectedValue}" />
</i:EventTrigger>
</i:Interaction.Triggers>
</ComboBox>
</StackPanel>
</StackPanel>
<StackPanel Margin="10" />
</StackPanel>
</ScrollViewer>
</UserControl>