317 lines
18 KiB
XML
317 lines
18 KiB
XML
<Window x:Class="WifiSitterGui.MainWindow"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
xmlns:local="clr-namespace:WifiSitterGui"
|
|
xmlns:tb="http://www.hardcodet.net/taskbar"
|
|
xmlns:vm="clr-namespace:WifiSitterGui.ViewModel"
|
|
Icon="pack://application:,,,/Resources/Wireless-04.ico"
|
|
PreviewMouseDown="Window_PreviewMouseDown"
|
|
LocationChanged="Window_LocationChanged"
|
|
WindowStartupLocation="CenterScreen"
|
|
LostFocus="Window_LostFocus"
|
|
Title="WifiSitter Config"
|
|
KeyUp="MainWindow_KeyUp"
|
|
SizeToContent="Height"
|
|
mc:Ignorable="d"
|
|
MinHeight="450"
|
|
Height="600"
|
|
Width="525" >
|
|
|
|
<Window.DataContext>
|
|
<vm:MainWindowViewModel/>
|
|
</Window.DataContext>
|
|
|
|
<Window.Resources>
|
|
|
|
<Style x:Key="DataGridHeaderStyle" TargetType="{x:Type DataGridColumnHeader}">
|
|
<Setter Property="Foreground" Value="#FF000000" />
|
|
<Setter Property="HorizontalContentAlignment" Value="Left" />
|
|
<Setter Property="VerticalContentAlignment" Value="Center" />
|
|
<Setter Property="IsTabStop" Value="False" />
|
|
<Setter Property="SeparatorBrush" Value="#FFC9CACA" />
|
|
<Setter Property="Padding" Value="4" />
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="{x:Type DataGridColumnHeader}">
|
|
<Grid Name="Root">
|
|
<VisualStateManager.VisualStateGroups>
|
|
<VisualStateGroup x:Name="CommonStates">
|
|
<VisualState x:Name="Normal" />
|
|
<VisualState x:Name="MouseOver">
|
|
<Storyboard>
|
|
<ColorAnimation Duration="0" Storyboard.TargetName="BackgroundRectangle" Storyboard.TargetProperty="(Fill).Color" To="#FF448DCA"/>
|
|
<ColorAnimation Duration="0" Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Fill).(GradientStops)[3].Color" To="#FCFFFFFF"/>
|
|
<ColorAnimation Duration="0" Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Fill).(GradientStops)[2].Color" To="#F7FFFFFF"/>
|
|
<ColorAnimation Duration="0" Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Fill).(GradientStops)[1].Color" To="#E5FFFFFF"/>
|
|
</Storyboard>
|
|
</VisualState>
|
|
<VisualState x:Name="Pressed">
|
|
<Storyboard>
|
|
<ColorAnimation Duration="0" Storyboard.TargetName="BackgroundRectangle" Storyboard.TargetProperty="(Fill).Color" To="#FF448DCA"/>
|
|
</Storyboard>
|
|
</VisualState>
|
|
</VisualStateGroup>
|
|
<VisualStateGroup x:Name="SortStates">
|
|
<VisualState x:Name="Unsorted" />
|
|
<VisualState x:Name="SortAscending">
|
|
<Storyboard>
|
|
<DoubleAnimation Storyboard.TargetName="SortIcon" Storyboard.TargetProperty="Opacity" Duration="0" To="1.0"/>
|
|
</Storyboard>
|
|
</VisualState>
|
|
<VisualState x:Name="SortDescending">
|
|
<Storyboard>
|
|
<DoubleAnimation Storyboard.TargetName="SortIcon" Storyboard.TargetProperty="Opacity" Duration="0" To="1.0"/>
|
|
<DoubleAnimation Storyboard.TargetName="SortIcon" Storyboard.TargetProperty="(RenderTransform).ScaleY" Duration="0" To="-.9"/>
|
|
</Storyboard>
|
|
</VisualState>
|
|
</VisualStateGroup>
|
|
</VisualStateManager.VisualStateGroups>
|
|
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition/>
|
|
<ColumnDefinition Width="Auto" />
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<Rectangle x:Name="BackgroundRectangle" Stretch="Fill" Fill="#FF6D879C" Grid.ColumnSpan="2" />
|
|
|
|
<Rectangle x:Name="BackgroundGradient" Stretch="Fill" Grid.ColumnSpan="2" >
|
|
<Rectangle.Fill>
|
|
<LinearGradientBrush StartPoint=".7,0" EndPoint=".7,1">
|
|
<GradientStop Color="White" Offset="0.015" />
|
|
<GradientStop Color="White" Offset="0.375" />
|
|
<GradientStop Color="White" Offset="0.6" />
|
|
<GradientStop Color="White" Offset="1" />
|
|
</LinearGradientBrush>
|
|
</Rectangle.Fill>
|
|
</Rectangle>
|
|
|
|
<Grid HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="{TemplateBinding Padding}">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition/>
|
|
<ColumnDefinition Width="Auto" />
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<ContentPresenter Content="{TemplateBinding Content}"/>
|
|
|
|
<Path Grid.Column="1" Name="SortIcon" Fill="#FF444444" RenderTransformOrigin=".5,.5" HorizontalAlignment="Left" VerticalAlignment="Center" Opacity="0" Stretch="Uniform" Width="8" Margin="4,0,0,0" Data="F1 M -5.215,6.099L 5.215,6.099L 0,0L -5.215,6.099 Z ">
|
|
<Path.RenderTransform>
|
|
<ScaleTransform ScaleX=".9" ScaleY=".9" />
|
|
</Path.RenderTransform>
|
|
</Path>
|
|
</Grid>
|
|
|
|
<Rectangle Name="VerticalSeparator" Grid.Column="1" Width="1" VerticalAlignment="Stretch" Fill="{TemplateBinding SeparatorBrush}" Visibility="{TemplateBinding SeparatorVisibility}" />
|
|
</Grid>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
|
|
<DataTemplate x:Key="WhitelistedInterfaceTemplate">
|
|
<TextBlock>
|
|
<Run Text="{Binding Name, Mode=OneWay}"/>
|
|
<Run Text=" - "/>
|
|
<Run Text="{Binding Description, Mode=OneWay}"/>
|
|
</TextBlock>
|
|
</DataTemplate>
|
|
|
|
</Window.Resources>
|
|
|
|
<Grid>
|
|
<TabControl>
|
|
<TabItem Header="Status">
|
|
<StackPanel>
|
|
<Grid x:Name="StatusLabels">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="Auto"/>
|
|
<ColumnDefinition/>
|
|
</Grid.ColumnDefinitions>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition/>
|
|
<RowDefinition/>
|
|
</Grid.RowDefinitions>
|
|
|
|
<!--<Label Grid.Column="0"
|
|
Grid.Row="0"
|
|
Content="{Binding ServiceState, Mode=OneWay}">-->
|
|
|
|
<Label Grid.Column="0"
|
|
Grid.Row="0">
|
|
<Label.Style>
|
|
<Style TargetType="Label">
|
|
<!--
|
|
"Running"
|
|
"Stopped"
|
|
"Paused"
|
|
"Stopping"
|
|
"Starting"
|
|
|
|
ServiceState
|
|
-->
|
|
|
|
<Style.Triggers>
|
|
<DataTrigger Binding="{Binding ServiceState}" Value="Running">
|
|
<Setter Property="Content" Value="Service Running"/>
|
|
<Setter Property="Foreground" Value="Green"/>
|
|
<Setter Property="ToolTip" Value="Service running."/>
|
|
</DataTrigger>
|
|
<DataTrigger Binding="{Binding ServiceState}" Value="Stopped">
|
|
<Setter Property="Content" Value="Service Stopped"/>
|
|
<Setter Property="Foreground" Value="#FFB81010"/>
|
|
<Setter Property="ToolTip" Value="Service stopped."/>
|
|
</DataTrigger>
|
|
<DataTrigger Binding="{Binding ServiceState}" Value="Paused">
|
|
<Setter Property="Content" Value="Service Paused"/>
|
|
<Setter Property="Foreground" Value="#FF3A3A3A"/>
|
|
<Setter Property="ToolTip" Value="Service paused."/>
|
|
</DataTrigger>
|
|
<DataTrigger Binding="{Binding ServiceState}" Value="Stopping">
|
|
<Setter Property="Content" Value="Service Stopping"/>
|
|
<Setter Property="Foreground" Value="Goldenrod"/>
|
|
<Setter Property="ToolTip" Value="Service stopping."/>
|
|
</DataTrigger>
|
|
<DataTrigger Binding="{Binding ServiceState}" Value="Starting">
|
|
<Setter Property="Content" Value="Service Starting"/>
|
|
<Setter Property="Foreground" Value="Goldenrod"/>
|
|
<Setter Property="ToolTip" Value="Service starting."/>
|
|
</DataTrigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
</Label.Style>
|
|
</Label>
|
|
|
|
<Label Grid.Column="0"
|
|
Grid.Row="1">
|
|
<Label.Style>
|
|
<Style TargetType="Label">
|
|
<Style.Triggers>
|
|
<DataTrigger Binding="{Binding CommuncationEstablished}" Value="True">
|
|
<Setter Property="Content" Value="Agent Communicating"/>
|
|
<Setter Property="Foreground" Value="Green"/>
|
|
<Setter Property="ToolTip" Value="Communicating with WifiSitter.exe"/>
|
|
</DataTrigger>
|
|
<DataTrigger Binding="{Binding CommuncationEstablished}" Value="False">
|
|
<Setter Property="Content" Value="Agent Not Communicating"/>
|
|
<Setter Property="Foreground" Value="#FFB81010"/>
|
|
<Setter Property="ToolTip" Value="PC Load Letter 😦"/>
|
|
</DataTrigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
</Label.Style>
|
|
</Label>
|
|
</Grid>
|
|
|
|
<GroupBox x:Name="WiredInterfaceList"
|
|
Grid.Row="1">
|
|
<GroupBox.Header>
|
|
<Label FontWeight="Bold">Wired Interfaces</Label>
|
|
</GroupBox.Header>
|
|
<DataGrid x:Name="ListWiredNics"
|
|
IsReadOnly="True"
|
|
HeadersVisibility="Column"
|
|
AutoGenerateColumns="False"
|
|
EnableRowVirtualization="True"
|
|
ColumnHeaderStyle="{StaticResource DataGridHeaderStyle}"
|
|
ItemsSource="{Binding WiredNics, Mode=OneWay}" >
|
|
<DataGrid.Columns>
|
|
<DataGridCheckBoxColumn Binding="{Binding IsEnabled}" Header="Enabled"/>
|
|
<DataGridCheckBoxColumn Binding="{Binding IsConnected}" Header="Connected"/>
|
|
<DataGridTextColumn Binding="{Binding Name}" Header="Name"/>
|
|
<DataGridTextColumn Binding="{Binding Description}" Header="Description"/>
|
|
</DataGrid.Columns>
|
|
</DataGrid>
|
|
</GroupBox>
|
|
|
|
<GroupBox x:Name="WirelessInterfaceList">
|
|
<GroupBox.Header>
|
|
<Label FontWeight="Bold">Wireless Interfaces</Label>
|
|
</GroupBox.Header>
|
|
<DataGrid x:Name="ListWirelessNics"
|
|
Grid.Row="2"
|
|
IsReadOnly="True"
|
|
AutoGenerateColumns="False"
|
|
ColumnHeaderStyle="{StaticResource DataGridHeaderStyle}"
|
|
ItemsSource="{Binding WirelessNics, Mode=OneWay}" >
|
|
<DataGrid.Columns>
|
|
<DataGridCheckBoxColumn Binding="{Binding IsEnabled}" Header="Enabled"/>
|
|
<DataGridCheckBoxColumn Binding="{Binding IsConnected}" Header="Connected"/>
|
|
<DataGridTextColumn Binding="{Binding Name}" Header="Name"/>
|
|
<DataGridTextColumn Binding="{Binding Description}" Header="Description"/>
|
|
</DataGrid.Columns>
|
|
</DataGrid>
|
|
</GroupBox>
|
|
|
|
<GroupBox x:Name="WhitelistedInterfaceList"
|
|
ToolTip="Disabled interfaces may not show in this list."
|
|
Margin="0,0,0,48">
|
|
<GroupBox.Header>
|
|
<Label FontWeight="Bold">Whitelisted Interfaces</Label>
|
|
</GroupBox.Header>
|
|
<ListBox x:Name="DataGridIgnoredNics"
|
|
Grid.Row="3"
|
|
ItemTemplate="{StaticResource WhitelistedInterfaceTemplate}"
|
|
ItemsSource="{Binding IgnoredNics, Mode=OneWay}"
|
|
ToolTip="Disabled interfaces may not show in this list."/>
|
|
</GroupBox>
|
|
</StackPanel>
|
|
</TabItem>
|
|
|
|
<TabItem Header="Settings">
|
|
|
|
</TabItem>
|
|
|
|
</TabControl>
|
|
|
|
<Expander x:Name="WhitelistExpander"
|
|
VerticalAlignment="Bottom"
|
|
HorizontalContentAlignment="Stretch"
|
|
ExpandDirection="Up"
|
|
Background="White"
|
|
Margin="0"
|
|
ToolTip="Whitelist entries from system registry.">
|
|
<Expander.Header>
|
|
<Label Content="Whitelist Entries"
|
|
FontWeight="Bold"/>
|
|
</Expander.Header>
|
|
<Expander.Effect>
|
|
<DropShadowEffect ShadowDepth="1"
|
|
Direction="90"
|
|
RenderingBias="Performance">
|
|
</DropShadowEffect>
|
|
</Expander.Effect>
|
|
<Expander.Content>
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition Height="Auto"/>
|
|
</Grid.RowDefinitions>
|
|
<ListBox x:Name="IgnoredNicsList"
|
|
ItemsSource="{Binding Whitelist, Mode=OneWay}" />
|
|
<Button Margin="4"
|
|
Height="32"
|
|
Width="32"
|
|
Padding="-1"
|
|
ToolTip="Refresh Whitelist"
|
|
Command="{Binding ReloadWhitelist}"
|
|
HorizontalAlignment="Right"
|
|
VerticalAlignment="Top"
|
|
Grid.RowSpan="2">
|
|
<Button.Effect>
|
|
<DropShadowEffect ShadowDepth="1"/>
|
|
</Button.Effect>
|
|
<ContentControl Content="{StaticResource RefreshIcon}"/>
|
|
</Button>
|
|
</Grid>
|
|
</Expander.Content>
|
|
</Expander>
|
|
|
|
<Button x:Name="Btn_About"
|
|
HorizontalAlignment="Right"
|
|
VerticalAlignment="Top"
|
|
Margin="4,0"
|
|
Click="Btn_About_Click">About</Button>
|
|
</Grid>
|
|
</Window>
|