mirror of
https://github.com/hawkeye-stan/msfs-popout-panel-manager.git
synced 2024-11-22 05:40:11 +00:00
392 lines
25 KiB
XML
392 lines
25 KiB
XML
<UserControl
|
|
x:Class="MSFSPopoutPanelManager.MainApp.ProfileCard"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:c="clr-namespace:CalcBinding;assembly=CalcBinding"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:domain="clr-namespace:MSFSPopoutPanelManager.DomainModel.Profile;assembly=DomainModel"
|
|
xmlns:local="clr-namespace:MSFSPopoutPanelManager.MainApp"
|
|
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
xmlns:system="clr-namespace:System;assembly=mscorlib"
|
|
xmlns:viewmodel="clr-namespace:MSFSPopoutPanelManager.MainApp.ViewModel"
|
|
Width="900"
|
|
Height="535"
|
|
mc:Ignorable="d">
|
|
<UserControl.Resources>
|
|
<local:StringToHudBarTypeConverter x:Key="StringToHudBarTypeConverter" />
|
|
<system:Double x:Key="IconSize">22</system:Double>
|
|
<system:Double x:Key="ButtonSize">28</system:Double>
|
|
<system:Double x:Key="UpDownIconSize">14</system:Double>
|
|
<system:Double x:Key="UpDownButtonSize">22</system:Double>
|
|
<DataTrigger
|
|
x:Key="TriggerIsDisabledAppInput"
|
|
Binding="{Binding IsDisabledAppInput}"
|
|
Value="True">
|
|
<Setter Property="FrameworkElement.Opacity" Value="0.6" />
|
|
<Setter Property="FrameworkElement.IsHitTestVisible" Value="False" />
|
|
</DataTrigger>
|
|
<Style
|
|
x:Key="ToggleButton"
|
|
BasedOn="{StaticResource MaterialDesignSwitchToggleButton}"
|
|
TargetType="ToggleButton">
|
|
<Setter Property="Margin" Value="4,0,4,0" />
|
|
</Style>
|
|
<Style
|
|
x:Key="TextBlockLabel"
|
|
BasedOn="{StaticResource {x:Type TextBlock}}"
|
|
TargetType="TextBlock">
|
|
<Setter Property="FontSize" Value="14" />
|
|
<Setter Property="TextWrapping" Value="Wrap" />
|
|
<Setter Property="Margin" Value="5,0,0,0" />
|
|
<Setter Property="LineHeight" Value="18" />
|
|
</Style>
|
|
<Style
|
|
x:Key="TxtBlockDisableWhenLocked"
|
|
BasedOn="{StaticResource TextBlockLabel}"
|
|
TargetType="TextBlock">
|
|
<Style.Triggers>
|
|
<DataTrigger Binding="{Binding ProfileData.ActiveProfile.IsLocked}" Value="True">
|
|
<Setter Property="Foreground" Value="DimGray" />
|
|
</DataTrigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
<Style
|
|
x:Key="CmbBoxDisableWhenLocked"
|
|
BasedOn="{StaticResource MaterialDesignComboBox}"
|
|
TargetType="ComboBox">
|
|
<Style.Triggers>
|
|
<DataTrigger Binding="{Binding ProfileData.ActiveProfile.IsLocked}" Value="True">
|
|
<Setter Property="Foreground" Value="DimGray" />
|
|
</DataTrigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
|
|
<ObjectDataProvider
|
|
x:Key="HudBarTypeEnum"
|
|
MethodName="GetValues"
|
|
ObjectType="system:Enum">
|
|
<ObjectDataProvider.MethodParameters>
|
|
<x:Type TypeName="domain:HudBarType" />
|
|
</ObjectDataProvider.MethodParameters>
|
|
</ObjectDataProvider>
|
|
</UserControl.Resources>
|
|
<Grid d:DataContext="{d:DesignInstance viewmodel:ProfileCardViewModel}">
|
|
<materialDesign:Card
|
|
x:Name="rootCard"
|
|
Width="900"
|
|
Height="535"
|
|
IsHitTestVisible="{c:Binding '!IsDisabledAppInput'}"
|
|
UniformCornerRadius="16">
|
|
<materialDesign:Card.Style>
|
|
<Style>
|
|
<Style.Triggers>
|
|
<StaticResource ResourceKey="TriggerIsDisabledAppInput" />
|
|
</Style.Triggers>
|
|
</Style>
|
|
</materialDesign:Card.Style>
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="44" />
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="*" />
|
|
<RowDefinition Height="55" />
|
|
</Grid.RowDefinitions>
|
|
<materialDesign:ColorZone
|
|
Grid.Row="0"
|
|
materialDesign:ElevationAssist.Elevation="Dp2"
|
|
DockPanel.Dock="Top"
|
|
Mode="PrimaryDark">
|
|
<StackPanel Height="44" Margin="16,6,8,0">
|
|
<DockPanel>
|
|
<StackPanel Width="812" Orientation="Horizontal">
|
|
<TextBox
|
|
x:Name="TxtBoxProfileTitle"
|
|
Margin="8,0,0,0"
|
|
FontSize="22"
|
|
FontWeight="Medium"
|
|
Foreground="White"
|
|
KeyDown="TxtBoxProfileTitle_KeyDown"
|
|
Text="{Binding ProfileData.ActiveProfile.Name, Mode=TwoWay}">
|
|
<TextBox.Style>
|
|
<Style BasedOn="{StaticResource MaterialDesignTextBox}" TargetType="TextBox">
|
|
<Style.Triggers>
|
|
<DataTrigger Binding="{Binding ElementName=ToggleButtonEditProfileTitle, Path=IsChecked}" Value="False">
|
|
<Setter Property="BorderThickness" Value="0" />
|
|
<Setter Property="IsReadOnly" Value="true" />
|
|
<Setter Property="IsHitTestVisible" Value="false" />
|
|
</DataTrigger>
|
|
<DataTrigger Binding="{Binding ElementName=ToggleButtonEditProfileTitle, Path=IsChecked}" Value="True">
|
|
<Setter Property="IsReadOnly" Value="false" />
|
|
<Setter Property="IsHitTestVisible" Value="true" />
|
|
</DataTrigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
</TextBox.Style>
|
|
</TextBox>
|
|
<ToggleButton
|
|
x:Name="ToggleButtonEditProfileTitle"
|
|
Width="16"
|
|
Height="16"
|
|
Margin="8,0,0,0"
|
|
materialDesign:ToggleButtonAssist.OnContent="{materialDesign:PackIcon Kind=PencilOff,
|
|
Size=14}"
|
|
Click="ToggleButtonEditProfileTitle_Click"
|
|
IsChecked="False"
|
|
Style="{StaticResource MaterialDesignActionDarkToggleButton}"
|
|
ToolTip="Edit aircraft profile name">
|
|
<materialDesign:PackIcon
|
|
Width="14"
|
|
Height="14"
|
|
Kind="Pencil" />
|
|
</ToggleButton>
|
|
</StackPanel>
|
|
<Button
|
|
x:Name="BtnDeleteProfile"
|
|
Width="{StaticResource ButtonSize}"
|
|
Height="{StaticResource ButtonSize}"
|
|
Command="{Binding DeleteProfileCommand}"
|
|
IsEnabled="True"
|
|
KeyboardNavigation.AcceptsReturn="False"
|
|
Style="{StaticResource MaterialDesignIconForegroundButton}"
|
|
ToolTip="Delete profile">
|
|
<materialDesign:PackIcon
|
|
Width="{StaticResource IconSize}"
|
|
Height="{StaticResource IconSize}"
|
|
Kind="DeleteOutline" />
|
|
</Button>
|
|
</DockPanel>
|
|
</StackPanel>
|
|
</materialDesign:ColorZone>
|
|
|
|
<DockPanel Grid.Row="1">
|
|
<Expander Style="{DynamicResource CustomMaterialDesignExpander}">
|
|
<Expander.Header>
|
|
<StackPanel Width="800" Orientation="Horizontal">
|
|
<TextBlock
|
|
Height="20"
|
|
Margin="0,0,10,0"
|
|
Style="{StaticResource MaterialDesignSubtitle1TextBlock}">
|
|
Active Aircraft:
|
|
</TextBlock>
|
|
<TextBlock Height="20" Text="{c:Binding 'FlightSimData.AircraftName == null ? "Aircraft binding information is currently unavailable" : FlightSimData.AircraftName'}">
|
|
<TextBlock.Style>
|
|
<Style BasedOn="{StaticResource MaterialDesignSubtitle1TextBlock}" TargetType="{x:Type TextBlock}">
|
|
<Style.Triggers>
|
|
<DataTrigger Binding="{Binding ProfileData.IsAircraftBoundToProfile}" Value="True">
|
|
<Setter Property="Foreground" Value="LightGreen" />
|
|
</DataTrigger>
|
|
<DataTrigger Binding="{Binding ProfileData.IsAircraftBoundToProfile}" Value="False">
|
|
<Setter Property="Foreground" Value="White" />
|
|
</DataTrigger>
|
|
<DataTrigger Binding="{Binding ProfileData.IsAllowedAddAircraftBinding}" Value="False">
|
|
<Setter Property="Foreground" Value="White" />
|
|
<Setter Property="ToolTip" Value="Aircraft is currently bound to another profile" />
|
|
</DataTrigger>
|
|
<DataTrigger Binding="{Binding FlightSimData.HasAircraftName}" Value="False">
|
|
<Setter Property="Foreground" Value="AntiqueWhite" />
|
|
<Setter Property="ToolTip" Value="No aircraft has been loaded by the game yet" />
|
|
</DataTrigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
</TextBlock.Style>
|
|
</TextBlock>
|
|
<ToggleButton
|
|
Width="{StaticResource ButtonSize}"
|
|
Height="{StaticResource IconSize}"
|
|
Margin="10,0,0,0"
|
|
materialDesign:ToggleButtonAssist.OnContent="{materialDesign:PackIcon Kind=AirplaneMinus,
|
|
Size={StaticResource IconSize}}"
|
|
Background="Transparent"
|
|
Command="{Binding ToggleAircraftBindingCommand}"
|
|
IsChecked="{Binding ProfileData.IsAircraftBoundToProfile, Mode=OneWay}"
|
|
Style="{StaticResource MaterialDesignActionSecondaryToggleButton}"
|
|
ToolTip="Toggle aircraft binding to profile"
|
|
Visibility="{c:Binding 'FlightSimData.HasAircraftName and ProfileData.IsAllowedAddAircraftBinding'}">
|
|
<materialDesign:PackIcon
|
|
Width="{StaticResource IconSize}"
|
|
Height="{StaticResource IconSize}"
|
|
Kind="AirplanePlus" />
|
|
</ToggleButton>
|
|
</StackPanel>
|
|
</Expander.Header>
|
|
<StackPanel Margin="22,0,0,8">
|
|
<WrapPanel>
|
|
<ToggleButton IsChecked="{Binding ProfileData.ActiveProfile.ProfileSetting.PowerOnRequiredForColdStart, Mode=TwoWay}" Style="{StaticResource ToggleButton}" />
|
|
<TextBlock Style="{StaticResource TextBlockLabel}" ToolTip="During cold start, Pop Out Manager will first turn on power and avionics for the aircraft in order 
to pop out the instrumentation panels. After pop out is completed, Pop Out Manager will then 
turn off aircraft power and avionics to put the aircraft back to cold and dark state.">Power on is required to pop out panels on cold start (for G1000 based aircrafts ONLY if needed)</TextBlock>
|
|
</WrapPanel>
|
|
|
|
<WrapPanel Margin="0,8,0,0">
|
|
<ToggleButton
|
|
IsChecked="{Binding ProfileData.ActiveProfile.ProfileSetting.IncludeInGamePanels, Mode=TwoWay, NotifyOnTargetUpdated=True}"
|
|
IsEnabled="{c:Binding '!ProfileData.ActiveProfile.IsLocked',
|
|
Mode=OneWay}"
|
|
Style="{StaticResource ToggleButton}"
|
|
TargetUpdated="IncludeInGamePanel_TargetUpdated" />
|
|
<TextBlock Style="{StaticResource TxtBlockDisableWhenLocked}" ToolTip="Add in-game menu bar panels such as VFR Map, Checklist, ATC, etc. to profile to enable panel size and location management and touch support">Include in-game menu bar panels for pop out management and touch screen support</TextBlock>
|
|
</WrapPanel>
|
|
|
|
|
|
<StackPanel Margin="0,8,0,0" Orientation="Horizontal">
|
|
<WrapPanel>
|
|
<ToggleButton
|
|
IsChecked="{Binding ProfileData.ActiveProfile.ProfileSetting.HudBarConfig.IsEnabled, Mode=TwoWay, NotifyOnTargetUpdated=True}"
|
|
IsEnabled="{c:Binding '!ProfileData.ActiveProfile.IsLocked',
|
|
Mode=OneWay}"
|
|
Style="{StaticResource ToggleButton}"
|
|
TargetUpdated="AddHudBar_TargetUpdated" />
|
|
<TextBlock Style="{StaticResource TxtBlockDisableWhenLocked}" ToolTip="Add an HUD bar to the game">Add a HUD Bar</TextBlock>
|
|
<ComboBox
|
|
x:Name="ComboBoxHudBarType"
|
|
Width="130"
|
|
Margin="10,-4,0,0"
|
|
FontSize="14"
|
|
IsEnabled="{c:Binding '!ProfileData.ActiveProfile.IsLocked and ProfileData.ActiveProfile.ProfileSetting.HudBarConfig.IsEnabled',
|
|
Mode=OneWay}"
|
|
ItemsSource="{Binding HudBarTypes}"
|
|
SelectedValue="{Binding ProfileData.ActiveProfile.ProfileSetting.HudBarConfig.HudBarType, Mode=TwoWay, Converter={StaticResource StringToHudBarTypeConverter}}"
|
|
Style="{StaticResource CmbBoxDisableWhenLocked}" />
|
|
</WrapPanel>
|
|
|
|
</StackPanel>
|
|
</StackPanel>
|
|
</Expander>
|
|
</DockPanel>
|
|
<StackPanel Grid.Row="2">
|
|
<Separator Margin="0,-1,0,0" />
|
|
<WrapPanel Margin="24,8,0,4">
|
|
<TextBlock
|
|
Width="750"
|
|
Style="{StaticResource MaterialDesignBody1TextBlock}"
|
|
Text="Pop Out Panels" />
|
|
<ToggleButton
|
|
Width="{StaticResource ButtonSize}"
|
|
Height="{StaticResource ButtonSize}"
|
|
Margin="0,0,0,0"
|
|
materialDesign:ToggleButtonAssist.OnContent="{materialDesign:PackIcon Kind=CrosshairsGps,
|
|
Size={StaticResource IconSize}}"
|
|
Background="Transparent"
|
|
Command="{Binding ToggleEditPanelSourceCommand}"
|
|
IsChecked="{Binding ProfileData.ActiveProfile.IsEditingPanelSource, Mode=TwoWay}"
|
|
KeyboardNavigation.AcceptsReturn="False"
|
|
ToolTip="Toggle editing of panel source">
|
|
<materialDesign:PackIcon
|
|
Width="{StaticResource IconSize}"
|
|
Height="{StaticResource IconSize}"
|
|
Kind="Crosshairs" />
|
|
<ToggleButton.Style>
|
|
<Style BasedOn="{StaticResource MaterialDesignActionSecondaryToggleButton}" TargetType="ToggleButton">
|
|
<Style.Triggers>
|
|
<DataTrigger Binding="{Binding ProfileData.ActiveProfile.IsEditingPanelSource}" Value="True">
|
|
<Setter Property="Foreground" Value="LightGreen" />
|
|
</DataTrigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
</ToggleButton.Style>
|
|
</ToggleButton>
|
|
|
|
<Button
|
|
Width="{StaticResource ButtonSize}"
|
|
Height="{StaticResource ButtonSize}"
|
|
Margin="8,0,0,0"
|
|
Command="{Binding AddPanelCommand}"
|
|
KeyboardNavigation.AcceptsReturn="False"
|
|
Style="{StaticResource MaterialDesignIconForegroundButton}"
|
|
ToolTip="Add pop out panel">
|
|
<materialDesign:PackIcon
|
|
Width="{StaticResource IconSize}"
|
|
Height="{StaticResource IconSize}"
|
|
Kind="PlusThick" />
|
|
</Button>
|
|
<ToggleButton
|
|
Width="{StaticResource ButtonSize}"
|
|
Height="{StaticResource ButtonSize}"
|
|
Margin="8,0,0,0"
|
|
materialDesign:ToggleButtonAssist.OnContent="{materialDesign:PackIcon Kind=LockOutline,
|
|
Size={StaticResource IconSize}}"
|
|
Background="Transparent"
|
|
Command="{Binding ToggleLockProfileCommand}"
|
|
IsChecked="{Binding ProfileData.ActiveProfile.IsLocked, Mode=TwoWay}"
|
|
KeyboardNavigation.AcceptsReturn="False"
|
|
ToolTip="Lock and unlock pop out panel settings">
|
|
<materialDesign:PackIcon
|
|
Width="{StaticResource IconSize}"
|
|
Height="{StaticResource IconSize}"
|
|
Kind="UnlockedOutline" />
|
|
<ToggleButton.Style>
|
|
<Style BasedOn="{StaticResource MaterialDesignActionSecondaryToggleButton}" TargetType="ToggleButton">
|
|
<Style.Triggers>
|
|
<DataTrigger Binding="{Binding ProfileData.ActiveProfile.IsLocked}" Value="True">
|
|
<Setter Property="Foreground" Value="LightGreen" />
|
|
</DataTrigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
</ToggleButton.Style>
|
|
</ToggleButton>
|
|
</WrapPanel>
|
|
<local:PopOutPanelListEmpty Visibility="{c:Binding 'ProfileData.ActiveProfile.PanelConfigs.Count == 0'}" />
|
|
<local:PopOutPanelList Visibility="{c:Binding 'ProfileData.ActiveProfile.PanelConfigs.Count > 0'}" />
|
|
</StackPanel>
|
|
<StackPanel Grid.Row="3">
|
|
<Separator Margin="0,5,0,0" />
|
|
<Grid>
|
|
<Button
|
|
x:Name="BtnStartPopOut"
|
|
Width="Auto"
|
|
Margin="250,10,250,0"
|
|
Command="{Binding StartPopOutCommand}"
|
|
Content="Start Pop Out"
|
|
Foreground="White"
|
|
IsHitTestVisible="{c:Binding '!IsDisabledAppInput'}"
|
|
KeyboardNavigation.AcceptsReturn="False"
|
|
Style="{StaticResource MaterialDesignOutlinedButton}"
|
|
ToolTip="Start pop out process" />
|
|
<StackPanel>
|
|
<materialDesign:Snackbar
|
|
x:Name="SnackbarMessage"
|
|
HorizontalAlignment="Stretch"
|
|
Background="DimGray"
|
|
Foreground="White"
|
|
IsActive="{Binding ProfileData.ActiveProfile.IsEditingPanelSource}">
|
|
<materialDesign:SnackbarMessage>
|
|
<StackPanel
|
|
Width="800"
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
Orientation="Horizontal">
|
|
<TextBlock Margin="160,0,0,0" VerticalAlignment="Center">Please complete editing of source panel locations by clicking</TextBlock>
|
|
<materialDesign:PackIcon
|
|
Width="{StaticResource IconSize}"
|
|
Height="{StaticResource IconSize}"
|
|
Margin="5,0,5,0"
|
|
Foreground="LightGreen"
|
|
Kind="CrosshairsGps" />
|
|
<TextBlock VerticalAlignment="Center">above to enable Start Pop Out</TextBlock>
|
|
</StackPanel>
|
|
</materialDesign:SnackbarMessage>
|
|
</materialDesign:Snackbar>
|
|
</StackPanel>
|
|
<StackPanel>
|
|
<materialDesign:Snackbar
|
|
x:Name="SnackbarMessage2"
|
|
HorizontalAlignment="Stretch"
|
|
Background="DimGray"
|
|
Foreground="White"
|
|
IsActive="{Binding ProfileData.ActiveProfile.HasUnidentifiedPanelSource}">
|
|
<materialDesign:SnackbarMessage>
|
|
<StackPanel
|
|
Width="800"
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
Orientation="Horizontal">
|
|
<TextBlock Margin="250,0,0,0" VerticalAlignment="Center">Please identify all source panel locations to enable Start Pop Out</TextBlock>
|
|
</StackPanel>
|
|
</materialDesign:SnackbarMessage>
|
|
</materialDesign:Snackbar>
|
|
</StackPanel>
|
|
</Grid>
|
|
</StackPanel>
|
|
</Grid>
|
|
</materialDesign:Card>
|
|
</Grid>
|
|
</UserControl>
|