1
0
Fork 0
mirror of https://github.com/hawkeye-stan/msfs-popout-panel-manager.git synced 2024-11-25 15:20:10 +00:00
msfs-popout-panel-manager/WpfApp/UserControlPanelConfiguration.xaml

276 lines
22 KiB
Text
Raw Normal View History

2022-01-27 13:40:04 +00:00
<UserControl x:Class="MSFSPopoutPanelManager.WpfApp.UserControlPanelConfiguration"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls"
2022-08-08 06:07:24 +00:00
xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks"
2022-06-30 23:53:08 +00:00
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
2022-01-27 13:40:04 +00:00
xmlns:c="clr-namespace:CalcBinding;assembly=CalcBinding"
mc:Ignorable="d"
2022-07-23 19:23:32 +00:00
Height="545"
2022-01-27 13:40:04 +00:00
Width="920"
Background="#FF323A64">
<UserControl.Resources>
<ResourceDictionary>
<Style x:Key="TextBoxColumnFocus" TargetType="TextBox" BasedOn="{StaticResource {x:Type TextBox}}">
<Style.Triggers>
<Trigger Property="IsFocused" Value="true">
<Setter Property="Background" Value="#FF576573" />
</Trigger>
2022-02-07 03:05:05 +00:00
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="TextBox">
<Border Background="Transparent" BorderBrush="Transparent" BorderThickness="0">
<TextBlock Text="{TemplateBinding Text}" Padding="4" />
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Trigger>
2022-01-27 13:40:04 +00:00
</Style.Triggers>
</Style>
</ResourceDictionary>
</UserControl.Resources>
2022-08-02 20:55:20 +00:00
<Grid KeyboardNavigation.DirectionalNavigation="None">
2022-01-27 13:40:04 +00:00
<DockPanel>
2022-07-30 02:29:20 +00:00
<WrapPanel DockPanel.Dock="Top" Orientation="Horizontal" Margin="19,10,0,0" HorizontalAlignment="Left">
2022-08-13 06:14:49 +00:00
<WrapPanel Width="850">
<Label Content="Panel Locations and Settings -" Margin="0,0,0,0" HorizontalAlignment="Left"/>
<Label Content="{Binding ProfileData.ActiveProfile.ProfileName}" Margin="0,0,0,0" HorizontalAlignment="Left"/>
</WrapPanel>
<WrapPanel>
<controls:Tile Foreground="LightSkyBlue" Background="Transparent" VerticalAlignment="Center" Width="30" Height="30"
controls:ControlsHelper.MouseOverBorderBrush="{DynamicResource MahApps.Brushes.Button.Border}" Click="Instruction_Click" >
<Image Width="22" Height="22" VerticalAlignment="Center" Source="Resources\info_icon.png"></Image>
</controls:Tile>
</WrapPanel>
2022-07-30 02:29:20 +00:00
<DataGrid Name="PanelConfigGrid" HorizontalAlignment="Center" Width="882" Height="430" Margin="0 10 0 0" AutoGenerateColumns="False" CanUserResizeColumns="False" HorizontalScrollBarVisibility="Disabled"
2022-08-02 20:55:20 +00:00
CanUserReorderColumns="False" CanUserResizeRows="False" HorizontalGridLinesBrush="#B9B9B9" VerticalGridLinesBrush="#B9B9B9" GridLinesVisibility="Horizontal" SelectionUnit="Cell"
2022-01-27 13:40:04 +00:00
BorderThickness="1" CanUserAddRows="False" CanUserSortColumns="False" KeyboardNavigation.TabNavigation="None" KeyboardNavigation.IsTabStop="False"
2022-08-08 06:07:24 +00:00
ItemsSource="{Binding ProfileData.ActiveProfile.PanelConfigs}" HeadersVisibility="Column" KeyboardNavigation.DirectionalNavigation="Local" MouseDown="PanelConfigGrid_MouseDown">
2022-01-27 13:40:04 +00:00
<DataGrid.RowStyle>
<Style TargetType="DataGridRow">
<Setter Property="Background" Value="{x:Null}" />
<Setter Property="BorderBrush" Value="{x:Null}" />
<Style.Triggers>
2022-08-02 20:55:20 +00:00
<Trigger Property="IsSelected" Value="True">
2022-01-27 13:40:04 +00:00
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderBrush" Value="{x:Null}" />
</Trigger>
</Style.Triggers>
</Style>
</DataGrid.RowStyle>
<DataGrid.ColumnHeaderStyle>
<Style TargetType="DataGridColumnHeader">
<Setter Property="ContentTemplate">
<Setter.Value>
<DataTemplate>
2022-07-30 02:29:20 +00:00
<TextBlock TextWrapping="Wrap" TextAlignment="Center" Text="{Binding}" FontSize="14"></TextBlock>
2022-01-27 13:40:04 +00:00
</DataTemplate>
</Setter.Value>
</Setter>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="controls:ControlsHelper.ContentCharacterCasing" Value="Normal"/>
2022-07-30 02:29:20 +00:00
<Setter Property="Height" Value="70"/>
2022-01-27 13:40:04 +00:00
<Setter Property="Background" Value="#FF576573"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="BorderBrush" Value="#FFB9B9B9"/>
<Setter Property="Padding" Value="5,0,5,0"/>
</Style>
</DataGrid.ColumnHeaderStyle>
<DataGrid.CellStyle>
<Style TargetType="DataGridCell">
<EventSetter Event="PreviewMouseLeftButtonDown" Handler="DataGridCell_PreviewMouseLeftButtonDown"/>
<Setter Property="TextBlock.TextAlignment" Value="Center" />
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderBrush" Value="Transparent" />
</Trigger>
</Style.Triggers>
</Style>
</DataGrid.CellStyle>
<DataGrid.Columns>
2022-08-02 20:55:20 +00:00
<DataGridTemplateColumn Header="" Width="30" >
2022-01-27 13:40:04 +00:00
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
2022-08-02 20:55:20 +00:00
<TextBox Name="PanelName" Width="30" Height="28" BorderThickness="0" TextAlignment="Left"
SourceUpdated="GridData_SourceUpdated"
IsReadOnly="True"
IsHitTestVisible="{c:Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid, AncestorLevel=1}, Path='!DataContext.ProfileData.ActiveProfile.IsLocked'}"
Text="&#x25B6;"
VerticalAlignment="Center"
Padding="5, 3, 0, 0">
2022-01-27 13:40:04 +00:00
<TextBox.Style>
<Style TargetType="TextBox">
2022-08-02 20:55:20 +00:00
<Setter Property="Cursor" Value="Arrow"></Setter>
<Setter Property="SelectionOpacity" Value="0"></Setter>
<Style.Triggers>
<Trigger Property="IsFocused" Value="False">
<Setter Property="Background" Value="Transparent" />
</Trigger>
<Trigger Property="IsFocused" Value="True">
<Setter Property="Background" Value="Red" />
</Trigger>
</Style.Triggers>
2022-01-27 13:40:04 +00:00
</Style>
</TextBox.Style>
</TextBox>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
2022-08-02 20:55:20 +00:00
<DataGridTemplateColumn Header="Panel Name" Width="200" >
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBox Name="PanelName" Width="220" BorderThickness="0" TextAlignment="Left"
Text="{Binding PanelName, Mode=TwoWay, NotifyOnSourceUpdated=True, UpdateSourceTrigger=LostFocus}"
SourceUpdated="GridData_SourceUpdated"
Style="{StaticResource TextBoxColumnFocus}"
IsReadOnly="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid, AncestorLevel=1}, Path=DataContext.ProfileData.ActiveProfile.IsLocked}"
IsEnabled="{Binding IsCustomPopOut}">
</TextBox>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
2022-07-30 02:29:20 +00:00
<DataGridTemplateColumn Header="X-Pos" Width="70">
2022-01-27 13:40:04 +00:00
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
2022-07-30 02:29:20 +00:00
<TextBox Name="Left" Width="70" BorderThickness="0"
2022-07-23 19:23:32 +00:00
Text="{Binding Left, Mode=TwoWay, NotifyOnSourceUpdated=True, UpdateSourceTrigger=LostFocus}"
2022-04-18 19:52:39 +00:00
SourceUpdated="GridData_SourceUpdated"
Style="{StaticResource TextBoxColumnFocus}"
2022-07-23 19:23:32 +00:00
IsReadOnly="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid, AncestorLevel=1}, Path=DataContext.ProfileData.ActiveProfile.IsLocked}"
IsHitTestVisible="{c:Binding Path='!FullScreen'}"
GotFocus="NumericDataPoint_GotFocus"
2022-07-30 02:29:20 +00:00
LostFocus="NumericDataPoint_LostFocus"
FontSize="14"/>
2022-06-30 23:53:08 +00:00
</DataTemplate>
2022-04-18 19:52:39 +00:00
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
2022-07-30 02:29:20 +00:00
<DataGridTemplateColumn Header="Y-Pos" Width="70">
2022-04-18 19:52:39 +00:00
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
2022-07-30 02:29:20 +00:00
<TextBox Name="Top" Width="70" BorderThickness="0"
2022-07-23 19:23:32 +00:00
Text="{Binding Top, Mode=TwoWay, NotifyOnSourceUpdated=True, UpdateSourceTrigger=LostFocus}"
2022-04-18 19:52:39 +00:00
SourceUpdated="GridData_SourceUpdated"
Style="{StaticResource TextBoxColumnFocus}"
2022-07-23 19:23:32 +00:00
IsReadOnly="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid, AncestorLevel=1}, Path=DataContext.ProfileData.ActiveProfile.IsLocked}"
IsHitTestVisible="{c:Binding Path='!FullScreen'}"
GotFocus="NumericDataPoint_GotFocus"
2022-07-30 02:29:20 +00:00
LostFocus="NumericDataPoint_LostFocus"
FontSize="14"/>
2022-01-27 13:40:04 +00:00
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
2022-07-30 02:29:20 +00:00
<DataGridTemplateColumn Header="Width" Width="70">
2022-01-27 13:40:04 +00:00
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
2022-07-30 02:29:20 +00:00
<TextBox Name="Width" Width="70" BorderThickness="0"
2022-07-23 19:23:32 +00:00
Text="{Binding Width, Mode=TwoWay, NotifyOnSourceUpdated=True, UpdateSourceTrigger=LostFocus}"
2022-04-18 19:52:39 +00:00
SourceUpdated="GridData_SourceUpdated"
Style="{StaticResource TextBoxColumnFocus}"
2022-07-23 19:23:32 +00:00
IsReadOnly="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid, AncestorLevel=1}, Path=DataContext.ProfileData.ActiveProfile.IsLocked}"
IsHitTestVisible="{c:Binding Path='!FullScreen'}"
GotFocus="NumericDataPoint_GotFocus"
2022-07-30 02:29:20 +00:00
LostFocus="NumericDataPoint_LostFocus"
FontSize="14"/>
2022-01-27 13:40:04 +00:00
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
2022-07-30 02:29:20 +00:00
<DataGridTemplateColumn Header="Height" Width="70">
2022-01-27 13:40:04 +00:00
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
2022-07-30 02:29:20 +00:00
<TextBox Name="Height" Width="70" BorderThickness="0"
2022-07-23 19:23:32 +00:00
Text="{Binding Height, Mode=TwoWay, NotifyOnSourceUpdated=True, UpdateSourceTrigger=LostFocus}"
2022-04-18 19:52:39 +00:00
SourceUpdated="GridData_SourceUpdated"
Style="{StaticResource TextBoxColumnFocus}"
2022-07-23 19:23:32 +00:00
IsReadOnly="{c:Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid, AncestorLevel=1}, Path='DataContext.ProfileData.ActiveProfile.IsLocked'}"
IsHitTestVisible="{c:Binding Path='!FullScreen'}"
GotFocus="NumericDataPoint_GotFocus"
2022-07-30 02:29:20 +00:00
LostFocus="NumericDataPoint_LostFocus"
FontSize="14"/>
2022-01-27 13:40:04 +00:00
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
2022-07-30 02:29:20 +00:00
<DataGridTemplateColumn Header="Always on Top" Width="75">
2022-01-27 13:40:04 +00:00
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
2022-07-30 02:29:20 +00:00
<CheckBox Name="AlwaysOnTop" Width="75" Margin="30 0 0 0"
2022-04-18 19:52:39 +00:00
SourceUpdated="GridData_SourceUpdated"
2022-07-23 19:23:32 +00:00
IsChecked="{Binding AlwaysOnTop, Mode=TwoWay, NotifyOnSourceUpdated=True, UpdateSourceTrigger=PropertyChanged}"
IsEnabled="{c:Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid, AncestorLevel=1}, Path='!DataContext.ProfileData.ActiveProfile.IsLocked'}"
2022-04-18 19:52:39 +00:00
IsHitTestVisible="{c:Binding Path='!FullScreen'}"/>
2022-01-27 13:40:04 +00:00
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
2022-07-30 02:29:20 +00:00
<DataGridTemplateColumn Header="Hide Title Bar" Width="75">
2022-01-27 13:40:04 +00:00
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
2022-07-30 02:29:20 +00:00
<CheckBox Name="HideTitlebar" Width="75" Margin="30 0 0 0"
2022-04-18 19:52:39 +00:00
SourceUpdated="GridData_SourceUpdated"
2022-07-23 19:23:32 +00:00
IsChecked="{Binding HideTitlebar, Mode=TwoWay, NotifyOnSourceUpdated=True, UpdateSourceTrigger=PropertyChanged}"
IsEnabled="{c:Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid, AncestorLevel=1}, Path='!DataContext.ProfileData.ActiveProfile.IsLocked '}"
IsHitTestVisible="{c:Binding Path='!FullScreen and IsCustomPopOut'}"/>
2022-01-27 13:40:04 +00:00
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
2022-07-30 02:29:20 +00:00
<DataGridTemplateColumn Header="Full Screen Mode" Width="80">
2022-01-27 13:40:04 +00:00
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
2022-07-30 02:29:20 +00:00
<CheckBox Name="FullScreen" Width="80" Margin="32 0 0 0"
2022-04-18 19:52:39 +00:00
SourceUpdated="GridData_SourceUpdated"
2022-07-23 19:23:32 +00:00
IsChecked="{Binding FullScreen, Mode=TwoWay, NotifyOnSourceUpdated=True, UpdateSourceTrigger=PropertyChanged}"
IsEnabled="{c:Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid, AncestorLevel=1}, Path='!DataContext.ProfileData.ActiveProfile.IsLocked'}"
2022-07-25 12:40:21 +00:00
IsHitTestVisible="{c:Binding Path='IsCustomPopOut'}"/>
2022-01-27 13:40:04 +00:00
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
2022-08-02 20:55:20 +00:00
<DataGridTemplateColumn Header="Touch Enabled" Width="70">
2022-06-13 03:49:56 +00:00
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
2022-08-02 20:55:20 +00:00
<CheckBox Name="TouchEnabled" Width="70" Margin="25 0 0 0"
2022-06-13 03:49:56 +00:00
SourceUpdated="GridData_SourceUpdated"
2022-07-23 19:23:32 +00:00
IsChecked="{Binding TouchEnabled, Mode=TwoWay, NotifyOnSourceUpdated=True, UpdateSourceTrigger=PropertyChanged}"
IsEnabled="{c:Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid, AncestorLevel=1}, Path='!DataContext.ProfileData.ActiveProfile.IsLocked'}"
IsHitTestVisible="{c:Binding Path='!FullScreen and IsCustomPopOut'}"/>
2022-06-13 03:49:56 +00:00
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
2022-07-30 02:29:20 +00:00
</DataGridTemplateColumn>
2022-08-02 20:55:20 +00:00
<DataGridTemplateColumn Header="Disable Game Refocus" Width="70">
2022-07-30 02:29:20 +00:00
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
2022-08-02 20:55:20 +00:00
<CheckBox Name="DisableGameRefocus" Width="70" Margin="25 0 0 0"
2022-07-30 02:29:20 +00:00
SourceUpdated="GridData_SourceUpdated"
IsChecked="{Binding DisableGameRefocus, Mode=TwoWay, NotifyOnSourceUpdated=True, UpdateSourceTrigger=PropertyChanged}"
IsEnabled="{c:Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid, AncestorLevel=1}, Path='!DataContext.ProfileData.ActiveProfile.IsLocked'}"
IsHitTestVisible="{c:Binding Path='!FullScreen and IsCustomPopOut and TouchEnabled'}"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
2022-06-13 03:49:56 +00:00
</DataGridTemplateColumn>
2022-01-27 13:40:04 +00:00
</DataGrid.Columns>
</DataGrid>
</WrapPanel>
<WrapPanel DockPanel.Dock="Bottom" Orientation="Horizontal" Margin="20,10,0,0" HorizontalAlignment="Left">
2022-08-02 20:55:20 +00:00
<Button Name="MinusTenButton" Content="-10 px" ToolTip="Down Arrow" HorizontalAlignment="Center" Margin="0,0,0,0" Width="75" Command="{Binding ConfigurePanelPixelCommand}" CommandParameter="-10"/>
<Button Name="MinusOneButton" Content="-1 px" ToolTip="Shift Down Arrow" HorizontalAlignment="Center" Margin="20,0,0,0" Width="75" Command="{Binding ConfigurePanelPixelCommand}" CommandParameter="-1"/>
<Button Name="PlusOneButton" Content="+1 px" ToolTip="Shift Up Arrow" HorizontalAlignment="Center" Margin="20,0,0,0" Width="75" Command="{Binding ConfigurePanelPixelCommand}" CommandParameter="1"/>
<Button Name="PlusTenButton" Content="+10 px" ToolTip="Up Arrow" HorizontalAlignment="Center" Margin="20,0,0,0" Width="75" Command="{Binding ConfigurePanelPixelCommand}" CommandParameter="10"/>
2022-07-23 19:23:32 +00:00
<Button HorizontalAlignment="Center" Margin="390,0,0,0" Width="130" Command="{Binding LockPanelsCommand}">
2022-01-27 13:40:04 +00:00
<Button.Style>
<Style TargetType="Button" BasedOn="{StaticResource {x:Type Button}}">
<Setter Property="Content" Value="Lock Panels"/>
<Style.Triggers>
2022-07-23 19:23:32 +00:00
<DataTrigger Binding="{Binding ProfileData.ActiveProfile.IsLocked, Mode=OneWay}" Value="True">
2022-01-27 13:40:04 +00:00
<Setter Property="Background" Value="Red"/>
<Setter Property="Content" Value="Unlock Panels"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Button.Style>
</Button>
</WrapPanel>
</DockPanel>
</Grid>
</UserControl>