1
0
mirror of https://github.com/proxysu/ProxySU.git synced 2024-12-01 01:26:06 +03:00
ProxySU/ProxySuper.WPF/Views/HomeView.xaml
2023-05-02 06:39:40 -07:00

141 lines
8.7 KiB
XML

<views:MvxWpfView x:Class="ProxySuper.WPF.Views.HomeView"
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:ProxySuper.WPF.Views"
xmlns:views="clr-namespace:MvvmCross.Platforms.Wpf.Views;assembly=MvvmCross.Platforms.Wpf"
mc:Ignorable="d">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Menu Background="White" Grid.Row="0" BorderThickness="0,0,0,2" BorderBrush="#eee">
<MenuItem Header="{DynamicResource MainMenuAddHost}" Padding="10,3">
<MenuItem Padding="0,5" Header="Xray" Command="{Binding AddXrayCommand}"></MenuItem>
<MenuItem Padding="0,5" Header="V2ray" Command="{Binding AddV2rayCommand}"></MenuItem>
<MenuItem Padding="0,5" Header="MTProto-Go" Command="{Binding AddMTProtoGoCommand}"></MenuItem>
<MenuItem Padding="0,5" Header="Trojan-Go" Command="{Binding AddTrojanGoCommand}"></MenuItem>
<MenuItem Padding="0,5" Header="NaiveProxy" Command="{Binding AddNaiveProxyCommand}"></MenuItem>
<MenuItem Padding="0,5" Header="Brook" Command="{Binding AddBrookCommand}"></MenuItem>
<MenuItem Padding="0,5" Header="Hysteria" Command="{Binding AddHysteriaCommand}"></MenuItem>
</MenuItem>
<MenuItem Header="{DynamicResource MainMenuActions}" Padding="10,3">
<MenuItem Padding="0,5" Header="{DynamicResource MainMenuActionsExportSettings}" Click="ShowShareLinks"></MenuItem>
<MenuItem Padding="0,5" Header="{DynamicResource MainMenuActionsGetRoot}" Click="GetRoot"></MenuItem>
</MenuItem>
<MenuItem Header="{DynamicResource MainMenuLanguage}" Padding="10,3">
<MenuItem Padding="0,5" Header="{DynamicResource MainMenuLanguageEn}" Click="SetEnglish"></MenuItem>
<MenuItem Padding="0,5" Header="{DynamicResource MainMenuLanguageTw}" Click="SetTwCN"></MenuItem>
<MenuItem Padding="0,5" Header="{DynamicResource MainMenuLanguageCn}" Click="SetSimpleChinese"></MenuItem>
<MenuItem Padding="0,5" Header="{DynamicResource MainMenuLanguageFr}" Click="SetIrFA"></MenuItem>
</MenuItem>
<MenuItem Header="{DynamicResource MainMenuHelper}" Padding="10,3">
<MenuItem Padding="0,5" Header="{DynamicResource MainMenuHelperGithub}" Click="LaunchGitHubSite"></MenuItem>
<MenuItem Padding="0,5" Header="{DynamicResource MainMenuHelperUseRoot}" Click="LaunchUseRootSite"></MenuItem>
<MenuItem Padding="0,5" Header="{DynamicResource MainMenuHelperCertQuestion}" Click="LaunchCertQuestion"></MenuItem>
<MenuItem Padding="0,5" Header="{DynamicResource MainMenuHelperPrivateKey}" Click="LaunchPrivateKeyQuestion"></MenuItem>
</MenuItem>
</Menu>
<StackPanel Grid.Row="1" Margin="0,10">
<DataGrid AutoGenerateColumns="False"
Name="DataGrid"
ItemsSource="{Binding Records}"
VerticalContentAlignment="Bottom"
VerticalScrollBarVisibility="Auto"
MaxHeight="450"
IsReadOnly="True"
SelectionUnit="Cell"
BorderBrush="#eee"
BorderThickness="1">
<DataGrid.Columns>
<DataGridTemplateColumn Width="40">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<CheckBox IsChecked="{Binding IsChecked,
Mode=TwoWay,
UpdateSourceTrigger=PropertyChanged
}" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTextColumn Binding="{Binding Host.Tag}"
Width="120">
<DataGridTextColumn.Header>
<TextBlock Text="{DynamicResource MainDataGridColumnTag}" />
</DataGridTextColumn.Header>
</DataGridTextColumn>
<DataGridTextColumn Binding="{Binding Host.Address}"
Width="200">
<DataGridTextColumn.Header>
<TextBlock Text="{DynamicResource MainDataGridColumnAddress}" />
</DataGridTextColumn.Header>
</DataGridTextColumn>
<DataGridTextColumn Binding="{Binding Type}"
Width="120">
<DataGridTextColumn.Header>
<TextBlock Text="{DynamicResource MainDataGridColumnType}" />
</DataGridTextColumn.Header>
</DataGridTextColumn>
<DataGridTemplateColumn Width="400">
<DataGridTemplateColumn.Header>
<TextBlock Text="{DynamicResource MainDataGridColumnAction}" />
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellTemplate>
<ItemContainerTemplate>
<StackPanel Orientation="Horizontal">
<Button Command="{Binding DataContext.InstallCommand,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid}}"
CommandParameter="{Binding Id}"
Margin="5,0"
Padding="5,2"
Content="{DynamicResource MainDataGridColumnActionInstall}" />
<Button Command="{Binding DataContext.EditCommand,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid}}"
CommandParameter="{Binding Id}"
Margin="5,0"
Padding="5,2"
Content="{DynamicResource MainDataGridColumnActionEdit}" />
<Button Command="{Binding DataContext.ViewConfigCommand,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid}}"
CommandParameter="{Binding Id}"
Margin="5,0"
Padding="5,2"
Content="{DynamicResource MainDataGridColumnActionViewConfig}" />
<Button Command="{Binding DataContext.RemoveCommand,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid}}"
CommandParameter="{Binding Id}"
Margin="5,0"
Padding="5,2"
Content="{DynamicResource MainDataGridColumnActionDelete}" />
<Button Command="{Binding DataContext.SortUpCommand,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid}}"
CommandParameter="{Binding Id}"
Margin="5,0"
Padding="5,2"
Content="{DynamicResource MainDataGridColumnActionSortUp}" />
<Button Command="{Binding DataContext.SortDoneCommand,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid}}"
CommandParameter="{Binding Id}"
Margin="5,0"
Padding="5,2"
Content="{DynamicResource MainDataGridColumnActionSortDone}" />
</StackPanel>
</ItemContainerTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
</StackPanel>
</Grid>
</views:MvxWpfView>