mirror of
https://github.com/achiez/NebulaAuth-Steam-Desktop-Authenticator-by-Achies.git
synced 2026-07-25 14:24:32 +00:00
113 lines
6.0 KiB
XML
113 lines
6.0 KiB
XML
<UserControl x:Class="NebulaAuth.View.ProxyManagerView"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:local="clr-namespace:NebulaAuth.View"
|
|
xmlns:md="http://materialdesigninxaml.net/winfx/xaml/themes"
|
|
xmlns:other="clr-namespace:NebulaAuth.ViewModel.Other"
|
|
mc:Ignorable="d"
|
|
d:DesignHeight="450" d:DesignWidth="800"
|
|
Foreground="WhiteSmoke"
|
|
FontFamily="{md:MaterialDesignFont}"
|
|
MinHeight="500"
|
|
MinWidth="400"
|
|
MaxHeight="550"
|
|
d:DataContext="{d:DesignInstance other:ProxyManagerVM}"
|
|
Background="{DynamicResource WindowBackground}">
|
|
<d:DesignerProperties.DesignStyle>
|
|
<Style TargetType="UserControl">
|
|
<Setter Property="Background" Value="{DynamicResource WindowBackground}" />
|
|
</Style>
|
|
</d:DesignerProperties.DesignStyle>
|
|
|
|
<Grid Margin="15,10,15,15">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition Height="*"/>
|
|
<RowDefinition Height="Auto"/>
|
|
</Grid.RowDefinitions>
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition/>
|
|
<ColumnDefinition/>
|
|
</Grid.ColumnDefinitions>
|
|
<TextBlock FontStyle="Normal" Foreground="DarkGray" HorizontalAlignment="Left" VerticalAlignment="Center" FontSize="18" Text="{Tr ProxyManagerDialog.Title}"/>
|
|
<Button IsCancel="True" Grid.Column="1" Width="30" Height="30" Style="{StaticResource MaterialDesignIconForegroundButton}" HorizontalAlignment="Right" Command="{x:Static md:DialogHost.CloseDialogCommand}">
|
|
<md:PackIcon Kind="Close" Width="24" Height="24" Foreground="IndianRed"></md:PackIcon>
|
|
</Button>
|
|
|
|
</Grid>
|
|
<Separator Grid.Row="1"></Separator>
|
|
<Grid Grid.Row="2">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*"/>
|
|
<ColumnDefinition Width="Auto"/>
|
|
<ColumnDefinition Width="Auto"/>
|
|
</Grid.ColumnDefinitions>
|
|
<TextBlock HorizontalAlignment="Stretch"
|
|
Margin="15" FontSize="16">
|
|
<Run Text="{Tr ProxyManagerDialog.DefaultProxy, IsDynamic=False}"/>
|
|
<Run Text="{Binding DefaultProxy.Key, StringFormat='
0:', FallbackValue='X', Mode=OneWay}"/>
|
|
<Run Text="{Binding DefaultProxy.Value.Address, Mode=OneWay, FallbackValue=''}"/>
|
|
</TextBlock>
|
|
<Button Grid.Column="1" Command="{Binding SetDefaultCommand}">
|
|
<md:PackIcon Kind="HeartBoxOutline" Width="20" Height="20"></md:PackIcon>
|
|
</Button>
|
|
<Button Grid.Column="2" Command="{Binding RemoveDefaultCommand}" Cursor="Hand">
|
|
<md:PackIcon Kind="ClearBox" Width="20" Height="20"></md:PackIcon>
|
|
</Button>
|
|
</Grid>
|
|
<md:Card Grid.Row="3" Margin="10">
|
|
<ListBox SelectedValue="{Binding SelectedProxy}" ItemsSource="{Binding Proxies}">
|
|
<ListBox.ItemContainerStyle>
|
|
<Style TargetType="ListBoxItem" BasedOn="{StaticResource MaterialDesignListBoxItem}">
|
|
<Setter Property="Tag" Value="{Binding RelativeSource={RelativeSource AncestorType=UserControl}, Path=DataContext}"/>
|
|
<Setter Property="ContextMenu">
|
|
<Setter.Value>
|
|
<ContextMenu>
|
|
<MenuItem Header="{Tr MainWindow.ContextMenus.Proxy.Copy}"
|
|
Command="{Binding PlacementTarget.Tag.CopyProxyCommand, RelativeSource={RelativeSource AncestorType=ContextMenu}}"
|
|
CommandParameter="{Binding Value}"/>
|
|
<MenuItem Header="{Tr MainWindow.ContextMenus.Proxy.CopyAddress}"
|
|
Command="{Binding PlacementTarget.Tag.CopyProxyAddressCommand, RelativeSource={RelativeSource AncestorType=ContextMenu}}"
|
|
CommandParameter="{Binding Value}"/>
|
|
</ContextMenu>
|
|
</Setter.Value>
|
|
</Setter>
|
|
|
|
</Style>
|
|
</ListBox.ItemContainerStyle>
|
|
|
|
<ListBox.ItemTemplate>
|
|
<DataTemplate>
|
|
<TextBlock>
|
|
<Run Text="{Binding Key, Mode=OneWay}"/><Run Text=": "/>
|
|
<Run Text="{Binding Value.Address, Mode=OneWay}"/>
|
|
|
|
</TextBlock>
|
|
</DataTemplate>
|
|
</ListBox.ItemTemplate>
|
|
</ListBox>
|
|
</md:Card>
|
|
<Grid Grid.Row="4">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*"/>
|
|
<ColumnDefinition Width="Auto"/>
|
|
<ColumnDefinition Width="Auto"/>
|
|
</Grid.ColumnDefinitions>
|
|
<TextBox Text="{Binding AddProxyField}" FontSize="12" md:TextFieldAssist.HasClearButton="True" AcceptsReturn="True" MaxHeight="100" Style="{StaticResource MaterialDesignOutlinedTextBox}" Margin="15" md:HintAssist.Hint="IP:PORT:USER:PASS{ID}"></TextBox>
|
|
<Button IsDefault="True" Grid.Column="1" Command="{Binding AddProxyCommand}">
|
|
<md:PackIcon Kind="Add"></md:PackIcon>
|
|
</Button>
|
|
<Button Grid.Column="2" Command="{Binding RemoveProxyCommand}">
|
|
<md:PackIcon Kind="Trash"></md:PackIcon>
|
|
</Button>
|
|
</Grid>
|
|
|
|
|
|
</Grid>
|
|
</UserControl>
|