You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

96 lines
5.6 KiB
XML

<UserControl x:Class="StartServerWPF.Modules.Main.Views.MainView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:StartServerWPF.Modules.Main.Views"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
mc:Ignorable="d"
d:DesignHeight="600" d:DesignWidth="800"
xmlns:prism="http://prismlibrary.com/"
prism:ViewModelLocator.AutoWireViewModel="True" >
<i:Interaction.Triggers>
<i:EventTrigger EventName="Loaded">
<i:InvokeCommandAction Command="{Binding Path=LoadedCommand}"/>
</i:EventTrigger>
<i:EventTrigger EventName="Unloaded">
<i:InvokeCommandAction Command="{Binding Path=UnloadedCommand}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="300"/>
<ColumnDefinition Width="23*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="52*"/>
<RowDefinition Height="75*"/>
<RowDefinition Height="112*"/>
<RowDefinition Height="30"/>
</Grid.RowDefinitions>
<GroupBox Header="网络控制">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="2*"/>
</Grid.ColumnDefinitions>
<RadioButton GroupName="con" IsChecked="{Binding VPNIsConnect}" x:Name="rtnConnect" Content="连接" Command="{Binding ConnectVPNCommand}" CommandParameter="{Binding RelativeSource={ RelativeSource Mode=Self},Path=IsChecked}" Grid.Row="0" VerticalAlignment="Center"/>
<RadioButton GroupName="con" Content="断开连接" Grid.Column="1" Command="{Binding DisConnectVPNCommand}" VerticalAlignment="Center" IsChecked="True"/>
<StackPanel Grid.Column="2" Orientation="Horizontal" VerticalAlignment="Center" >
<Button Content="检查状态" Command="{Binding GetVPNStatusCommand}" Margin="5,0,5,0"/>
<TextBlock Text="{Binding VPNStatus}" Foreground="{Binding VPNStatusForeColor}"/>
</StackPanel>
<Button Content="参数设置" Grid.Row="1" Command="{Binding SetVPNParaCommand}" VerticalAlignment="Center"/>
<Button Content="运行日志" Grid.Row="1" Grid.Column="1" Command="{Binding DisplayLogCommand}" VerticalAlignment="Center"/>
<TextBlock Grid.Row="1" Grid.Column="2" VerticalAlignment="Center" Margin="5,0,5,0">
<Run Text="本机IP:"/>
<Run Text="{Binding VpnIP}"/>
</TextBlock>
</Grid>
</GroupBox>
<GroupBox IsEnabled="{Binding ElementName=rtnConnect,Path=IsChecked}" Grid.Row="1" Header="服务器控制">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="2*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<Button x:Name="btnStart" Content="一键启动" Command="{Binding OneKeyStartCommand}" IsEnabled="{Binding IsEnabledStart}" Grid.Column="0" VerticalAlignment="Center"/>
<Button Content="全部关闭" Command="{Binding OneKeyStopCommand}" Grid.Column="1" VerticalAlignment="Center"/>
<Button Content="实时波形" Command="{Binding DisplayRealWavesCommand}" Grid.Column="2" VerticalAlignment="Center" HorizontalAlignment="Right"/>
<TextBlock Grid.Row="1" VerticalAlignment="Center" Grid.ColumnSpan="2">
<Run Text="启动时间:"/>
<Run Text="{Binding StartTime}"/>
</TextBlock>
<TextBlock Grid.Row="2" Grid.ColumnSpan="2" VerticalAlignment="Center">
<Run Text="运行时间:"/>
<Run Text="{Binding RunTime}"/>
</TextBlock>
<DockPanel Grid.Row="2" Grid.Column="2" >
<ComboBox DockPanel.Dock="Right" ItemsSource="{Binding IntervalTimesSource}" SelectedIndex="{Binding selectedIndex}" Text="{Binding ProMonInterval}" VerticalAlignment="Center"/>
<TextBlock Text="监隔间隔(s):" DockPanel.Dock="Right" VerticalAlignment="Center"/>
</DockPanel>
</Grid>
</GroupBox>
<ListBox Grid.Row="2" ItemsSource="{Binding ReciveDataSource}">
</ListBox>
<ProgressBar Grid.Row="3"/>
<DataGrid Grid.Column="1" Grid.RowSpan="3" ItemsSource="{Binding DataGridSource}">
</DataGrid>
<StackPanel Grid.Row="3" Grid.Column="1" Orientation="Horizontal" VerticalAlignment="Center">
<Button Content="查询" Command="{Binding QueryDataCommand}"/>
<Button Content="新增" Command="{Binding InsertDataCommand}"/>
</StackPanel>
</Grid>
</UserControl>