Moved datagrids into groupboxes and removed gradiant style from columnheader
parent
d0ac5a7dc7
commit
d6f5369c63
|
@ -24,149 +24,90 @@
|
|||
|
||||
<Window.Resources>
|
||||
|
||||
<Style x:Key="AnimatedSwitch" TargetType="{x:Type ToggleButton}">
|
||||
<Setter Property="Foreground" Value="Black" />
|
||||
<Setter Property="Background" Value="#FAFAFB" />
|
||||
<Setter Property="BorderBrush" Value="#EAEAEB" />
|
||||
<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="ToggleButton">
|
||||
<Viewbox Stretch="Uniform">
|
||||
<Canvas Name="Layer_1" Width="20" Height="20" Canvas.Left="10" Canvas.Top="0">
|
||||
<Ellipse Canvas.Left="0" Width="20" Height="20" Fill="{TemplateBinding Background}" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="0.5"/>
|
||||
<Ellipse Canvas.Left="15" Width="20" Height="20" Fill="{TemplateBinding Background}" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="0.5"/>
|
||||
<Border Canvas.Left="10" Width="15" Height="20" Name="rect416927" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0,0.5,0,0.5"/>
|
||||
<Ellipse x:Name="ellipse" Canvas.Left="0" Width="20" Height="20" Fill="White" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="0.3">
|
||||
<Ellipse.RenderTransform>
|
||||
<TranslateTransform X="0" Y="0" />
|
||||
</Ellipse.RenderTransform>
|
||||
<Ellipse.BitmapEffect>
|
||||
<DropShadowBitmapEffect Softness="0.1" ShadowDepth="0.7" Direction="270" Color="#BBBBBB"/>
|
||||
</Ellipse.BitmapEffect>
|
||||
</Ellipse>
|
||||
</Canvas>
|
||||
</Viewbox>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsChecked" Value="True" >
|
||||
<Trigger.EnterActions>
|
||||
<BeginStoryboard>
|
||||
<ControlTemplate TargetType="{x:Type DataGridColumnHeader}">
|
||||
<Grid Name="Root">
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal" />
|
||||
<VisualState x:Name="MouseOver">
|
||||
<Storyboard>
|
||||
<ColorAnimation Storyboard.TargetProperty="Background.Color" To="#52D468" Duration="0:0:0.2" />
|
||||
<ColorAnimation Storyboard.TargetProperty="BorderBrush.Color" To="#41C955" Duration="0:0:0.2" />
|
||||
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(Ellipse.RenderTransform).(TranslateTransform.X)" Storyboard.TargetName="ellipse">
|
||||
<SplineDoubleKeyFrame KeyTime="0" Value="0"/>
|
||||
<SplineDoubleKeyFrame KeyTime="0:0:0.4" Value="15" KeySpline="0, 1, 0.6, 1"/>
|
||||
</DoubleAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</BeginStoryboard>
|
||||
</Trigger.EnterActions>
|
||||
<Trigger.ExitActions>
|
||||
<BeginStoryboard>
|
||||
<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 Storyboard.TargetProperty="Background.Color" To="#FAFAFB" Duration="0:0:0.2" />
|
||||
<ColorAnimation Storyboard.TargetProperty="BorderBrush.Color" To="#EAEAEB" Duration="0:0:0.2" />
|
||||
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(Ellipse.RenderTransform).(TranslateTransform.X)" Storyboard.TargetName="ellipse">
|
||||
<SplineDoubleKeyFrame KeyTime="0" Value="15"/>
|
||||
<SplineDoubleKeyFrame KeyTime="0:0:0.3" Value="0" KeySpline="0, 0.5, 0.5, 1"/>
|
||||
</DoubleAnimationUsingKeyFrames>
|
||||
<ColorAnimation Duration="0" Storyboard.TargetName="BackgroundRectangle" Storyboard.TargetProperty="(Fill).Color" To="#FF448DCA"/>
|
||||
</Storyboard>
|
||||
</BeginStoryboard>
|
||||
</Trigger.ExitActions>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</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="#FF1F3B53" 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="InterfaceTemplate">
|
||||
<Grid Margin="2" HorizontalAlignment="Stretch">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!--Enabled-->
|
||||
<Grid Grid.Column="0" Grid.Row="0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="56"/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<ToggleButton Grid.Column="0"
|
||||
Height="22" Width="36"
|
||||
IsChecked="{Binding IsEnabled, Mode=OneWay}"
|
||||
Style="{StaticResource AnimatedSwitch}"/>
|
||||
<Label Grid.Column="1">
|
||||
<Label.Style>
|
||||
<Style TargetType="Label">
|
||||
<!--<Setter Property="Content" Value="{Binding IsEnabled}"></Setter>-->
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding IsEnabled}" Value="True">
|
||||
<Setter Property="Content" Value="Enabled"/>
|
||||
<Setter Property="ToolTip" Value="Interface Enabled"/>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding IsEnabled}" Value="False">
|
||||
<Setter Property="Content" Value="Not Enabled"/>
|
||||
<Setter Property="ToolTip" Value="Interface Not Enabled"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Label.Style>
|
||||
</Label>
|
||||
</Grid>
|
||||
|
||||
<!--Connected-->
|
||||
<Grid Grid.Column="0" Grid.Row="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="56"/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<ToggleButton Grid.Column="0"
|
||||
Height="22" Width="36"
|
||||
IsChecked="{Binding IsConnected, Mode=OneWay}"
|
||||
Style="{StaticResource AnimatedSwitch}"/>
|
||||
<Label Grid.Column="1">
|
||||
<Label.Style>
|
||||
<Style TargetType="Label">
|
||||
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding IsConnected}" Value="True">
|
||||
<Setter Property="Content" Value="Connected"/>
|
||||
<Setter Property="ToolTip" Value="Interface Connected"/>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding IsConnected}" Value="False">
|
||||
<Setter Property="Content" Value="Not Connected"/>
|
||||
<Setter Property="ToolTip" Value="Interface Not Connected"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Label.Style>
|
||||
</Label>
|
||||
</Grid>
|
||||
|
||||
<!--Floats above toggle buttons to intercept click events-->
|
||||
<Button Grid.Column="0"
|
||||
Grid.RowSpan="2"
|
||||
OpacityMask="Transparent"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch"/>
|
||||
|
||||
<!--Name-->
|
||||
<Label Grid.Column="1" Grid.Row="0"
|
||||
Content="{Binding Name}"
|
||||
ToolTip="Interface Name"/>
|
||||
|
||||
<!--Description-->
|
||||
<Label Grid.Column="1" Grid.Row="1"
|
||||
Content="{Binding Description}"
|
||||
ToolTip="Interface Description"/>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
|
||||
<DataTemplate x:Key="WhitelistedInterfaceTemplate">
|
||||
<TextBlock>
|
||||
<Run Text="{Binding Name, Mode=OneWay}"/>
|
||||
|
@ -181,7 +122,7 @@
|
|||
<TabControl>
|
||||
<TabItem Header="Status">
|
||||
<StackPanel>
|
||||
<Grid>
|
||||
<Grid x:Name="StatusLabels">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition/>
|
||||
|
@ -191,20 +132,11 @@
|
|||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Label x:Name="StatusLabels" Grid.Column="0"
|
||||
Grid.Row="0">
|
||||
Service Status:
|
||||
</Label>
|
||||
<Label Grid.Column="1"
|
||||
<Label Grid.Column="0"
|
||||
Grid.Row="0"
|
||||
Content="{Binding ServiceState, Mode=OneWay}"/>
|
||||
|
||||
<Label Grid.Column="0"
|
||||
Grid.Row="1"
|
||||
ToolTip="Is communcaiton established with WifiSitter.exe?">
|
||||
Communication:
|
||||
</Label>
|
||||
<Label Grid.Column="1"
|
||||
Grid.Row="1">
|
||||
<Label.Style>
|
||||
<Style TargetType="Label">
|
||||
|
@ -217,7 +149,7 @@
|
|||
<DataTrigger Binding="{Binding CommuncationEstablished}" Value="False">
|
||||
<Setter Property="Content" Value="Not Communicating"/>
|
||||
<Setter Property="Foreground" Value="Red"/>
|
||||
<Setter Property="ToolTip" Value="Not communicating with WifiSitter.exe"/>
|
||||
<Setter Property="ToolTip" Value="PC Load Letter 😦"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
|
@ -225,31 +157,58 @@
|
|||
</Label>
|
||||
</Grid>
|
||||
|
||||
<Label x:Name="WiredInterfaceList"
|
||||
Content="Wired Interfaces"
|
||||
FontWeight="Bold"/>
|
||||
<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>
|
||||
|
||||
<ListBox x:Name="ListWiredNics"
|
||||
Grid.Row="1"
|
||||
ItemTemplate="{StaticResource InterfaceTemplate}"
|
||||
ItemsSource="{Binding WiredNics, Mode=OneWay}" />
|
||||
<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>
|
||||
|
||||
<Label x:Name="WirelessInterfaceList"
|
||||
Content="Wireless Interfaces"
|
||||
FontWeight="Bold"/>
|
||||
<ListBox x:Name="ListWirelessNics"
|
||||
Grid.Row="2"
|
||||
ItemTemplate="{StaticResource InterfaceTemplate}"
|
||||
ItemsSource="{Binding WirelessNics, Mode=OneWay}" />
|
||||
|
||||
<Label x:Name="WhitelistedInterfaceList"
|
||||
Content="Whitelisted Interfaces"
|
||||
FontWeight="Bold" ToolTip="Disabled interfaces may not show in this list."/>
|
||||
<ListBox x:Name="DataGridIgnoredNics"
|
||||
<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>
|
||||
|
||||
|
|
Loading…
Reference in New Issue