1
0
mirror of https://github.com/proxysu/ProxySU.git synced 2024-11-22 21:26:09 +03:00
ProxySU/ProxySuper.WPF/Views/HomeView.xaml
2021-05-23 14:24:13 +08:00

112 lines
6.3 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="Trojan-Go" Command="{Binding AddTrojanGoCommand}"></MenuItem>
<MenuItem Padding="0,5" Header="NaiveProxy"></MenuItem>
</MenuItem>
<!--<MenuItem Header="{DynamicResource MainMenuActions}" Padding="10,3">
<MenuItem Padding="0,5" Header="{DynamicResource MainMenuActionsExportSettings}"></MenuItem>
<MenuItem Padding="0,5" Header="{DynamicResource MainMenuActionsExportSubscribe}"></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 MainMenuLanguageCn}" Click="SetSimpleChinese"></MenuItem>
</MenuItem>
<MenuItem Header="{DynamicResource MainMenuHelper}" Padding="10,3">
<MenuItem Padding="0,5" Header="{DynamicResource MainMenuHelperGithub}" Click="LaunchGitHubSite"></MenuItem>
</MenuItem>
</Menu>
<StackPanel Grid.Row="1" Margin="0,10">
<DataGrid AutoGenerateColumns="False"
Name="DataGrid"
ItemsSource="{Binding Records}"
VerticalContentAlignment="Bottom"
IsReadOnly="True"
SelectionUnit="Cell"
BorderBrush="#eee"
BorderThickness="1">
<DataGrid.Columns>
<DataGridTemplateColumn Width="40">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<CheckBox ></CheckBox>
</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="200">
<DataGridTextColumn.Header>
<TextBlock Text="{DynamicResource MainDataGridColumnType}" />
</DataGridTextColumn.Header>
</DataGridTextColumn>
<DataGridTemplateColumn Header="{DynamicResource MainDataGridColumnAction}" Width="400">
<DataGridTemplateColumn.CellTemplate>
<ItemContainerTemplate>
<StackPanel Orientation="Horizontal">
<Button Command="{Binding DataContext.InstallCommand,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid}}"
CommandParameter="{Binding Id}"
Margin="5,0"
Padding="12,3"
Content="{DynamicResource MainDataGridColumnActionInstall}" />
<Button Command="{Binding DataContext.EditCommand,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid}}"
CommandParameter="{Binding Id}"
Margin="5,0"
Padding="12,3"
Content="{DynamicResource MainDataGridColumnActionEdit}" />
<Button Command="{Binding DataContext.ViewConfigCommand,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid}}"
CommandParameter="{Binding Id}"
Margin="5,0"
Padding="12,3"
Content="{DynamicResource MainDataGridColumnActionViewConfig}" />
<Button Command="{Binding DataContext.RemoveCommand,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid}}"
CommandParameter="{Binding Id}"
Margin="5,0"
Padding="12,3"
Content="{DynamicResource MainDataGridColumnActionDelete}" />
</StackPanel>
</ItemContainerTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
</StackPanel>
</Grid>
</views:MvxWpfView>