1
0
Fork 0
mirror of https://github.com/hawkeye-stan/msfs-popout-panel-manager.git synced 2024-12-26 22:32:01 +00:00

Version 4.1.0 beta

This commit is contained in:
hawkeye 2024-02-27 23:07:16 -05:00
parent 9d18b1fce4
commit e9fbe0effa
60 changed files with 41 additions and 4875 deletions

View file

@ -1,19 +0,0 @@
using MSFSPopoutPanelManager.DomainModel.Setting;
namespace MSFSPopoutPanelManager.DomainModel.DataFile
{
public class AppSetttingFile
{
public AppSetttingFile()
{
FileVersion = "4.0";
ApplicationSetting = new ApplicationSetting();
}
public string FileVersion { get; set; }
public ApplicationSetting ApplicationSetting { get; set; }
}
}

View file

@ -11,9 +11,9 @@
<PackageProjectUrl>https://github.com/hawkeye-stan/msfs-popout-panel-manager</PackageProjectUrl>
<RootNamespace>MSFSPopoutPanelManager.DomainModel</RootNamespace>
<Platforms>x64</Platforms>
<Version>4.0.4.1</Version>
<AssemblyVersion>4.0.4.1</AssemblyVersion>
<FileVersion>4.0.4.1</FileVersion>
<Version>4.1.0.1</Version>
<AssemblyVersion>4.1.0.1</AssemblyVersion>
<FileVersion>4.1.0.1</FileVersion>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<DebugType>Embedded</DebugType>
<Configurations>Debug;Release;Local</Configurations>

View file

@ -1,78 +0,0 @@
using MSFSPopoutPanelManager.DomainModel.Setting;
namespace MSFSPopoutPanelManager.DomainModel.Legacy
{
public class LegacyAppSetting
{
public string AutoUpdaterUrl { get; set; }
public int LastUsedProfileId { get; set; }
public bool MinimizeToTray { get; set; }
public bool AlwaysOnTop { get; set; }
public bool AutoClose { get; set; }
public bool UseAutoPanning { get; set; }
public bool MinimizeAfterPopOut { get; set; }
public string AutoPanningKeyBinding { get; set; }
public bool StartMinimized { get; set; }
public bool AutoPopOutPanels { get; set; }
public bool AutoDisableTrackIR { get; set; }
public int OnScreenMessageDuration { get; set; }
public bool UseLeftRightControlToPopOut { get; set; }
public bool IsEnabledTouchPanelServer { get; set; }
public bool AutoResizeMsfsGameWindow { get; set; }
public LegacyAfterPopOutCameraView AfterPopOutCameraView { get; set; }
public LegacyTouchScreenSettings TouchScreenSettings { get; set; }
public LegacyTouchPanelSettings TouchPanelSettings { get; set; }
}
public class LegacyAfterPopOutCameraView
{
public bool EnableReturnToCameraView { get; set; }
public AfterPopOutCameraViewType CameraView { get; set; }
public string CustomCameraKeyBinding { get; set; }
}
public class LegacyTouchScreenSettings
{
public int TouchDownUpDelay { get; set; }
public bool RefocusGameWindow { get; set; }
public int RefocusGameWindowDelay { get; set; }
public bool RealSimGearGTN750Gen1Override { get; set; }
}
public class LegacyTouchPanelSettings
{
public bool EnableTouchPanelIntegration { get; set; }
public bool AutoStart { get; set; }
public int DataRefreshInterval { get; set; }
public int MapRefreshInterval { get; set; }
public bool UseArduino { get; set; }
public bool EnableSound { get; set; }
}
}

View file

@ -1,84 +0,0 @@
using MSFSPopoutPanelManager.DomainModel.Profile;
using System.Collections.ObjectModel;
namespace MSFSPopoutPanelManager.DomainModel.Legacy
{
public class LegacyProfile
{
public int ProfileId { get; set; }
public string ProfileName { get; set; }
public ObservableCollection<string> BindingAircrafts { get; set; }
public ObservableCollection<LegacyPanelSourceCoordinate> PanelSourceCoordinates { get; set; }
public ObservableCollection<LegacyPanelConfig> PanelConfigs { get; set; }
public ObservableCollection<LegacyTouchPanelBinding> TouchPanelBindings { get; set; }
public bool IsLocked { get; set; }
public bool PowerOnRequiredForColdStart { get; set; }
public bool IncludeInGamePanels { get; set; }
public bool RealSimGearGTN750Gen1Override { get; set; }
public LegacyMsfsGameWindowConfig MsfsGameWindowConfig { get; set; }
}
public class LegacyPanelSourceCoordinate
{
public int PanelIndex { get; set; }
public int X { get; set; }
public int Y { get; set; }
}
public class LegacyPanelConfig
{
public int PanelIndex { get; set; }
public string PanelName { get; set; }
public PanelType PanelType { get; set; }
public int Top { get; set; }
public int Left { get; set; }
public int Width { get; set; }
public int Height { get; set; }
public bool AlwaysOnTop { get; set; }
public bool HideTitlebar { get; set; }
public bool FullScreen { get; set; }
public bool TouchEnabled { get; set; }
public bool DisableGameRefocus { get; set; }
}
public class LegacyTouchPanelBinding
{
public string PlaneId { get; set; }
public string PanelId { get; set; }
}
public class LegacyMsfsGameWindowConfig
{
public int Top { get; set; }
public int Left { get; set; }
public int Width { get; set; }
public int Height { get; set; }
}
}

View file

@ -14,7 +14,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
LICENSE = LICENSE
README.md = README.md
RELEASENOTES.md = RELEASENOTES.md
rollback.xml = rollback.xml
VERSION.md = VERSION.md
EndProjectSection
EndProject

View file

@ -70,7 +70,7 @@ namespace MSFSPopoutPanelManager.MainApp.AppUserControl
var fe = e.OriginalSource as FrameworkElement;
if (fe?.Name != "HeaderSiteContent" && fe?.Name != "BtnShowSourcePanel")
if (fe?.Name != "HeaderSiteContent" && fe?.Name != "BtnShowSourcePanel" && fe?.Name != "BtnIdentifySourcePanel")
return;
foreach (var panelConfig in _viewModel.ActiveProfile.PanelConfigs)

View file

@ -1,165 +0,0 @@
<Window
x:Class="MSFSPopoutPanelManager.MainApp.AppWindow"
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: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"
Title="MSFS POP OUT PANEL MANAGER"
Width="1000"
Height="600"
AllowsTransparency="True"
Background="Transparent"
Icon="logo.ico"
ResizeMode="NoResize"
Style="{StaticResource MaterialDesignWindow}"
WindowState="{Binding InitialWindowState, Mode=OneWay}"
WindowStyle="None"
mc:Ignorable="d">
<Window.Resources>
<system:Double x:Key="IconSize">28</system:Double>
</Window.Resources>
<Border
Margin="0"
Background="{StaticResource MaterialDesignDarkBackground}"
CornerRadius="15">
<Grid d:DataContext="{d:DesignInstance viewmodel:ApplicationViewModel}">
<local:TrayIcon x:Name="SystemTrayIcon" />
<materialDesign:DialogHost
Background="Transparent"
DialogTheme="Inherit"
Identifier="RootDialog">
<materialDesign:DrawerHost
OpenMode="Standard"
OverlayBackground="Transparent"
RightDrawerCornerRadius="15">
<materialDesign:DrawerHost.RightDrawerContent>
<DockPanel>
<Button
Width="{StaticResource IconSize}"
Height="{StaticResource IconSize}"
Margin="8,8,36,0"
HorizontalAlignment="Right"
Command="{x:Static materialDesign:DrawerHost.CloseDrawerCommand}"
DockPanel.Dock="Top"
Style="{StaticResource MaterialDesignIconButton}">
<materialDesign:PackIcon
Width="{StaticResource IconSize}"
Height="{StaticResource IconSize}"
Kind="ArrowRight" />
</Button>
<StackPanel Name="panelDrawers" />
</DockPanel>
</materialDesign:DrawerHost.RightDrawerContent>
<DockPanel>
<materialDesign:ColorZone
Padding="12,4,12,4"
materialDesign:ElevationAssist.Elevation="Dp4"
CornerRadius="15,15,0,0"
DockPanel.Dock="Top"
Mode="PrimaryDark">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="200" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="200" />
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="0" Margin="0,0,0,0">
<Button
Margin="0"
Padding="0"
HorizontalAlignment="Left"
IsHitTestVisible="false">
<Button.Style>
<Style BasedOn="{StaticResource MaterialDesignFlatButton}" TargetType="Button">
<Style.Triggers>
<DataTrigger Binding="{Binding FlightSimData.IsSimConnectDataReceived}" Value="True">
<Setter Property="Foreground" Value="LightGreen" />
<Setter Property="Content" Value="{materialDesign:PackIcon Kind=AccessPointNetwork, Size={StaticResource IconSize}}" />
</DataTrigger>
<DataTrigger Binding="{Binding FlightSimData.IsSimConnectDataReceived}" Value="False">
<Setter Property="Foreground" Value="Red" />
<Setter Property="Content" Value="{materialDesign:PackIcon Kind=AccessPointNetworkOff, Size={StaticResource IconSize}}" />
</DataTrigger>
</Style.Triggers>
</Style>
</Button.Style>
</Button>
</StackPanel>
<StackPanel Grid.Column="1" Width="Auto">
<TextBlock
Margin="0,4,0,0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Foreground="White"
Style="{StaticResource MaterialDesignHeadline6TextBlock}"
Text="MSFS POP OUT PANEL MANAGER" />
</StackPanel>
<StackPanel
Grid.Column="2"
Margin="0,0,0,0"
HorizontalAlignment="Right"
Orientation="Horizontal">
<Button
Width="{StaticResource IconSize}"
Height="{StaticResource IconSize}"
Margin="0,0,0,0"
Click="SettingsButton_Click"
Command="{x:Static materialDesign:DrawerHost.OpenDrawerCommand}"
Foreground="White"
Style="{StaticResource MaterialDesignIconButton}"
ToolTip="Preferences">
<materialDesign:PackIcon Kind="Cog" />
</Button>
<Button
Width="{StaticResource IconSize}"
Height="{StaticResource IconSize}"
Margin="10,0,0,0"
Click="HelpButton_Click"
Command="{x:Static materialDesign:DrawerHost.OpenDrawerCommand}"
Foreground="White"
Style="{StaticResource MaterialDesignIconButton}"
ToolTip="Help">
<materialDesign:PackIcon Kind="Help" />
</Button>
<Button
x:Name="BtnMinimize"
Width="{StaticResource IconSize}"
Height="{StaticResource IconSize}"
Margin="10,0,0,0"
Click="BtnMinimize_Click"
Foreground="White"
Style="{StaticResource MaterialDesignIconButton}"
ToolTip="Minimize application">
<materialDesign:PackIcon Kind="WindowMinimize" />
</Button>
<Button
x:Name="BtnClose"
Width="{StaticResource IconSize}"
Height="{StaticResource IconSize}"
Margin="10,0,0,0"
Click="BtnClose_Click"
Foreground="White"
Style="{StaticResource MaterialDesignIconButton}"
ToolTip="Close application">
<materialDesign:PackIcon Kind="Close" />
</Button>
</StackPanel>
</Grid>
</materialDesign:ColorZone>
<local:ProfileCardList
x:Name="ProfileCardList"
Width="1024"
Margin="0,8,0,8"
HorizontalAlignment="Center"
VerticalAlignment="Center"
DockPanel.Dock="Top" />
</DockPanel>
</materialDesign:DrawerHost>
</materialDesign:DialogHost>
</Grid>
</Border>
</Window>

View file

@ -1,96 +0,0 @@
using Microsoft.Extensions.DependencyInjection;
using MSFSPopoutPanelManager.DomainModel.Profile;
using MSFSPopoutPanelManager.MainApp.ViewModel;
using MSFSPopoutPanelManager.WindowsAgent;
using Prism.Commands;
using System;
using System.Windows;
using System.Windows.Interop;
namespace MSFSPopoutPanelManager.MainApp
{
public partial class AppWindow : Window
{
private ApplicationViewModel _viewModel;
// This command has to be here since it doesn't work in view model, window StateChanged never gets fire
public DelegateCommand RestoreWindowCommand => new DelegateCommand(() => { this.WindowState = WindowState.Normal; }, () => { return true; });
public AppWindow()
{
_viewModel = App.AppHost.Services.GetRequiredService<ApplicationViewModel>();
InitializeComponent();
Loaded += AppWindow_Loaded;
Closing += AppWindow_Closing;
StateChanged += AppWindow_StateChanged;
WindowActionManager.OnPopOutManagerAlwaysOnTopChanged += (sender, e) => { this.Topmost = e; };
this.MouseLeftButtonDown += (sender, e) => DragMove();
}
private void AppWindow_Loaded(object sender, RoutedEventArgs e)
{
_viewModel.ApplicationHandle = new WindowInteropHelper(Window.GetWindow(this)).Handle;
_viewModel.ApplicationWindow = Application.Current.MainWindow;
_viewModel.Initialize();
this.DataContext = _viewModel;
// Try to fix always on to click through. This won't work for app's title bar since mouseEnter won't be triggered.
// This is super tricky to trick POPM process is MSFS process to avoid Windows OS focus stealing
this.MouseEnter += (sender, e) =>WindowActionManager.SetWindowFocus(WindowProcessManager.GetApplicationProcess().Handle);
}
private void AppWindow_Closing(object? sender, System.ComponentModel.CancelEventArgs e)
{
e.Cancel = true;
_viewModel.WindowClosing();
}
private void AppWindow_StateChanged(object? sender, EventArgs e)
{
switch (this.WindowState)
{
case WindowState.Maximized:
this.ShowInTaskbar = true;
break;
case WindowState.Minimized:
if (_viewModel.AppSettingData.ApplicationSetting.GeneralSetting.MinimizeToTray)
{
SystemTrayIcon.Tray.Visibility = Visibility.Visible;
this.ShowInTaskbar = false;
}
break;
case WindowState.Normal:
SystemTrayIcon.Tray.Visibility = Visibility.Hidden;
this.ShowInTaskbar = true;
// Fix always on top status once app is minimize and then restore
if (_viewModel.AppSettingData.ApplicationSetting.GeneralSetting.AlwaysOnTop)
WindowActionManager.ApplyAlwaysOnTop(_viewModel.ApplicationHandle, PanelType.PopOutManager, true);
break;
}
}
private void SettingsButton_Click(object sender, RoutedEventArgs e)
{
this.panelDrawers.Children.Clear();
this.panelDrawers.Children.Add(new PreferenceDrawer());
}
private void HelpButton_Click(object sender, RoutedEventArgs e)
{
this.panelDrawers.Children.Clear();
this.panelDrawers.Children.Add(new HelpDrawer());
}
private void BtnMinimize_Click(object sender, RoutedEventArgs e)
{
this.WindowState = WindowState.Minimized;
}
private void BtnClose_Click(object sender, RoutedEventArgs e)
{
this.Close();
}
}
}

View file

@ -1,284 +0,0 @@
<Window
x:Class="MSFSPopoutPanelManager.MainApp.HudBar"
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: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"
Title="HudBar"
Width="1920"
MinWidth="1920"
MinHeight="40"
MaxHeight="40"
ResizeMode="NoResize"
WindowStyle="None"
mc:Ignorable="d">
<Window.Resources>
<system:Double x:Key="IconSize">22</system:Double>
<system:Double x:Key="ButtonSize">28</system:Double>
<Style
x:Key="TxtBoxTitle"
BasedOn="{StaticResource MaterialDesignBody1TextBlock}"
TargetType="{x:Type TextBlock}">
<Setter Property="Margin" Value="10,5,10,5" />
<Setter Property="Foreground" Value="White" />
<Style.Triggers>
<DataTrigger Binding="{Binding FlightSimData.IsSimConnectActive}" Value="False">
<Setter Property="Foreground" Value="Red" />
</DataTrigger>
</Style.Triggers>
</Style>
<Style
x:Key="TxtBoxLabel"
BasedOn="{StaticResource MaterialDesignBody1TextBlock}"
TargetType="TextBlock">
<Setter Property="Margin" Value="10,5,10,5" />
<Setter Property="Foreground" Value="White" />
</Style>
<Style
x:Key="TxtBoxData"
BasedOn="{StaticResource MaterialDesignBody1TextBlock}"
TargetType="TextBlock">
<Setter Property="Margin" Value="0,5,10,5" />
<Setter Property="Foreground" Value="Lime" />
<Setter Property="HorizontalAlignment" Value="Right" />
</Style>
<Style
x:Key="VerticalSeparator"
BasedOn="{StaticResource {x:Type Separator}}"
TargetType="Separator">
<Setter Property="Foreground" Value="White" />
<Setter Property="Margin" Value="6,0,6,0" />
<Setter Property="LayoutTransform">
<Setter.Value>
<TransformGroup>
<TransformGroup.Children>
<TransformCollection>
<RotateTransform Angle="90" />
</TransformCollection>
</TransformGroup.Children>
</TransformGroup>
</Setter.Value>
</Setter>
</Style>
</Window.Resources>
<materialDesign:ColorZone Height="40" Mode="Dark">
<Grid d:DataContext="{d:DesignInstance viewmodel:HudBarViewModel}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="130" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="3*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="3*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="3*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="2*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="3*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="3*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="6*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="4*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="100" />
</Grid.ColumnDefinitions>
<TextBlock
Grid.Column="0"
Margin="10,5,0,0"
Style="{StaticResource TxtBoxTitle}"
Text="{Binding HudBarTypeText}" />
<DockPanel Grid.Column="1">
<Separator Style="{StaticResource VerticalSeparator}" />
</DockPanel>
<DockPanel Grid.Column="2">
<TextBlock Style="{StaticResource TxtBoxLabel}">Elevator Trim:</TextBlock>
<TextBlock Style="{StaticResource TxtBoxData}" Text="{Binding FlightSimData.HudBarData.ElevatorTrimFormatted}" />
</DockPanel>
<DockPanel Grid.Column="3">
<Separator Style="{StaticResource VerticalSeparator}" />
</DockPanel>
<DockPanel Grid.Column="4">
<TextBlock Style="{StaticResource TxtBoxLabel}">Aileron Trim:</TextBlock>
<TextBlock Style="{StaticResource TxtBoxData}" Text="{Binding FlightSimData.HudBarData.AileronTrimFormatted}" />
</DockPanel>
<DockPanel Grid.Column="5">
<Separator Style="{StaticResource VerticalSeparator}" />
</DockPanel>
<DockPanel Grid.Column="6">
<TextBlock Style="{StaticResource TxtBoxLabel}">Rudder Trim:</TextBlock>
<TextBlock Style="{StaticResource TxtBoxData}" Text="{Binding FlightSimData.HudBarData.RudderTrimFormatted}" />
</DockPanel>
<DockPanel Grid.Column="7">
<Separator Style="{StaticResource VerticalSeparator}" />
</DockPanel>
<DockPanel Grid.Column="8">
<TextBlock Style="{StaticResource TxtBoxLabel}">Flaps:</TextBlock>
<TextBlock Style="{StaticResource TxtBoxData}" Text="{Binding FlightSimData.HudBarData.FlapFormatted}" />
</DockPanel>
<DockPanel Grid.Column="9">
<Separator Style="{StaticResource VerticalSeparator}" />
</DockPanel>
<DockPanel Grid.Column="10">
<TextBlock Style="{StaticResource TxtBoxLabel}">Brake:</TextBlock>
<TextBlock Text="{Binding FlightSimData.HudBarData.ParkingBrakeFormatted}">
<TextBlock.Style>
<Style BasedOn="{StaticResource TxtBoxData}" TargetType="TextBlock">
<Style.Triggers>
<DataTrigger Binding="{Binding FlightSimData.HudBarData.ParkingBrakeFormatted}" Value="Disengaged">
<Setter Property="TextBlock.Foreground" Value="DimGray" />
</DataTrigger>
<DataTrigger Binding="{Binding FlightSimData.HudBarData.ParkingBrakeFormatted}" Value="Engaged">
<Setter Property="TextBlock.Foreground" Value="Red" />
</DataTrigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
</DockPanel>
<DockPanel Grid.Column="11">
<Separator Style="{StaticResource VerticalSeparator}" />
</DockPanel>
<DockPanel Grid.Column="12">
<TextBlock Style="{StaticResource TxtBoxLabel}">Gear:</TextBlock>
<StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
<TextBlock Text="L">
<TextBlock.Style>
<Style BasedOn="{StaticResource TxtBoxData}" TargetType="TextBlock">
<Setter Property="Margin" Value="10,5,10,0" />
<Style.Triggers>
<DataTrigger Binding="{Binding FlightSimData.HudBarData.GearLeftFormatted}" Value="DOWN">
<Setter Property="TextBlock.Foreground" Value="Lime" />
</DataTrigger>
<DataTrigger Binding="{Binding FlightSimData.HudBarData.GearLeftFormatted}" Value="UP">
<Setter Property="TextBlock.Foreground" Value="DimGray" />
</DataTrigger>
<DataTrigger Binding="{Binding FlightSimData.HudBarData.GearLeftFormatted}" Value="MOVING">
<Setter Property="TextBlock.Foreground" Value="Red" />
</DataTrigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
<TextBlock Text="C">
<TextBlock.Style>
<Style BasedOn="{StaticResource TxtBoxData}" TargetType="TextBlock">
<Setter Property="Margin" Value="10,5,10,0" />
<Style.Triggers>
<DataTrigger Binding="{Binding FlightSimData.HudBarData.GearCenterFormatted}" Value="DOWN">
<Setter Property="TextBlock.Foreground" Value="Lime" />
</DataTrigger>
<DataTrigger Binding="{Binding FlightSimData.HudBarData.GearCenterFormatted}" Value="UP">
<Setter Property="TextBlock.Foreground" Value="DimGray" />
</DataTrigger>
<DataTrigger Binding="{Binding FlightSimData.HudBarData.GearCenterFormatted}" Value="MOVING">
<Setter Property="TextBlock.Foreground" Value="Red" />
</DataTrigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
<TextBlock Text="R">
<TextBlock.Style>
<Style BasedOn="{StaticResource TxtBoxData}" TargetType="TextBlock">
<Setter Property="Margin" Value="10,5,10,0" />
<Style.Triggers>
<DataTrigger Binding="{Binding FlightSimData.HudBarData.GearRightFormatted}" Value="DOWN">
<Setter Property="TextBlock.Foreground" Value="Lime" />
</DataTrigger>
<DataTrigger Binding="{Binding FlightSimData.HudBarData.GearRightFormatted}" Value="UP">
<Setter Property="TextBlock.Foreground" Value="DimGray" />
</DataTrigger>
<DataTrigger Binding="{Binding FlightSimData.HudBarData.GearRightFormatted}" Value="MOVING">
<Setter Property="TextBlock.Foreground" Value="Red" />
</DataTrigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
</StackPanel>
</DockPanel>
<DockPanel Grid.Column="13">
<Separator Style="{StaticResource VerticalSeparator}" />
</DockPanel>
<DockPanel Grid.Column="14">
<TextBlock Style="{StaticResource TxtBoxLabel}">Timer:</TextBlock>
<StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
<TextBlock Style="{StaticResource TxtBoxData}" Text="{Binding Timer, StringFormat={}{0:HH:mm:ss}}" />
<Button
Width="80"
Height="28"
Margin="10,0,0,0"
Command="{Binding StartStopTimerCommand}"
Style="{StaticResource MaterialDesignOutlinedButton}">
<TextBlock Foreground="White" Text="{c:Binding 'IsTimerStarted ? &quot;STOP&quot; : &quot;START&quot;'}" />
</Button>
<Button
Width="80"
Height="28"
Margin="15,0,10,0"
Command="{Binding ResetTimerCommand}"
Style="{StaticResource MaterialDesignOutlinedButton}">
<TextBlock Foreground="White" Text="RESET" />
</Button>
</StackPanel>
</DockPanel>
<DockPanel Grid.Column="15">
<Separator Style="{StaticResource VerticalSeparator}" />
</DockPanel>
<DockPanel Grid.Column="16">
<TextBlock Style="{StaticResource TxtBoxLabel}">Sim Rate:</TextBlock>
<StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
<TextBlock
Margin="0,5,5,0"
Style="{StaticResource TxtBoxData}"
Text="{Binding FlightSimData.HudBarData.SimRate}" />
<TextBlock
Margin="0,5,20,0"
Style="{StaticResource TxtBoxData}"
Text="X" />
<Button
Width="{StaticResource ButtonSize}"
Height="{StaticResource ButtonSize}"
Margin="0,0,15,0"
Command="{Binding IncreaseSimRateCommand}"
Style="{StaticResource MaterialDesignFloatingActionButton}">
<materialDesign:PackIcon
Width="{StaticResource IconSize}"
Height="{StaticResource IconSize}"
Kind="ArrowUp" />
</Button>
<Button
Width="{StaticResource ButtonSize}"
Height="{StaticResource ButtonSize}"
Margin="0,0,10,0"
Command="{Binding DecreaseSimRateCommand}"
Style="{StaticResource MaterialDesignFloatingActionButton}">
<materialDesign:PackIcon
Width="{StaticResource IconSize}"
Height="{StaticResource IconSize}"
Kind="ArrowDown" />
</Button>
</StackPanel>
</DockPanel>
<DockPanel Grid.Column="17">
<Separator Style="{StaticResource VerticalSeparator}" />
</DockPanel>
<DockPanel Grid.Column="18">
<Button
x:Name="BtnClose"
Width="80"
Height="28"
Click="BtnClose_Click"
Style="{StaticResource MaterialDesignOutlinedButton}">
<TextBlock Foreground="White" Text="Close" />
</Button>
</DockPanel>
</Grid>
</materialDesign:ColorZone>
</Window>

View file

@ -1,49 +0,0 @@
using Microsoft.Extensions.DependencyInjection;
using MSFSPopoutPanelManager.MainApp.ViewModel;
using System;
using System.Windows;
using System.Windows.Input;
using System.Windows.Interop;
namespace MSFSPopoutPanelManager.MainApp
{
public partial class HudBar : Window
{
private HudBarViewModel _viewModel;
public HudBar(Guid panelId)
{
_viewModel = App.AppHost.Services.GetRequiredService<HudBarViewModel>();
_viewModel.PanelId = panelId;
InitializeComponent();
Loaded += (sender, e) =>
{
DataContext = _viewModel;
_viewModel.PanelConfig.PanelHandle = new WindowInteropHelper(Window.GetWindow(this)).Handle;
_viewModel.PanelConfig.Width = Convert.ToInt32(Width);
_viewModel.PanelConfig.Height = Convert.ToInt32(Height);
};
this.MouseLeftButtonDown += HudBar_MouseLeftButtonDown;
this.Topmost = true;
Closing += HudBar_Closing;
}
private void HudBar_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
_viewModel.CloseCommand.Execute(null);
}
private void HudBar_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
DragMove();
}
private void BtnClose_Click(object sender, RoutedEventArgs e)
{
this.Close();
}
}
}

View file

@ -14,9 +14,9 @@
<RootNamespace>MSFSPopoutPanelManager.MainApp</RootNamespace>
<ApplicationIcon>logo.ico</ApplicationIcon>
<Platforms>x64</Platforms>
<Version>4.0.4.1</Version>
<AssemblyVersion>4.0.4.1</AssemblyVersion>
<FileVersion>4.0.4.1</FileVersion>
<Version>4.1.0.1</Version>
<AssemblyVersion>4.1.0.1</AssemblyVersion>
<FileVersion>4.1.0.1</FileVersion>
<DebugType>embedded</DebugType>
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
<!-- Publishing options -->

View file

@ -1,64 +0,0 @@
<Window
x:Class="MSFSPopoutPanelManager.MainApp.MessageWindow"
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: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"
Title="MSFS Pop Out Panel Manager"
Width="Auto"
Height="Auto"
AllowsTransparency="True"
ResizeMode="NoResize"
ShowInTaskbar="False"
SizeToContent="WidthAndHeight"
Topmost="True"
WindowStyle="None"
mc:Ignorable="d">
<Window.Resources>
<system:Double x:Key="IconSize">22</system:Double>
<system:Double x:Key="ButtonSize">28</system:Double>
<Style
x:Key="Label"
BasedOn="{StaticResource MaterialDesignBody1TextBlock}"
TargetType="TextBlock">
<Setter Property="Foreground" Value="White" />
</Style>
</Window.Resources>
<materialDesign:ColorZone
Width="Auto"
Height="Auto"
Mode="Dark">
<DockPanel
Width="{Binding WindowWidth}"
Height="{Binding WindowHeight}"
d:DataContext="{d:DesignInstance viewmodel:MessageWindowViewModel}">
<WrapPanel
Height="30"
Background="SlateGray"
DockPanel.Dock="Top">
<TextBlock
Padding="10,5,10,5"
HorizontalAlignment="Stretch"
Style="{StaticResource MaterialDesignBody1TextBlock}">
MSFS POP OUT PANEL MANAGER
</TextBlock>
</WrapPanel>
<WrapPanel Margin="20,5,20,10">
<ScrollViewer
x:Name="ScrollViewerMessage"
Height="Auto"
DockPanel.Dock="Bottom"
HorizontalScrollBarVisibility="Hidden"
VerticalScrollBarVisibility="Hidden">
<TextBlock
x:Name="TextBlockMessage"
LineHeight="18"
LineStackingStrategy="BlockLineHeight" />
</ScrollViewer>
</WrapPanel>
</DockPanel>
</materialDesign:ColorZone>
</Window>

View file

@ -1,72 +0,0 @@
using Microsoft.Extensions.DependencyInjection;
using MSFSPopoutPanelManager.MainApp.ViewModel;
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Interop;
namespace MSFSPopoutPanelManager.MainApp
{
public partial class MessageWindow : Window
{
private MessageWindowViewModel _viewModel;
public MessageWindow()
{
_viewModel = App.AppHost.Services.GetRequiredService<MessageWindowViewModel>();
InitializeComponent();
Loaded += (sender, e) =>
{
DataContext = _viewModel;
_viewModel.Handle = new WindowInteropHelper(Window.GetWindow(this)).Handle;
// Set window binding, needs to be in code after window loaded
Binding visibleBinding = new Binding("IsVisible");
visibleBinding.Source = _viewModel;
visibleBinding.Converter = new BooleanToVisibilityConverter();
BindingOperations.SetBinding(this, Window.VisibilityProperty, visibleBinding);
// Set window click through
WindowsServices.SetWindowExTransparent(_viewModel.Handle);
_viewModel.OnMessageUpdated += _viewModel_OnMessageUpdated;
};
}
private void _viewModel_OnMessageUpdated(object sender, List<Run> e)
{
if (e == null)
return;
TextBlockMessage.Inlines.Clear();
foreach (var run in e)
TextBlockMessage.Inlines.Add(run);
ScrollViewerMessage.ScrollToEnd();
}
}
public static class WindowsServices
{
const int WS_EX_TRANSPARENT = 0x00000020;
const int GWL_EXSTYLE = (-20);
[DllImport("user32.dll")]
static extern int GetWindowLong(IntPtr hwnd, int index);
[DllImport("user32.dll")]
static extern int SetWindowLong(IntPtr hwnd, int index, int newStyle);
public static void SetWindowExTransparent(IntPtr hwnd)
{
var extendedStyle = GetWindowLong(hwnd, GWL_EXSTYLE);
SetWindowLong(hwnd, GWL_EXSTYLE, extendedStyle | WS_EX_TRANSPARENT);
}
}
}

View file

@ -1,70 +0,0 @@
<Window
x:Class="MSFSPopoutPanelManager.MainApp.PanelCoorOverlay"
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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Title="PanelCoorOverlay"
Width="30"
Height="30"
AllowsTransparency="True"
Background="#01F0F0FF"
Loaded="Window_Loaded"
MouseMove="Window_MouseMove"
ResizeMode="NoResize"
SizeToContent="WidthAndHeight"
WindowStyle="None"
mc:Ignorable="d">
<Canvas
Width="30"
Height="30"
PreviewMouseDown="Canvas_PreviewMouseDown"
ToolTip="{Binding Panel.PanelName}">
<Grid>
<Ellipse
x:Name="OverlayCircle"
Canvas.Left="1"
Canvas.Top="1"
Width="28"
Height="28"
Fill="Transparent"
StrokeThickness="6" />
<Ellipse
x:Name="OverlayBlinkingCircle"
Canvas.Left="0"
Canvas.Top="0"
Width="30"
Height="30"
Fill="Transparent"
Stroke="Black"
StrokeThickness="7"
Visibility="{c:Binding Panel.IsShownPanelSource}">
<Ellipse.Triggers>
<EventTrigger RoutedEvent="Ellipse.Loaded">
<BeginStoryboard>
<Storyboard>
<DoubleAnimation
AutoReverse="True"
RepeatBehavior="Forever"
Storyboard.TargetProperty="Opacity"
From="0"
To="1"
Duration="0:0:0.4" />
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Ellipse.Triggers>
</Ellipse>
<Ellipse
x:Name="OverlayCircleBorder"
Canvas.Left="0"
Canvas.Top="0"
Width="30"
Height="30"
Fill="Transparent"
Opacity="0.5"
Stroke="White" />
</Grid>
</Canvas>
</Window>

View file

@ -1,111 +0,0 @@
using Microsoft.Extensions.DependencyInjection;
using MSFSPopoutPanelManager.DomainModel.Profile;
using MSFSPopoutPanelManager.MainApp.ViewModel;
using MSFSPopoutPanelManager.WindowsAgent;
using System;
using System.Windows;
using System.Windows.Interop;
using System.Windows.Media;
namespace MSFSPopoutPanelManager.MainApp
{
public partial class PanelCoorOverlay : Window
{
private PanelCoorOverlayViewModel _viewModel;
private const int WINDOW_ADJUSTMENT = 20; // half of window height with shadow adjustment
private int _xCoor;
private int _yCoor;
public bool IsEditingPanelLocation { get; set; }
public Guid PanelId { get; set; }
public IntPtr WindowHandle { get; set; }
public bool IsAllowedEdit { get; set; }
public event EventHandler<System.Drawing.Point> WindowLocationChanged;
public PanelCoorOverlay(Guid id, bool isAllowedEdit)
{
_viewModel = App.AppHost.Services.GetRequiredService<PanelCoorOverlayViewModel>();
_viewModel.SetPanelId(id);
PanelId = id;
IsAllowedEdit = isAllowedEdit;
InitializeComponent();
Loaded += PanelCoorOverlay_Loaded;
OverlayCircle.Stroke = new SolidColorBrush((Color)ColorConverter.ConvertFromString(_viewModel.Panel.PanelSource.Color));
if (!_viewModel.ProfileData.ActiveProfile.IsEditingPanelSource)
OverlayBlinkingCircle.Visibility = Visibility.Collapsed;
IsEditingPanelLocation = false;
this.Topmost = true;
this.Left = 0;
this.Top = 0;
this.MouseUp += PanelCoorOverlay_MouseUp; // detect location change when user release mouse button when dragging the overlay window
this.Background = isAllowedEdit ? new SolidColorBrush(Color.FromArgb(1, 240, 240, 255)) : new SolidColorBrush(System.Windows.Media.Colors.Transparent);
}
private void PanelCoorOverlay_Loaded(object sender, RoutedEventArgs e)
{
this.DataContext = _viewModel;
}
private void PanelCoorOverlay_MouseUp(object sender, System.Windows.Input.MouseButtonEventArgs e)
{
if (!IsAllowedEdit)
return;
if (this.Top is double.NaN || this.Left is double.NaN)
return;
// Fixed broken window left/top coordinate for DPI Awareness Per Monitor
var handle = new WindowInteropHelper(this).Handle;
var rect = WindowActionManager.GetWindowRectangle(handle);
WindowLocationChanged?.Invoke(this, new System.Drawing.Point(rect.X + WINDOW_ADJUSTMENT, rect.Y + WINDOW_ADJUSTMENT));
if (_viewModel.Panel != null)
_viewModel.Panel.IsSelectedPanelSource = false;
}
public void SetWindowCoor(int x, int y)
{
_xCoor = x;
_yCoor = y;
}
private void Window_MouseMove(object sender, System.Windows.Input.MouseEventArgs e)
{
if (!IsAllowedEdit)
return;
if (IsEditingPanelLocation && e.LeftButton == System.Windows.Input.MouseButtonState.Pressed)
this.DragMove();
}
private void Window_Loaded(object sender, RoutedEventArgs e)
{
// Fixed broken window left/top coordinate for DPI Awareness Per Monitor
var handle = new WindowInteropHelper(this).Handle;
WindowActionManager.MoveWindow(handle, _xCoor - WINDOW_ADJUSTMENT, _yCoor - WINDOW_ADJUSTMENT, Convert.ToInt32(this.Width), Convert.ToInt32(this.Height));
WindowActionManager.ApplyAlwaysOnTop(handle, PanelType.PanelSourceWindow, true);
}
private void Canvas_PreviewMouseDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
{
if (!IsAllowedEdit)
return;
if (e.LeftButton == System.Windows.Input.MouseButtonState.Pressed && _viewModel.Panel != null)
_viewModel.Panel.IsSelectedPanelSource = true;
}
}
}

View file

@ -4,7 +4,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project>
<PropertyGroup>
<Configuration>Debug</Configuration>
<Configuration>Release</Configuration>
<Platform>x64</Platform>
<PublishDir>..\..\..\publish\master</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>

View file

@ -1,33 +0,0 @@
using System;
using System.Globalization;
using System.Windows.Controls;
using System.Windows.Data;
namespace MSFSPopoutPanelManager.MainApp
{
public class ExpanderRotateAngleConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
double factor = 1.0;
if (parameter is { } parameterValue)
{
if (!double.TryParse(parameterValue.ToString(), out factor))
{
factor = 1.0;
}
}
return value switch
{
ExpandDirection.Left => 90 * factor,
ExpandDirection.Right => -90 * factor,
_ => 0
};
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}

View file

@ -1,92 +0,0 @@
<UserControl
x:Class="MSFSPopoutPanelManager.MainApp.AddProfileDialog"
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:local="clr-namespace:MSFSPopoutPanelManager.MainApp"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:viewmodel="clr-namespace:MSFSPopoutPanelManager.MainApp.ViewModel"
xmlns:wpf="clr-namespace:MaterialDesignThemes.Wpf;assembly=MaterialDesignThemes.Wpf"
Width="400"
Height="210"
DataContext="{Binding RelativeSource={RelativeSource Self}, Path=ViewModel}"
mc:Ignorable="d">
<UserControl.Resources>
<local:InverseBooleanOrConverter x:Key="InverseBooleanOrConverter" />
</UserControl.Resources>
<StackPanel>
<materialDesign:ColorZone
Height="30"
materialDesign:ElevationAssist.Elevation="Dp4"
Mode="PrimaryDark">
<StackPanel
Grid.Row="0"
Margin="24,0,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Center">
<TextBlock Text="Add Profile" />
</StackPanel>
</materialDesign:ColorZone>
<StackPanel
Height="84"
Margin="24,12,24,16"
HorizontalAlignment="Stretch"
FocusManager.FocusedElement="{Binding ElementName=TxtBoxName}">
<ComboBox
materialDesign:HintAssist.FloatingScale="0.75"
materialDesign:HintAssist.Hint="Copy From Profile"
DisplayMemberPath="Name"
ItemsSource="{Binding ProfileData.Profiles}"
MaxDropDownHeight="280"
SelectedValue="{Binding CopiedProfile, Mode=TwoWay}"
Style="{StaticResource MaterialDesignFloatingHintComboBox}" />
<TextBox
x:Name="TxtBoxName"
Margin="0,8,0,0"
VerticalAlignment="Center"
materialDesign:HintAssist.FloatingScale="0.75"
materialDesign:HintAssist.Hint="Profile Name"
Style="{StaticResource MaterialDesignFloatingHintTextBox}">
<Binding
Mode="TwoWay"
Path="Profile.Name"
UpdateSourceTrigger="PropertyChanged"
ValidatesOnDataErrors="True">
<Binding.ValidationRules>
<viewmodel:PostiveValidationRule />
</Binding.ValidationRules>
</Binding>
</TextBox>
</StackPanel>
<StackPanel
Height="50"
Margin="24,12,24,0"
HorizontalAlignment="Right"
Orientation="Horizontal">
<Button
x:Name="BtnAccept"
Command="{x:Static wpf:DialogHost.CloseDialogCommand}"
CommandParameter="ADD"
IsDefault="True"
Style="{StaticResource MaterialDesignOutlinedButton}">
ACCEPT
<Button.IsEnabled>
<MultiBinding Converter="{StaticResource InverseBooleanOrConverter}" Mode="TwoWay">
<Binding ElementName="TxtBoxName" Path="(Validation.HasError)" />
<Binding Path="Profile.Name.Length" />
</MultiBinding>
</Button.IsEnabled>
</Button>
<Button
x:Name="BtnCancel"
Margin="12,0,0,0"
Command="{x:Static wpf:DialogHost.CloseDialogCommand}"
CommandParameter="CANCEL"
IsCancel="True"
Style="{StaticResource MaterialDesignOutlinedButton}">
CANCEL
</Button>
</StackPanel>
</StackPanel>
</UserControl>

View file

@ -1,26 +0,0 @@
using MaterialDesignThemes.Wpf;
using Microsoft.Extensions.DependencyInjection;
using MSFSPopoutPanelManager.MainApp.ViewModel;
using System;
using System.Windows.Controls;
namespace MSFSPopoutPanelManager.MainApp
{
public partial class AddProfileDialog : UserControl
{
public AddProfileViewModel ViewModel { get; set; }
public AddProfileDialog()
{
ViewModel = App.AppHost.Services.GetRequiredService<AddProfileViewModel>();
InitializeComponent();
Loaded += (sender, e) =>
{
DataContext = ViewModel;
BtnAccept.IsEnabled = false;
};
}
public DialogClosingEventHandler ClosingEventHandler { get { return ViewModel.ClosingEventHandler; } }
}
}

View file

@ -1,55 +0,0 @@
<UserControl
x:Class="MSFSPopoutPanelManager.MainApp.ConfirmationDialog"
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:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:wpf="clr-namespace:MaterialDesignThemes.Wpf;assembly=MaterialDesignThemes.Wpf"
Width="400"
MinHeight="170"
mc:Ignorable="d">
<StackPanel>
<materialDesign:ColorZone
Height="30"
materialDesign:ElevationAssist.Elevation="Dp4"
Mode="PrimaryDark">
<StackPanel
Margin="24,0,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Center">
<TextBlock Text="{Binding Title}" />
</StackPanel>
</materialDesign:ColorZone>
<StackPanel
MinHeight="40"
Margin="24,24,24,16"
Orientation="Vertical">
<TextBlock
VerticalAlignment="Top"
Text="{Binding Content}"
TextWrapping="Wrap" />
</StackPanel>
<StackPanel
Margin="24,12,24,8"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Orientation="Horizontal">
<Button
Command="{x:Static wpf:DialogHost.CloseDialogCommand}"
CommandParameter="CONFIRM"
KeyboardNavigation.AcceptsReturn="False"
Style="{StaticResource MaterialDesignOutlinedButton}">
<TextBlock Text="{Binding ConfirmButtonText}" />
</Button>
<Button
Margin="12,0,0,0"
Command="{x:Static wpf:DialogHost.CloseDialogCommand}"
CommandParameter="CANCEL"
IsCancel="True"
Style="{StaticResource MaterialDesignOutlinedButton}">
CANCEL
</Button>
</StackPanel>
</StackPanel>
</UserControl>

View file

@ -1,14 +0,0 @@
using MSFSPopoutPanelManager.MainApp.ViewModel;
using System.Windows.Controls;
namespace MSFSPopoutPanelManager.MainApp
{
public partial class ConfirmationDialog : UserControl
{
public ConfirmationDialog(string content, string confirmButtonText)
{
InitializeComponent();
DataContext = new ConfirmationViewModel(content, confirmButtonText);
}
}
}

View file

@ -1,343 +0,0 @@
<UserControl
x:Class="MSFSPopoutPanelManager.MainApp.HelpDrawer"
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:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:viewmodel="clr-namespace:MSFSPopoutPanelManager.MainApp.ViewModel"
Width="1024"
mc:Ignorable="d">
<UserControl.Resources>
<Style
x:Key="TextBlockHeading"
BasedOn="{StaticResource {x:Type TextBlock}}"
TargetType="TextBlock">
<Setter Property="TextWrapping" Value="Wrap" />
<Setter Property="Width" Value="Auto" />
<Setter Property="Margin" Value="0,5,0,0" />
<Setter Property="FontSize" Value="16" />
<Setter Property="FontWeight" Value="Bold" />
</Style>
<Style
x:Key="TextBlockSubheading"
BasedOn="{StaticResource {x:Type TextBlock}}"
TargetType="TextBlock">
<Setter Property="FontSize" Value="16" />
<Setter Property="TextWrapping" Value="Wrap" />
<Setter Property="Width" Value="Auto" />
<Setter Property="Margin" Value="0,5,0,5" />
</Style>
<Style TargetType="AccessText">
<Setter Property="FontSize" Value="14" />
<Setter Property="TextWrapping" Value="Wrap" />
<Setter Property="Width" Value="Auto" />
<Setter Property="Margin" Value="5,-2,0,0" />
</Style>
<Style TargetType="Line">
<Setter Property="Margin" Value="0,5,0,5" />
</Style>
<Style TargetType="{x:Type ScrollViewer}">
<Setter Property="OverridesDefaultStyle" Value="True" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ScrollViewer}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<ScrollContentPresenter Grid.Column="0" />
<ScrollBar
Name="PART_VerticalScrollBar"
Grid.Column="1"
Width="10"
MinWidth="10"
Maximum="{TemplateBinding ScrollableHeight}"
Opacity="0.5"
ViewportSize="{TemplateBinding ViewportHeight}"
Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}"
Value="{TemplateBinding VerticalOffset}" />
<ScrollBar
Name="PART_HorizontalScrollBar"
Grid.Row="1"
Grid.Column="0"
Height="10"
MinHeight="10"
Maximum="{TemplateBinding ScrollableWidth}"
Opacity="0.5"
Orientation="Horizontal"
ViewportSize="{TemplateBinding ViewportWidth}"
Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}"
Value="{TemplateBinding HorizontalOffset}" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
</UserControl.Resources>
<DockPanel d:DataContext="{d:DesignInstance viewmodel:HelpViewModel}">
<ScrollViewer HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden">
<TreeView
Width="210"
VerticalAlignment="Stretch"
DockPanel.Dock="Left">
<TreeView.ItemContainerStyle>
<Style TargetType="{x:Type TreeViewItem}">
<Setter Property="IsExpanded" Value="True" />
<Setter Property="Foreground" Value="#666666" />
<Setter Property="Background" Value="Transparent" />
<Style.Resources>
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="Transparent" />
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightTextBrushKey}" Color="White" />
<SolidColorBrush x:Key="{x:Static SystemColors.InactiveSelectionHighlightBrushKey}" Color="Transparent" />
<SolidColorBrush x:Key="{x:Static SystemColors.InactiveSelectionHighlightTextBrushKey}" Color="White" />
</Style.Resources>
</Style>
</TreeView.ItemContainerStyle>
<TreeViewItem
Margin="-5,0,0,10"
FontSize="14"
FontWeight="Bold"
Foreground="Gray"
Header="Help"
IsHitTestVisible="False" />
<TreeViewItem
x:Name="CategoryKeyboardCommands"
Margin="0,0,0,10"
Header="Keyboard Commands"
IsSelected="True" />
<TreeViewItem
x:Name="CategoryUserGuide"
Margin="0,0,0,10"
Header="User Guide" />
<TreeViewItem
x:Name="CategoryDownloadLatestRelease"
Margin="0,0,0,10"
Header="Download Latest Release" />
<TreeViewItem
x:Name="CategorySupport"
Margin="0,0,0,10"
Header="Support" />
<TreeViewItem
x:Name="CategoryAbout"
Margin="0,0,0,10"
Header="About" />
</TreeView>
</ScrollViewer>
<ScrollViewer
Width="780"
Height="565"
VerticalScrollBarVisibility="Auto">
<StackPanel Margin="0,-5,0,0">
<!-- Keyboard Commands -->
<WrapPanel Orientation="Vertical" Visibility="{Binding ElementName=CategoryKeyboardCommands, Path=IsSelected, Converter={StaticResource BooleanToVisibilityConverter}, Mode=OneWay}">
<WrapPanel Margin="0,0,20,0" Orientation="Vertical">
<TextBlock Style="{StaticResource TextBlockHeading}">Keyboard Commands</TextBlock>
<Line
Stretch="Fill"
Stroke="Gray"
X2="1" />
<WrapPanel>
<TextBlock Margin="0,0,0,20" TextWrapping="Wrap">
To configure a pop out panel, first click on the move and resize icon<InlineUIContainer>
<materialDesign:PackIcon Kind="MoveResize" />
</InlineUIContainer>
for the panel. You can then use keyboard commands below to adjust pop out panel when the icon turns green. To end panel configuration using keyboard commands, just click the icon<InlineUIContainer>
<materialDesign:PackIcon Kind="MoveResize" />
</InlineUIContainer>
again to end panel adjustment.</TextBlock>
<TextBlock>
<Run Foreground="LightSkyBlue">Up Arrow</Run>
- Move panel up by 10 pixels<LineBreak />
<Run Foreground="LightSkyBlue">Down Arrow</Run>
- Move panel down by 10 pixels<LineBreak />
<Run Foreground="LightSkyBlue">Left Arrow</Run>
- Move panel left by 10 pixels<LineBreak />
<Run Foreground="LightSkyBlue">Right Arrow</Run>
- Move panel right by 10 pixels<LineBreak /><LineBreak />
<Run Foreground="LightSkyBlue">Shift + Up Arrow</Run>
- Move panel up by 1 pixel<LineBreak />
<Run Foreground="LightSkyBlue">Shift + Down Arrow</Run>
- Move panel down by 1 pixel<LineBreak />
<Run Foreground="LightSkyBlue">Shift + Left Arrow</Run>
- Move panel left by 1 pixel<LineBreak />
<Run Foreground="LightSkyBlue">Shift + Right Arrow</Run>
- Move panel right by 1 pixel<LineBreak /><LineBreak />
<Run Foreground="LightSkyBlue">Ctrl + Up Arrow</Run>
- Decrease height by 10 pixels<LineBreak />
<Run Foreground="LightSkyBlue">Ctrl + Down Arrow</Run>
- Increase height by 10 pixels<LineBreak />
<Run Foreground="LightSkyBlue">Ctrl + Left Arrow</Run>
- Decrease width by 10 pixels<LineBreak />
<Run Foreground="LightSkyBlue">Ctrl + Right Arrow</Run>
- Increase width by 10 pixels<LineBreak /><LineBreak />
<Run Foreground="LightSkyBlue">Shift + Ctrl + Up Arrow</Run>
- Decrease height by 1 pixel<LineBreak />
<Run Foreground="LightSkyBlue">Shift + Ctrl + Down Arrow</Run>
- Increase height by 1 pixel<LineBreak />
<Run Foreground="LightSkyBlue">Shift + Ctrl + Left Arrow</Run>
- Decrease width by 1 pixel<LineBreak />
<Run Foreground="LightSkyBlue">Shift + Ctrl + Right Arrow</Run>
- Increase width by 1 pixel<LineBreak />
</TextBlock>
</WrapPanel>
</WrapPanel>
</WrapPanel>
<!-- User Guide -->
<WrapPanel Orientation="Vertical" Visibility="{Binding ElementName=CategoryUserGuide, Path=IsSelected, Converter={StaticResource BooleanToVisibilityConverter}, Mode=OneWay}">
<WrapPanel Margin="0,0,20,0" Orientation="Vertical">
<TextBlock Style="{StaticResource TextBlockHeading}">User Guide</TextBlock>
<Line
Stretch="Fill"
Stroke="Gray"
X2="1" />
</WrapPanel>
<TextBlock Width="Auto">
<Hyperlink
NavigateUri="Getting Started"
RequestNavigate="Hyperlink_RequestNavigate"
Style="{StaticResource MaterialDesignBody2Hyperlink}">
<TextBlock Text="Getting Started" />
</Hyperlink>
</TextBlock>
<TextBlock Width="Auto" Margin="0,10,0,0">
<Hyperlink
NavigateUri="User Guide"
RequestNavigate="Hyperlink_RequestNavigate"
Style="{StaticResource MaterialDesignBody2Hyperlink}">
<TextBlock Text="User Guide" />
</Hyperlink>
</TextBlock>
</WrapPanel>
<!-- Download Latest -->
<WrapPanel Orientation="Vertical" Visibility="{Binding ElementName=CategoryDownloadLatestRelease, Path=IsSelected, Converter={StaticResource BooleanToVisibilityConverter}, Mode=OneWay}">
<WrapPanel Margin="0,0,20,0" Orientation="Vertical">
<TextBlock Style="{StaticResource TextBlockHeading}">Download Latest Release</TextBlock>
<Line
Stretch="Fill"
Stroke="Gray"
X2="1" />
</WrapPanel>
<TextBlock Width="Auto">
<Hyperlink
NavigateUri="Download Latest GitHub"
RequestNavigate="Hyperlink_RequestNavigate"
Style="{StaticResource MaterialDesignBody2Hyperlink}">
<TextBlock Text="Download latest release (GitHub)" />
</Hyperlink>
</TextBlock>
<TextBlock Width="Auto" Margin="0,10,0,0">
<Hyperlink
NavigateUri="Download Latest FlightsimTo"
RequestNavigate="Hyperlink_RequestNavigate"
Style="{StaticResource MaterialDesignBody2Hyperlink}">
<TextBlock Text="Download latest release (Flightsim.to)" />
</Hyperlink>
</TextBlock>
</WrapPanel>
<!-- Support -->
<WrapPanel Orientation="Vertical" Visibility="{Binding ElementName=CategorySupport, Path=IsSelected, Converter={StaticResource BooleanToVisibilityConverter}, Mode=OneWay}">
<WrapPanel Margin="0,0,20,0" Orientation="Vertical">
<TextBlock Style="{StaticResource TextBlockHeading}">Support</TextBlock>
<Line
Stretch="Fill"
Stroke="Gray"
X2="1" />
</WrapPanel>
<TextBlock Width="Auto" Margin="0,0,0,0">
<Hyperlink
NavigateUri="Open Data Folder"
RequestNavigate="Hyperlink_RequestNavigate"
Style="{StaticResource MaterialDesignBody2Hyperlink}">
<TextBlock Text="Open application data file folder" />
</Hyperlink>
</TextBlock>
<TextBlock Width="Auto" Margin="0,10,0,0">
<Hyperlink
NavigateUri="Download VCC Library"
RequestNavigate="Hyperlink_RequestNavigate"
Style="{StaticResource MaterialDesignBody2Hyperlink}">
<TextBlock Text="Download VC++ Library that is required by SimConnect to establish connection to MSFS" />
</Hyperlink>
</TextBlock>
<Button
Width="190"
Margin="0,10,0,0"
HorizontalAlignment="Left"
Command="{Binding DeleteAppCacheCommand}"
Content="Delete Application Cache"
IsEnabled="{Binding HasOrphanAppCache}"
KeyboardNavigation.AcceptsReturn="False"
Style="{StaticResource MaterialDesignOutlinedButton}"
ToolTip="This will delete all orphan application cache files in your Windows user account 'AppData/Local/Temp/.net/MSFSPopoutPanelManager' folder" />
<!--<Button
Width="280"
Margin="0,10,0,0"
HorizontalAlignment="Left"
Command="{Binding RollBackCommand}"
Content="Rollback to previous version 3.4.6.0321"
KeyboardNavigation.AcceptsReturn="False"
Style="{StaticResource MaterialDesignOutlinedButton}"
ToolTip="This will rollback the application to previous version 3.4.6.0321. All changes since installing the latest v4.0.0 update will be lost."
Visibility="{Binding IsRollBackCommandVisible, Converter={StaticResource BooleanToVisibilityConverter}, Mode=OneWay}" />-->
</WrapPanel>
<!-- About -->
<WrapPanel Orientation="Vertical" Visibility="{Binding ElementName=CategoryAbout, Path=IsSelected, Converter={StaticResource BooleanToVisibilityConverter}, Mode=OneWay}">
<WrapPanel Margin="0,0,20,0" Orientation="Vertical">
<TextBlock Style="{StaticResource TextBlockHeading}">About</TextBlock>
<Line
Stretch="Fill"
Stroke="Gray"
X2="1" />
</WrapPanel>
<TextBlock Width="Auto" Margin="0,0,0,0">
<Hyperlink
NavigateUri="Version Info"
RequestNavigate="Hyperlink_RequestNavigate"
Style="{StaticResource MaterialDesignBody2Hyperlink}">
<WrapPanel>
<WrapPanel Margin="0">
<Label
Margin="0"
Padding="0"
Content="Version" />
<Label
Margin="5,0,0,0"
Padding="0"
Content="{Binding ApplicationVersion}" />
</WrapPanel>
</WrapPanel>
</Hyperlink>
</TextBlock>
<Label
Margin="0,5,0,0"
Padding="0"
Content="© 2022 Stanley Kwok. All rights reserved." />
<TextBlock Width="Auto" Margin="0,10,0,0">
<Hyperlink
NavigateUri="License"
RequestNavigate="Hyperlink_RequestNavigate"
Style="{StaticResource MaterialDesignBody2Hyperlink}">
<TextBlock Text="Public Release License" />
</Hyperlink>
</TextBlock>
</WrapPanel>
</StackPanel>
</ScrollViewer>
</DockPanel>
</UserControl>

View file

@ -1,25 +0,0 @@
using Microsoft.Extensions.DependencyInjection;
using MSFSPopoutPanelManager.MainApp.ViewModel;
using System;
using System.Windows.Controls;
using System.Windows.Navigation;
namespace MSFSPopoutPanelManager.MainApp
{
public partial class HelpDrawer : UserControl
{
private HelpViewModel _viewModel;
public HelpDrawer()
{
_viewModel = App.AppHost.Services.GetRequiredService<HelpViewModel>();
InitializeComponent();
Loaded += (sender, e) => { DataContext = _viewModel; };
}
private void Hyperlink_RequestNavigate(object sender, RequestNavigateEventArgs e)
{
_viewModel.HyperLinkCommand.Execute(e.Uri.ToString());
}
}
}

View file

@ -1,356 +0,0 @@
<UserControl
x:Class="MSFSPopoutPanelManager.MainApp.PopOutPanelCard"
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:local="clr-namespace:MSFSPopoutPanelManager.MainApp"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:profileDomain="clr-namespace:MSFSPopoutPanelManager.DomainModel.Profile;assembly=DomainModel"
xmlns:system="clr-namespace:System;assembly=mscorlib"
Width="860"
mc:Ignorable="d">
<UserControl.Resources>
<system:Double x:Key="IconSize">22</system:Double>
<system:Double x:Key="ButtonSize">28</system:Double>
<system:Double x:Key="UpDownButtonSize">22</system:Double>
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
<DataTrigger
x:Key="TriggerIsProfileLocked"
Binding="{Binding ProfileData.ActiveProfile.IsLocked}"
Value="True">
<Setter Property="FrameworkElement.IsHitTestVisible" Value="False" />
<Setter Property="FrameworkElement.Opacity" Value="0.8" />
</DataTrigger>
<DataTrigger
x:Key="TriggerIsProfileUnlocked"
Binding="{Binding ProfileData.ActiveProfile.IsLocked}"
Value="False">
<Setter Property="FrameworkElement.IsHitTestVisible" Value="True" />
<Setter Property="Button.Foreground" Value="White" />
</DataTrigger>
<Style TargetType="{x:Type Expander}">
<Style.Triggers>
<StaticResource ResourceKey="TriggerIsProfileLocked" />
<StaticResource ResourceKey="TriggerIsProfileUnlocked" />
</Style.Triggers>
</Style>
<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,40,0" />
<Setter Property="LineHeight" Value="18" />
</Style>
<Style BasedOn="{StaticResource MaterialDesignIconForegroundButton}" TargetType="Button" />
<Style
x:Key="PopOutPanelExpander"
BasedOn="{StaticResource CustomMaterialDesignExpander}"
TargetType="Expander">
<Style.Triggers>
<DataTrigger Binding="{Binding DataItem.IsPopOutSuccess}" Value="False">
<Setter Property="BorderBrush" Value="Red" />
</DataTrigger>
<DataTrigger Binding="{Binding DataItem.IsPopOutSuccess}" Value="True">
<Setter Property="BorderBrush" Value="Green" />
</DataTrigger>
<DataTrigger Binding="{Binding DataItem.IsSelectedPanelSource}" Value="True">
<Setter Property="Background" Value="SlateGray" />
<Setter Property="Opacity" Value="0.9" />
</DataTrigger>
</Style.Triggers>
</Style>
<Style x:Key="PopOutPanelExpanderVisibility" TargetType="StackPanel">
<Style.Triggers>
<DataTrigger Binding="{Binding DataItem.IsPopOutSuccess}" Value="True">
<Setter Property="FrameworkElement.Visibility" Value="Visible" />
</DataTrigger>
<DataTrigger Binding="{Binding DataItem.IsPopOutSuccess}" Value="{x:Null}">
<Setter Property="FrameworkElement.Visibility" Value="Visible" />
</DataTrigger>
<DataTrigger Binding="{Binding DataItem.IsPopOutSuccess}" Value="False">
<Setter Property="FrameworkElement.Visibility" Value="Collapsed" />
</DataTrigger>
</Style.Triggers>
</Style>
<Style x:Key="ErrorPanelExpanderVisibility" TargetType="StackPanel">
<Style.Triggers>
<DataTrigger Binding="{Binding DataItem.IsPopOutSuccess}" Value="True">
<Setter Property="FrameworkElement.Visibility" Value="Collapsed" />
</DataTrigger>
<DataTrigger Binding="{Binding DataItem.IsPopOutSuccess}" Value="{x:Null}">
<Setter Property="FrameworkElement.Visibility" Value="Collapsed" />
</DataTrigger>
<DataTrigger Binding="{Binding DataItem.IsPopOutSuccess}" Value="False">
<Setter Property="FrameworkElement.Visibility" Value="Visible" />
</DataTrigger>
</Style.Triggers>
</Style>
<Style x:Key="TxtBlockErrorMessage" TargetType="TextBlock">
<Style.Triggers>
<DataTrigger Binding="{Binding DataItem.PanelType}" Value="{x:Static profileDomain:PanelType.CustomPopout}">
<Setter Property="Text" Value="Unable to pop out this panel. Please check the source panel circle defined for this panel is at the correct location and not blocked by other window. Also please check if this panel is a duplicate with another panel. Lastly, please close all instrumentation pop outs that were opened manually." />
<Setter Property="LineHeight" Value="18" />
</DataTrigger>
<DataTrigger Binding="{Binding DataItem.PanelType}" Value="{x:Static profileDomain:PanelType.BuiltInPopout}">
<Setter Property="Text" Value="Unable to configure this built-in panel. Please make sure this panel has been opened and popped out by the game." />
<Setter Property="LineHeight" Value="18" />
</DataTrigger>
</Style.Triggers>
</Style>
<Style
x:Key="TxtBlockDisableWhenFullScreen"
BasedOn="{StaticResource TextBlockLabel}"
TargetType="TextBlock">
<Style.Triggers>
<DataTrigger Binding="{Binding DataItem.FullScreen}" Value="True">
<Setter Property="Foreground" Value="DimGray" />
</DataTrigger>
</Style.Triggers>
</Style>
</UserControl.Resources>
<DockPanel>
<Expander
x:Name="RootExpander"
Width="860"
materialDesign:ExpanderAssist.HorizontalHeaderPadding="10,0,10,0"
BorderThickness="1">
<Expander.Style>
<Style BasedOn="{StaticResource PopOutPanelExpander}" TargetType="Expander">
<Style.Triggers>
<StaticResource ResourceKey="TriggerIsProfileLocked" />
<StaticResource ResourceKey="TriggerIsProfileUnlocked" />
</Style.Triggers>
</Style>
</Expander.Style>
<Expander.Header>
<StackPanel Width="805" Orientation="Horizontal">
<StackPanel
Width="24"
Height="52"
Margin="0"
Style="{StaticResource ErrorPanelExpanderVisibility}">
<materialDesign:PopupBox
x:Name="PopupErrorMessage"
Margin="0,15,0,0"
Padding="5"
PlacementMode="RightAndAlignMiddles"
PopupHorizontalOffset="-10"
PopupUniformCornerRadius="10"
PopupVerticalOffset="15"
StaysOpen="True">
<materialDesign:PopupBox.ToggleContent>
<materialDesign:PackIcon
Width="{StaticResource IconSize}"
Height="{StaticResource IconSize}"
Foreground="Red"
Kind="AlertCircleOutline" />
</materialDesign:PopupBox.ToggleContent>
<TextBlock
Width="450"
Style="{StaticResource TxtBlockErrorMessage}"
TextWrapping="Wrap" />
</materialDesign:PopupBox>
</StackPanel>
<!-- Drag panel handle -->
<StackPanel
Width="24"
Height="52"
Margin="0"
Style="{StaticResource PopOutPanelExpanderVisibility}">
<materialDesign:PackIcon
x:Name="IconDrag"
Width="{StaticResource IconSize}"
Height="{StaticResource IconSize}"
Margin="0,15,0,0"
Kind="Menu"
Opacity="0.5" />
</StackPanel>
<!-- Panel name text box -->
<TextBox
x:Name="TxtBoxPanelName"
Width="260"
Margin="8,0,0,0"
Padding="0"
VerticalAlignment="Center"
HorizontalContentAlignment="Left"
materialDesign:HintAssist.FloatingScale="1"
materialDesign:HintAssist.Hint="Panel Name"
GotFocus="TextBox_GotFocus"
IsEnabled="{c:Binding 'DataItem.PanelType==profileDomain:PanelType.CustomPopout'}"
KeyDown="TextBox_KeyDown"
SourceUpdated="Data_SourceUpdated"
Style="{StaticResource MaterialDesignFloatingHintTextBox}"
Text="{Binding DataItem.PanelName, Mode=TwoWay, NotifyOnSourceUpdated=True}" />
<!-- Identify source panel button -->
<StackPanel
x:Name="StackPanelIdentifyPanelSource"
Width="440"
VerticalAlignment="Center"
Visibility="{c:Binding 'DataItem.PanelType==profileDomain:PanelType.CustomPopout and DataItem.PanelSource.X == null'}">
<Button
x:Name="BtnIdentifySourcePanel"
HorizontalAlignment="Center"
Command="{Binding AddPanelSourceLocationCommand}"
Content="Identify Source Panel Location"
Foreground="White"
KeyboardNavigation.AcceptsReturn="False"
Style="{StaticResource MaterialDesignOutlinedButton}"
ToolTip="Identify source aircraft instrumentation panel location" />
</StackPanel>
<!-- Panel configurations -->
<StackPanel
x:Name="StackPanelAdjustment"
Width="440"
Orientation="Horizontal"
Visibility="{c:Binding 'DataItem.PanelType==profileDomain:PanelType.RefocusDisplay or DataItem.PanelType==profileDomain:PanelType.BuiltInPopout or DataItem.PanelType==profileDomain:PanelType.HudBarWindow or DataItem.PanelSource.X != null'}">
<local:PanelConfigField
Margin="20,0,0,0"
BindingPath="Top"
DataItem="{Binding DataItem}"
IsEnabled="{c:Binding 'DataItem.PanelType!=profileDomain:PanelType.RefocusDisplay'}"
SourceUpdated="Data_SourceUpdated" />
<local:PanelConfigField
Margin="20,0,0,0"
BindingPath="Left"
DataItem="{Binding DataItem}"
IsEnabled="{c:Binding 'DataItem.PanelType!=profileDomain:PanelType.RefocusDisplay'}"
SourceUpdated="Data_SourceUpdated" />
<local:PanelConfigField
Margin="20,0,0,0"
BindingPath="Width"
DataItem="{Binding DataItem}"
IsEnabled="{c:Binding 'DataItem.PanelType!=profileDomain:PanelType.HudBarWindow and DataItem.PanelType!=profileDomain:PanelType.RefocusDisplay'}"
SourceUpdated="Data_SourceUpdated" />
<local:PanelConfigField
Margin="20,0,0,0"
BindingPath="Height"
DataItem="{Binding DataItem}"
IsEnabled="{c:Binding 'DataItem.PanelType!=profileDomain:PanelType.HudBarWindow and DataItem.PanelType!=profileDomain:PanelType.RefocusDisplay'}"
SourceUpdated="Data_SourceUpdated" />
<local:MoveAndResizePanelButton Margin="12,0,0,0" Visibility="{c:Binding 'DataItem.PanelType!=profileDomain:PanelType.RefocusDisplay'}" />
<local:TouchEnabledButton
Width="{StaticResource IconSize}"
Margin="12,0,0,0"
Visibility="{c:Binding 'DataItem.PanelType!=profileDomain:PanelType.HudBarWindow and DataItem.PanelType!=profileDomain:PanelType.RefocusDisplay'}" />
</StackPanel>
<!-- Source panel icon -->
<StackPanel Margin="12,0,0,0" VerticalAlignment="Center">
<Button
Width="{StaticResource IconSize}"
Height="{StaticResource IconSize}"
IsHitTestVisible="{Binding ProfileData.ActiveProfile.IsEditingPanelSource}"
PreviewMouseDown="PanelSourceIcon_PreviewMouseDown"
PreviewMouseUp="PanelSourceIcon_PreviewMouseUp"
Style="{StaticResource MaterialDesignIconButton}"
ToolTip="Hold the left mouse button to show the panel source location"
Visibility="{c:Binding 'DataItem.PanelType==profileDomain:PanelType.CustomPopout'}">
<materialDesign:PackIcon
Width="{StaticResource IconSize}"
Height="{StaticResource IconSize}"
Kind="Crosshairs">
<materialDesign:PackIcon.Style>
<Style>
<Style.Triggers>
<DataTrigger Binding="{Binding ProfileData.ActiveProfile.IsEditingPanelSource}" Value="True">
<Setter Property="materialDesign:PackIcon.Foreground" Value="{Binding DataItem.PanelSource.Color}" />
</DataTrigger>
<DataTrigger Binding="{Binding ProfileData.ActiveProfile.IsEditingPanelSource}" Value="False">
<Setter Property="materialDesign:PackIcon.Opacity" Value="0.3" />
</DataTrigger>
</Style.Triggers>
</Style>
</materialDesign:PackIcon.Style>
</materialDesign:PackIcon>
</Button>
<StackPanel Width="{StaticResource IconSize}" Visibility="{c:Binding 'DataItem.PanelType!=profileDomain:PanelType.CustomPopOut'}" />
</StackPanel>
<!-- Delete panel button -->
<StackPanel Margin="12,0,0,0" VerticalAlignment="Center">
<Button
Width="{StaticResource ButtonSize}"
Height="{StaticResource ButtonSize}"
Margin="0"
Command="{Binding DeletePanelCommand}"
KeyboardNavigation.AcceptsReturn="False"
ToolTip="Delete panel"
Visibility="{c:Binding 'DataItem.PanelType!=profileDomain:PanelType.RefocusDisplay and DataItem.PanelType!=profileDomain:PanelType.HudBarWindow'}">
<materialDesign:PackIcon
Width="{StaticResource IconSize}"
Height="{StaticResource IconSize}"
Kind="DeleteOutline" />
</Button>
</StackPanel>
</StackPanel>
</Expander.Header>
<StackPanel
Margin="42,8,24,16"
Orientation="Horizontal"
TextBlock.Foreground="{DynamicResource MaterialDesignBody}"
Visibility="{c:Binding 'DataItem.PanelType!=profileDomain:PanelType.HudBarWindow and DataItem.PanelType!=profileDomain:PanelType.RefocusDisplay'}">
<WrapPanel>
<ToggleButton
x:Name="TglBtnAlwaysOnTop"
Margin="0,0,0,0"
IsChecked="{Binding DataItem.AlwaysOnTop, Mode=TwoWay, NotifyOnSourceUpdated=True}"
IsEnabled="{c:Binding !DataItem.FullScreen}"
SourceUpdated="Data_SourceUpdated"
Style="{StaticResource ToggleButton}" />
<TextBlock Style="{StaticResource TxtBlockDisableWhenFullScreen}" ToolTip="Set this panel to be always on top">
Always on Top
</TextBlock>
</WrapPanel>
<WrapPanel>
<ToggleButton
x:Name="TglBtnFullScreen"
Margin="0,0,0,0"
IsChecked="{Binding DataItem.FullScreen, Mode=TwoWay, NotifyOnSourceUpdated=True}"
SourceUpdated="Data_SourceUpdated"
Style="{StaticResource ToggleButton}" />
<TextBlock Style="{StaticResource TextBlockLabel}" ToolTip="Expand this panel into full screen (emulate keystroke Alt-Enter)">Full Screen Mode</TextBlock>
</WrapPanel>
<WrapPanel>
<ToggleButton
x:Name="TglBtnHideTitlebar"
Margin="0,0,0,0"
IsChecked="{Binding DataItem.HideTitlebar, Mode=TwoWay, NotifyOnSourceUpdated=True}"
IsEnabled="{c:Binding !DataItem.FullScreen}"
SourceUpdated="Data_SourceUpdated"
Style="{StaticResource ToggleButton}" />
<TextBlock Style="{StaticResource TxtBlockDisableWhenFullScreen}" ToolTip="Hide the title bar for this panel">
Hide Title Bar
</TextBlock>
</WrapPanel>
<WrapPanel>
<ToggleButton
x:Name="TglBtnAutoGameRefocus"
Margin="0,0,0,0"
IsChecked="{Binding DataItem.AutoGameRefocus, Mode=TwoWay, NotifyOnSourceUpdated=True}"
SourceUpdated="Data_SourceUpdated"
Style="{StaticResource ToggleButton}" />
<TextBlock Style="{StaticResource TextBlockLabel}" ToolTip="Automatic game refocus when clicking this panel or when using touch on this panel">Automatic Game Refocus</TextBlock>
</WrapPanel>
</StackPanel>
</Expander>
</DockPanel>
</UserControl>

View file

@ -1,128 +0,0 @@
using Microsoft.Extensions.DependencyInjection;
using MSFSPopoutPanelManager.DomainModel.Profile;
using MSFSPopoutPanelManager.MainApp.ViewModel;
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Input;
namespace MSFSPopoutPanelManager.MainApp
{
public partial class PopOutPanelCard : UserControl
{
private PopOutPanelCardViewModel _viewModel;
public static readonly DependencyProperty DataItemProperty = DependencyProperty.Register("DataItem", typeof(PanelConfig), typeof(PopOutPanelCard));
public PopOutPanelCard()
{
_viewModel = App.AppHost.Services.GetRequiredService<PopOutPanelCardViewModel>();
Loaded += (sender, e) =>
{
_viewModel.DataItem = DataItem;
this.DataContext = _viewModel;
InitializeComponent();
};
}
public PanelConfig DataItem
{
get { return (PanelConfig)GetValue(DataItemProperty); }
set { SetValue(DataItemProperty, value); }
}
private void TextBox_KeyDown(object sender, KeyEventArgs e)
{
if (e.Key == Key.Enter)
{
Keyboard.ClearFocus();
FocusManager.SetFocusedElement(FocusManager.GetFocusScope(RootExpander), RootExpander as IInputElement);
}
}
private void TextBox_GotFocus(object sender, RoutedEventArgs e)
{
var txtBox = (TextBox)sender;
txtBox.Dispatcher.BeginInvoke(new Action(() => txtBox.SelectAll()));
}
private void BtnUpDown_Click(object sender, RoutedEventArgs e)
{
var button = (Button)sender;
var buttonType = button.Name.Substring(9);
var txtBox = this.FindName($"TxtBox{buttonType}") as TextBox;
if (txtBox != null)
txtBox.Dispatcher.BeginInvoke(new Action(() => txtBox.Focus()));
}
private string _oldText;
private void TxtBox_NumbersOnly(object sender, TextCompositionEventArgs e)
{
int result;
e.Handled = !(int.TryParse(e.Text, out result) || (e.Text.Trim() == "-"));
if (!e.Handled)
_oldText = ((TextBox)sender).Text;
}
private void TxtBox_NumbersOnlyTextChanged(object sender, TextChangedEventArgs e)
{
int result;
var txtBox = (TextBox)sender;
if (String.IsNullOrEmpty(txtBox.Text))
txtBox.Text = "0";
else if (!(int.TryParse(txtBox.Text, out result) || (txtBox.Text.Trim() == "-")))
{
txtBox.Text = _oldText;
}
}
private void Data_SourceUpdated(object sender, System.Windows.Data.DataTransferEventArgs e)
{
string? param = null;
if (sender is PanelConfigField)
param = ((PanelConfigField)sender).BindingPath;
else if (sender is ToggleButton)
param = ((ToggleButton)sender).Name.Substring(6);
else if (sender is TextBox)
param = ((TextBox)sender).Name.Substring(6);
if (!String.IsNullOrEmpty(param))
_viewModel.PanelAttributeUpdatedCommand.Execute(param);
}
private void PanelSourceIcon_PreviewMouseDown(object sender, MouseButtonEventArgs e)
{
if (e.LeftButton == MouseButtonState.Pressed && _viewModel.DataItem != null && _viewModel.ProfileData.ActiveProfile.IsEditingPanelSource)
_viewModel.DataItem.IsShownPanelSource = true;
}
private void PanelSourceIcon_PreviewMouseUp(object sender, MouseButtonEventArgs e)
{
if (e.LeftButton == MouseButtonState.Released && _viewModel.DataItem != null && _viewModel.ProfileData.ActiveProfile.IsEditingPanelSource)
_viewModel.DataItem.IsShownPanelSource = false;
}
}
public class CustomTextBox : TextBox
{
static CustomTextBox()
{
TextProperty.OverrideMetadata(typeof(CustomTextBox), new FrameworkPropertyMetadata(null, null, CoerceChanged));
}
private static object CoerceChanged(DependencyObject d, object basevalue)
{
TextBox? txtBox = d as TextBox;
if (txtBox != null && basevalue == null)
{
return txtBox.Text;
}
return basevalue;
}
}
}

View file

@ -1,24 +0,0 @@
<UserControl
x:Class="MSFSPopoutPanelManager.MainApp.EditPanelSourceButton"
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:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:system="clr-namespace:System;assembly=mscorlib"
mc:Ignorable="d">
<UserControl.Resources>
<system:Double x:Key="IconSize">22</system:Double>
<system:Double x:Key="ButtonSize">28</system:Double>
</UserControl.Resources>
<DockPanel
Width="35"
Margin="0"
VerticalAlignment="Center">
<materialDesign:PackIcon
Width="{StaticResource IconSize}"
Height="{StaticResource IconSize}"
Foreground="{Binding DataItem.PanelSource.Color}"
Kind="CrosshairsGps" />
</DockPanel>
</UserControl>

View file

@ -1,12 +0,0 @@
using System.Windows.Controls;
namespace MSFSPopoutPanelManager.MainApp
{
public partial class EditPanelSourceButton : UserControl
{
public EditPanelSourceButton()
{
InitializeComponent();
}
}
}

View file

@ -1,38 +0,0 @@
<UserControl
x:Class="MSFSPopoutPanelManager.MainApp.MoveAndResizePanelButton"
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:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:system="clr-namespace:System;assembly=mscorlib"
mc:Ignorable="d">
<UserControl.Resources>
<system:Double x:Key="IconSize">22</system:Double>
<system:Double x:Key="ButtonSize">28</system:Double>
</UserControl.Resources>
<ToggleButton
Width="{StaticResource ButtonSize}"
Height="{StaticResource ButtonSize}"
materialDesign:ToggleButtonAssist.OnContent="{materialDesign:PackIcon Kind=MoveResize,
Size={StaticResource IconSize}}"
Background="Transparent"
Command="{Binding MoveResizePanelCommand}"
IsChecked="{Binding DataItem.IsEditingPanel, Mode=TwoWay}"
KeyboardNavigation.AcceptsReturn="False"
ToolTip="Use keyboard commands to edit panel size &#x0a;and location. Please see help for more info.">
<ToggleButton.Style>
<Style BasedOn="{StaticResource MaterialDesignActionSecondaryToggleButton}" TargetType="ToggleButton">
<Style.Triggers>
<DataTrigger Binding="{Binding DataItem.IsEditingPanel}" Value="True">
<Setter Property="Foreground" Value="LimeGreen" />
</DataTrigger>
</Style.Triggers>
</Style>
</ToggleButton.Style>
<materialDesign:PackIcon
Width="{StaticResource IconSize}"
Height="{StaticResource IconSize}"
Kind="MoveResize" />
</ToggleButton>
</UserControl>

View file

@ -1,12 +0,0 @@
using System.Windows.Controls;
namespace MSFSPopoutPanelManager.MainApp
{
public partial class MoveAndResizePanelButton : UserControl
{
public MoveAndResizePanelButton()
{
InitializeComponent();
}
}
}

View file

@ -1,51 +0,0 @@
<UserControl
x:Class="MSFSPopoutPanelManager.MainApp.MoveUpDownButton"
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:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:system="clr-namespace:System;assembly=mscorlib"
mc:Ignorable="d">
<UserControl.Resources>
<system:Double x:Key="UpDownIconSize">14</system:Double>
<system:Double x:Key="UpDownButtonSize">22</system:Double>
</UserControl.Resources>
<StackPanel
Width="25"
Height="52"
Margin="0"
VerticalAlignment="Center">
<WrapPanel
Height="26"
Margin="0,4,0,-4"
VerticalAlignment="Center">
<Button
x:Name="BtnMovePanelUp"
Width="{StaticResource UpDownButtonSize}"
Height="{StaticResource UpDownButtonSize}"
Command="{Binding MovePanelUpCommand}"
KeyboardNavigation.AcceptsReturn="False"
ToolTip="Move panel Up">
<materialDesign:PackIcon
Width="{StaticResource UpDownButtonSize}"
Height="{StaticResource UpDownButtonSize}"
Kind="CaretUp" />
</Button>
</WrapPanel>
<WrapPanel Height="26" VerticalAlignment="Center">
<Button
x:Name="BtnMovePanelDown"
Width="{StaticResource UpDownButtonSize}"
Height="{StaticResource UpDownButtonSize}"
Command="{Binding MovePanelDownCommand}"
KeyboardNavigation.AcceptsReturn="False"
ToolTip="Move panel down">
<materialDesign:PackIcon
Width="{StaticResource UpDownButtonSize}"
Height="{StaticResource UpDownButtonSize}"
Kind="CaretDown" />
</Button>
</WrapPanel>
</StackPanel>
</UserControl>

View file

@ -1,12 +0,0 @@
using System.Windows.Controls;
namespace MSFSPopoutPanelManager.MainApp
{
public partial class MoveUpDownButton : UserControl
{
public MoveUpDownButton()
{
InitializeComponent();
}
}
}

View file

@ -1,148 +0,0 @@
<UserControl
x:Class="MSFSPopoutPanelManager.MainApp.PanelConfigField"
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:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:system="clr-namespace:System;assembly=mscorlib"
mc:Ignorable="d">
<UserControl.Resources>
<system:Double x:Key="UpDownIconSize">14</system:Double>
<system:Double x:Key="UpDownButtonSize">22</system:Double>
<Style BasedOn="{StaticResource MaterialDesignFloatingHintTextBox}" TargetType="TextBox">
<Setter Property="materialDesign:HintAssist.FloatingScale" Value="1" />
<Setter Property="HorizontalContentAlignment" Value="Left" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="Padding" Value="0" />
<EventSetter Event="KeyDown" Handler="TextBox_KeyDown" />
<EventSetter Event="GotFocus" Handler="TextBox_GotFocus" />
</Style>
<Style
x:Key="BtnPlusMinus"
BasedOn="{StaticResource MaterialDesignIconForegroundButton}"
TargetType="Button">
<Setter Property="Width" Value="30" />
<Setter Property="Height" Value="30" />
<Setter Property="Margin" Value="0,0,5,0" />
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Command" Value="{Binding PlusMinusCommand}" />
</Style>
</UserControl.Resources>
<StackPanel Orientation="Horizontal">
<TextBox
x:Name="TxtBoxData"
Width="50"
Margin="0,0,0,0"
materialDesign:HintAssist.Hint="{Binding BindingPath}"
IsEnabled="{c:Binding '!DataItem.FullScreen'}"
PreviewTextInput="TxtBox_NumbersOnly"
SourceUpdated="Data_SourceUpdated"
TextChanged="TxtBox_NumbersOnlyTextChanged" />
<materialDesign:PopupBox
x:Name="PopupBoxAdjustment"
Padding="5"
IsEnabled="{c:Binding '!DataItem.FullScreen'}"
PlacementMode="RightAndAlignMiddles"
PopupHorizontalOffset="-20"
PopupUniformCornerRadius="10"
StaysOpen="True">
<materialDesign:PopupBox.ToggleContent>
<Button
Width="{StaticResource UpDownButtonSize}"
Height="{StaticResource UpDownButtonSize}"
Margin="-4,12,0,0"
Click="BtnPopupBoxOpen_Click">
<materialDesign:PackIcon
Width="{StaticResource UpDownIconSize}"
Height="{StaticResource UpDownIconSize}"
Foreground="White"
Kind="ArrowUpDown" />
</Button>
</materialDesign:PopupBox.ToggleContent>
<StackPanel
Width="155"
Margin="0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Orientation="Horizontal">
<StackPanel Orientation="Vertical">
<StackPanel Orientation="Horizontal">
<Label
Width="60"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Content="1 pixel" />
<Button
Command="{Binding PlusMinusCommand}"
CommandParameter="1"
Style="{StaticResource BtnPlusMinus}"
ToolTip="Add 1 pixel">
<materialDesign:PackIcon
Width="{StaticResource UpDownIconSize}"
Height="{StaticResource UpDownIconSize}"
Kind="Plus" />
</Button>
<Button
Command="{Binding PlusMinusCommand}"
CommandParameter="-1"
Style="{StaticResource BtnPlusMinus}"
ToolTip="Subtract 1 pixel">
<materialDesign:PackIcon
Width="{StaticResource UpDownIconSize}"
Height="{StaticResource UpDownIconSize}"
Kind="Minus" />
</Button>
</StackPanel>
<Separator
Height="2"
Margin="0"
Padding="0" />
<StackPanel Orientation="Horizontal">
<Label
Width="60"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Content="10 pixels" />
<Button
Command="{Binding PlusMinusCommand}"
CommandParameter="10"
Style="{StaticResource BtnPlusMinus}"
ToolTip="Add 10 pixels">
<materialDesign:PackIcon
Width="{StaticResource UpDownIconSize}"
Height="{StaticResource UpDownIconSize}"
Kind="Plus" />
</Button>
<Button
Command="{Binding PlusMinusCommand}"
CommandParameter="-10"
Style="{StaticResource BtnPlusMinus}"
ToolTip="Subtract 10 pixels">
<materialDesign:PackIcon
Width="{StaticResource UpDownIconSize}"
Height="{StaticResource UpDownIconSize}"
Kind="Minus" />
</Button>
</StackPanel>
</StackPanel>
<Button
Width="{StaticResource UpDownButtonSize}"
Height="{StaticResource UpDownButtonSize}"
Margin="5,0,0,0"
HorizontalContentAlignment="Center"
VerticalContentAlignment="Center"
Click="BtnPopupBoxClose_Click"
Style="{StaticResource MaterialDesignIconForegroundButton}">
<materialDesign:PackIcon
Width="{StaticResource UpDownIconSize}"
Height="{StaticResource UpDownIconSize}"
Kind="CloseBoxOutline" />
</Button>
</StackPanel>
</materialDesign:PopupBox>
</StackPanel>
</UserControl>

View file

@ -1,103 +0,0 @@
using Microsoft.Extensions.DependencyInjection;
using MSFSPopoutPanelManager.DomainModel.Profile;
using MSFSPopoutPanelManager.MainApp.ViewModel;
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Input;
namespace MSFSPopoutPanelManager.MainApp
{
public partial class PanelConfigField : UserControl
{
private PanelConfigFieldViewModel _viewModel;
public static readonly DependencyProperty DataItemProperty = DependencyProperty.Register("DataItem", typeof(PanelConfig), typeof(PanelConfigField));
public static readonly DependencyProperty BindingPathProperty = DependencyProperty.Register("BindingPath", typeof(string), typeof(PanelConfigField));
public static readonly RoutedEvent SourceUpdatedEvent = EventManager.RegisterRoutedEvent("SourceUpdatedEvent", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(PanelConfigField));
public PanelConfigField()
{
_viewModel = App.AppHost.Services.GetRequiredService<PanelConfigFieldViewModel>();
Loaded += (sender, e) =>
{
_viewModel.DataItem = DataItem;
_viewModel.BindingPath = BindingPath;
_viewModel.SourceUpdatedEvent = SourceUpdatedEvent;
this.DataContext = _viewModel;
InitializeComponent();
Binding binding = new Binding($"DataItem.{BindingPath}");
binding.Mode = BindingMode.TwoWay;
binding.NotifyOnSourceUpdated = true;
TxtBoxData.SetBinding(TextBox.TextProperty, binding);
};
}
public PanelConfig DataItem
{
get { return (PanelConfig)GetValue(DataItemProperty); }
set { SetValue(DataItemProperty, value); }
}
public string BindingPath
{
get { return (string)GetValue(BindingPathProperty); }
set { SetValue(BindingPathProperty, value); }
}
private void TextBox_KeyDown(object sender, KeyEventArgs e)
{
if (e.Key == Key.Enter)
{
Keyboard.ClearFocus();
FocusManager.SetFocusedElement(FocusManager.GetFocusScope(this.Parent), this.Parent as IInputElement);
}
}
private void TextBox_GotFocus(object sender, RoutedEventArgs e)
{
TxtBoxData.Dispatcher.BeginInvoke(new Action(() => TxtBoxData.SelectAll()));
}
private string _oldText;
private void TxtBox_NumbersOnly(object sender, TextCompositionEventArgs e)
{
int result;
e.Handled = !(int.TryParse(e.Text, out result) || (e.Text.Trim() == "-"));
if (!e.Handled)
_oldText = ((TextBox)sender).Text;
}
private void TxtBox_NumbersOnlyTextChanged(object sender, TextChangedEventArgs e)
{
int result;
var txtBox = (TextBox)sender;
if (String.IsNullOrEmpty(txtBox.Text))
txtBox.Text = "0";
else if (!(int.TryParse(txtBox.Text, out result) || (txtBox.Text.Trim() == "-")))
{
txtBox.Text = _oldText;
}
}
private void Data_SourceUpdated(object sender, DataTransferEventArgs e)
{
_viewModel.DataUpdatedCommand.Execute(null);
}
private void BtnPopupBoxOpen_Click(object sender, RoutedEventArgs e)
{
PopupBoxAdjustment.IsPopupOpen = true;
}
private void BtnPopupBoxClose_Click(object sender, RoutedEventArgs e)
{
PopupBoxAdjustment.IsPopupOpen = false;
}
}
}

View file

@ -1,38 +0,0 @@
<UserControl
x:Class="MSFSPopoutPanelManager.MainApp.TouchEnabledButton"
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:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:system="clr-namespace:System;assembly=mscorlib"
mc:Ignorable="d">
<UserControl.Resources>
<system:Double x:Key="IconSize">22</system:Double>
<system:Double x:Key="ButtonSize">28</system:Double>
</UserControl.Resources>
<ToggleButton
Width="{StaticResource ButtonSize}"
Height="{StaticResource ButtonSize}"
materialDesign:ToggleButtonAssist.OnContent="{materialDesign:PackIcon Kind=HandBackRightOutline,
Size={StaticResource IconSize}}"
Background="Transparent"
Command="{Binding TouchEnabledCommand}"
IsChecked="{Binding DataItem.TouchEnabled, Mode=TwoWay}"
KeyboardNavigation.AcceptsReturn="False"
ToolTip="Toggle panel touch capability">
<ToggleButton.Style>
<Style BasedOn="{StaticResource MaterialDesignActionSecondaryToggleButton}" TargetType="ToggleButton">
<Style.Triggers>
<DataTrigger Binding="{Binding DataItem.TouchEnabled}" Value="True">
<Setter Property="Foreground" Value="LimeGreen" />
</DataTrigger>
</Style.Triggers>
</Style>
</ToggleButton.Style>
<materialDesign:PackIcon
Width="{StaticResource IconSize}"
Height="{StaticResource IconSize}"
Kind="HandBackRightOffOutline" />
</ToggleButton>
</UserControl>

View file

@ -1,12 +0,0 @@
using System.Windows.Controls;
namespace MSFSPopoutPanelManager.MainApp
{
public partial class TouchEnabledButton : UserControl
{
public TouchEnabledButton()
{
InitializeComponent();
}
}
}

View file

@ -1,60 +0,0 @@
<UserControl
x:Class="MSFSPopoutPanelManager.MainApp.PopOutPanelList"
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:dd="clr-namespace:GongSolutions.Wpf.DragDrop;assembly=GongSolutions.Wpf.DragDrop"
xmlns:local="clr-namespace:MSFSPopoutPanelManager.MainApp"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<UserControl.Resources>
<local:DummyConverter x:Key="DummyConverter" />
</UserControl.Resources>
<ScrollViewer
Height="350"
materialDesign:ScrollViewerAssist.IsAutoHideEnabled="True"
HorizontalScrollBarVisibility="Hidden"
VerticalScrollBarVisibility="Auto">
<ListView
x:Name="PopOutPanelCardList"
Height="Auto"
Margin="16,0,0,0"
Padding="0"
HorizontalAlignment="Left"
dd:DragDrop.IsDragSource="{c:Binding '!ProfileData.ActiveProfile.IsLocked'}"
dd:DragDrop.IsDropTarget="True"
dd:DragDrop.UseDefaultEffectDataTemplate="True"
ItemsSource="{Binding ProfileData.ActiveProfile.PanelConfigs, Mode=TwoWay}">
<ListView.ItemTemplate>
<DataTemplate>
<local:PopOutPanelCard Height="Auto" DataItem="{Binding '', Converter={StaticResource DummyConverter}}" />
</DataTemplate>
</ListView.ItemTemplate>
<ListView.ItemContainerStyle>
<Style TargetType="ListViewItem">
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderBrush" Value="Transparent" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ListViewItem">
<Border
Name="Border"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}">
<ContentPresenter
Margin="{TemplateBinding Padding}"
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}" />
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ListView.ItemContainerStyle>
</ListView>
</ScrollViewer>
</UserControl>

View file

@ -1,28 +0,0 @@
using System.Globalization;
using System;
using System.Windows.Controls;
using System.Windows.Data;
namespace MSFSPopoutPanelManager.MainApp
{
public partial class PopOutPanelList : UserControl
{
public PopOutPanelList()
{
InitializeComponent();
}
}
public class DummyConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
return value;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
return value;
}
}
}

View file

@ -1,45 +0,0 @@
<UserControl
x:Class="MSFSPopoutPanelManager.MainApp.PopOutPanelListEmpty"
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:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
d:DesignHeight="450"
d:DesignWidth="800"
mc:Ignorable="d">
<StackPanel Height="335" Margin="10,0,10,0">
<StackPanel HorizontalAlignment="Right" Orientation="Vertical">
<materialDesign:PackIcon
Width="40"
Height="40"
Margin="0,0,45,0"
HorizontalAlignment="Right"
Foreground="white"
Kind="ArrowUpBoldOutline" />
<TextBlock
Width="80"
Margin="0,5,24,0"
FontSize="16"
Foreground="gray"
TextAlignment="Center"
TextWrapping="Wrap">
Click here to add
</TextBlock>
</StackPanel>
<TextBlock
Margin="0,35,0,0"
HorizontalAlignment="Center"
FontSize="24"
Foreground="gray">
Add pop out panels to aircraft profile
</TextBlock>
<TextBlock
Margin="0,0,0,0"
HorizontalAlignment="Center"
FontSize="16"
Foreground="gray">
(by identifying instrumetation source panel location in the game)
</TextBlock>
</StackPanel>
</UserControl>

View file

@ -1,12 +0,0 @@
using System.Windows.Controls;
namespace MSFSPopoutPanelManager.MainApp
{
public partial class PopOutPanelListEmpty : UserControl
{
public PopOutPanelListEmpty()
{
InitializeComponent();
}
}
}

View file

@ -1,640 +0,0 @@
<UserControl
x:Class="MSFSPopoutPanelManager.MainApp.PreferenceDrawer"
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:domain="clr-namespace:MSFSPopoutPanelManager.DomainModel;assembly=DomainModel"
xmlns:localcontrol="clr-namespace:MSFSPopoutPanelManager.MainApp.CustomControl"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:viewmodel="clr-namespace:MSFSPopoutPanelManager.MainApp.ViewModel"
Width="1024"
mc:Ignorable="d">
<UserControl.Resources>
<Style
x:Key="TextBlockHeading"
BasedOn="{StaticResource {x:Type TextBlock}}"
TargetType="TextBlock">
<Setter Property="TextWrapping" Value="Wrap" />
<Setter Property="Width" Value="Auto" />
<Setter Property="Margin" Value="0,5,0,0" />
<Setter Property="FontSize" Value="16" />
<Setter Property="FontWeight" Value="Bold" />
</Style>
<Style
x:Key="TextBlockSubheading"
BasedOn="{StaticResource {x:Type TextBlock}}"
TargetType="TextBlock">
<Setter Property="FontSize" Value="16" />
<Setter Property="TextWrapping" Value="Wrap" />
<Setter Property="Width" Value="Auto" />
<Setter Property="Margin" Value="0,5,0,5" />
</Style>
<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="Width" Value="700" />
<Setter Property="Margin" Value="5,0,0,0" />
<Setter Property="LineHeight" Value="20" />
</Style>
<Style TargetType="Line">
<Setter Property="Margin" Value="0,5,0,5" />
</Style>
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
</UserControl.Resources>
<DockPanel d:DataContext="{d:DesignInstance viewmodel:ApplicationViewModel}">
<ScrollViewer HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden">
<TreeView
Width="210"
VerticalAlignment="Stretch"
DockPanel.Dock="Left">
<TreeView.ItemContainerStyle>
<Style TargetType="{x:Type TreeViewItem}">
<Setter Property="IsExpanded" Value="True" />
<Setter Property="Foreground" Value="#666666" />
<Setter Property="Background" Value="Transparent" />
<Style.Resources>
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="Transparent" />
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightTextBrushKey}" Color="White" />
<SolidColorBrush x:Key="{x:Static SystemColors.InactiveSelectionHighlightBrushKey}" Color="Transparent" />
<SolidColorBrush x:Key="{x:Static SystemColors.InactiveSelectionHighlightTextBrushKey}" Color="White" />
</Style.Resources>
</Style>
</TreeView.ItemContainerStyle>
<TreeViewItem
Margin="-5,0,0,10"
Padding="0"
FontSize="14"
FontWeight="Bold"
Foreground="Gray"
Header="Preferences"
IsHitTestVisible="False" />
<TreeViewItem
x:Name="CategoryGeneralSettings"
Margin="0,0,0,10"
Padding="0"
Header="General Settings"
IsSelected="True" />
<TreeViewItem
x:Name="CategoryAutoPopOutPanelSettings"
Margin="0,0,0,10"
Header="Auto Pop Out Panel Settings" />
<TreeViewItem
x:Name="CategoryPopOutSettings"
Margin="0,0,0,10"
Header="Pop Out Settings" />
<TreeViewItem
x:Name="CategoryGameRefocusSettings"
Margin="0,0,0,10"
Header="Game Refocus Settings" />
<TreeViewItem
x:Name="CategoryKeyboardShortcutSettings"
Margin="0,0,0,10"
Header="Keyboard Shortcut Settings" />
<TreeViewItem
x:Name="CategoryTouchSettings"
Margin="0,0,0,10"
Header="Touch Settings" />
<TreeViewItem
x:Name="CategoryTrackIRSettings"
Margin="0,0,0,10"
Header="Track IR Settings" />
<TreeViewItem
x:Name="CategoryWindowedModeSettings"
Margin="0,0,0,10"
Header="Windowed Mode Settings" />
</TreeView>
</ScrollViewer>
<ScrollViewer
Width="780"
Height="565"
VerticalScrollBarVisibility="Auto">
<StackPanel Margin="0,-4,0,0">
<!-- General Settings -->
<WrapPanel Orientation="Vertical" Visibility="{Binding ElementName=CategoryGeneralSettings, Path=IsSelected, Converter={StaticResource BooleanToVisibilityConverter}, Mode=OneWay}">
<WrapPanel
Width="Auto"
Margin="0,0,20,20"
Orientation="Vertical">
<TextBlock Style="{StaticResource TextBlockHeading}">Always on Top</TextBlock>
<Line
Stretch="Fill"
Stroke="Gray"
X2="1" />
<WrapPanel>
<ToggleButton IsChecked="{Binding AppSettingData.ApplicationSetting.GeneralSetting.AlwaysOnTop, Mode=TwoWay}" Style="{StaticResource ToggleButton}" />
<TextBlock Style="{StaticResource TextBlockLabel}">Pin the application on top of all open windows.</TextBlock>
</WrapPanel>
</WrapPanel>
<WrapPanel Margin="0,0,20,20" Orientation="Vertical">
<TextBlock Style="{StaticResource TextBlockHeading}">Auto Start</TextBlock>
<Line
Stretch="Fill"
Stroke="Gray"
X2="1" />
<WrapPanel>
<ToggleButton IsChecked="{Binding AppSettingData.ApplicationSetting.GeneralSetting.AutoStart, Mode=TwoWay}" Style="{StaticResource ToggleButton}" />
<TextBlock Style="{StaticResource TextBlockLabel}">Enable auto start application when MSFS starts. This adds a XML config entry in EXE.xml file.</TextBlock>
</WrapPanel>
</WrapPanel>
<WrapPanel Margin="0,0,20,20" Orientation="Vertical">
<TextBlock Style="{StaticResource TextBlockHeading}">Minimize to Tray</TextBlock>
<Line
Stretch="Fill"
Stroke="Gray"
X2="1" />
<WrapPanel>
<ToggleButton IsChecked="{Binding AppSettingData.ApplicationSetting.GeneralSetting.MinimizeToTray, Mode=TwoWay}" Style="{StaticResource ToggleButton}" />
<TextBlock Style="{StaticResource TextBlockLabel}">Minimize the application to system tray.</TextBlock>
</WrapPanel>
</WrapPanel>
<WrapPanel Margin="0,0,20,20" Orientation="Vertical">
<TextBlock Style="{StaticResource TextBlockHeading}">Start Minimized</TextBlock>
<Line
Stretch="Fill"
Stroke="Gray"
X2="1" />
<WrapPanel>
<ToggleButton IsChecked="{Binding AppSettingData.ApplicationSetting.GeneralSetting.StartMinimized, Mode=TwoWay}" Style="{StaticResource ToggleButton}" />
<TextBlock Style="{StaticResource TextBlockLabel}">Start the application in minimized mode in system tray.</TextBlock>
</WrapPanel>
</WrapPanel>
<WrapPanel Margin="0,0,20,20" Orientation="Vertical">
<TextBlock Style="{StaticResource TextBlockHeading}">Auto Close When Exiting MSFS</TextBlock>
<Line
Stretch="Fill"
Stroke="Gray"
X2="1" />
<WrapPanel>
<ToggleButton IsChecked="{Binding AppSettingData.ApplicationSetting.GeneralSetting.AutoClose, Mode=TwoWay}" Style="{StaticResource ToggleButton}" />
<TextBlock Style="{StaticResource TextBlockLabel}">Automatically close the application when exiting MSFS.</TextBlock>
</WrapPanel>
</WrapPanel>
<WrapPanel Margin="0,0,20,20" Orientation="Vertical">
<TextBlock Style="{StaticResource TextBlockHeading}">Turbo Mode</TextBlock>
<Line
Stretch="Fill"
Stroke="Gray"
X2="1" />
<WrapPanel>
<ToggleButton IsChecked="{Binding AppSettingData.ApplicationSetting.GeneralSetting.TurboMode, Mode=TwoWay}" Style="{StaticResource ToggleButton}" />
<TextBlock Style="{StaticResource TextBlockLabel}">
<Bold>WARNING!</Bold>
This may not work for all PC. Enable turbo mode to pop out panels as fast as possible. If you have a fast PC, this will let Pop Out Panel Manager executes pop out much faster.</TextBlock>
</WrapPanel>
</WrapPanel>
<WrapPanel Margin="0,0,20,20" Orientation="Vertical">
<TextBlock Style="{StaticResource TextBlockHeading}">Check for Update</TextBlock>
<Line
Stretch="Fill"
Stroke="Gray"
X2="1" />
<WrapPanel>
<ToggleButton IsChecked="{Binding AppSettingData.ApplicationSetting.GeneralSetting.CheckForUpdate, Mode=TwoWay}" Style="{StaticResource ToggleButton}" />
<TextBlock Style="{StaticResource TextBlockLabel}">Enable check for application update through Github.</TextBlock>
</WrapPanel>
</WrapPanel>
</WrapPanel>
<!-- Auto Pop Out Panel Settings -->
<WrapPanel Orientation="Vertical" Visibility="{Binding ElementName=CategoryAutoPopOutPanelSettings, Path=IsSelected, Converter={StaticResource BooleanToVisibilityConverter}, Mode=OneWay}">
<WrapPanel Margin="0,0,20,20" Orientation="Vertical">
<TextBlock Style="{StaticResource TextBlockHeading}">Enable Auto Pop Out Panels</TextBlock>
<Line
Stretch="Fill"
Stroke="Gray"
X2="1" />
<WrapPanel>
<ToggleButton IsChecked="{Binding AppSettingData.ApplicationSetting.AutoPopOutSetting.IsEnabled, Mode=TwoWay}" Style="{StaticResource ToggleButton}" />
<TextBlock Style="{StaticResource TextBlockLabel}">Automatic pop out panels when an aircraft livery is bound to a profile. The following steps will be performed.</TextBlock>
</WrapPanel>
<StackPanel Margin="34,0,0,0" Orientation="Vertical">
<TextBlock Margin="0,10,0,0" Style="{StaticResource TextBlockLabel}">
1. Detect flight start signal using SimConnect.
</TextBlock>
<TextBlock Margin="0,10,0,0" Style="{StaticResource TextBlockLabel}">
2. Wait for cockpit view to appear before executing pop out panel sequence.
</TextBlock>
<TextBlock Margin="0,10,0,0" Style="{StaticResource TextBlockLabel}">
3. If configured for profile on cold start, execute and detect instrumentation power on before executing pop out panel sequence.
</TextBlock>
</StackPanel>
</WrapPanel>
<WrapPanel Margin="0,0,20,20" Orientation="Vertical">
<TextBlock Style="{StaticResource TextBlockHeading}">Auto Pop Out Panel Delay</TextBlock>
<Line
Stretch="Fill"
Stroke="Gray"
X2="1" />
<StackPanel Orientation="Horizontal">
<localcontrol:NumericUpDown
Width="90"
Height="24"
FontSize="12"
Increment="1"
MaxValue="10"
MinValue="0"
Value="{Binding AppSettingData.ApplicationSetting.AutoPopOutSetting.ReadyToFlyDelay, Mode=TwoWay}" />
<TextBlock
Width="640"
Margin="10,0,0,0"
Style="{StaticResource TextBlockLabel}"
TextWrapping="Wrap">
Amount of time in seconds to delay auto pop out panels from starting after ready to fly button has been pressed automatically. Extending this delay helps resolve auto pop out failure because cockpit has not been loaded completely yet on slower PC.
</TextBlock>
</StackPanel>
</WrapPanel>
</WrapPanel>
<!-- Pop Out Settings -->
<WrapPanel Orientation="Vertical" Visibility="{Binding ElementName=CategoryPopOutSettings, Path=IsSelected, Converter={StaticResource BooleanToVisibilityConverter}, Mode=OneWay}">
<WrapPanel Margin="0,0,20,0" Orientation="Vertical">
<WrapPanel Orientation="Vertical">
<TextBlock Style="{StaticResource TextBlockHeading}">Enable Auto Panning</TextBlock>
<Line
Stretch="Fill"
Stroke="Gray"
X2="1" />
<WrapPanel>
<ToggleButton IsChecked="{Binding AppSettingData.ApplicationSetting.PopOutSetting.AutoPanning.IsEnabled, Mode=TwoWay}" Style="{StaticResource ToggleButton}" />
<TextBlock Style="{StaticResource TextBlockLabel}">Enable automatic panning of cockpit view when popping out panels. Auto Panning remembers the custom cockpit camera angle you used when defining the locations of pop out panel.</TextBlock>
</WrapPanel>
</WrapPanel>
<WrapPanel Orientation="Vertical" Visibility="{Binding AppSettingData.ApplicationSetting.PopOutSetting.AutoPanning.IsEnabled, Converter={StaticResource BooleanToVisibilityConverter}, Mode=OneWay}">
<StackPanel
Width="Auto"
Margin="44,15,0,0"
VerticalAlignment="Top"
Orientation="Horizontal">
<WrapPanel>
<Label Content="Ctrl-Alt-" FontSize="14" />
<ComboBox
Width="35"
VerticalAlignment="top"
SelectedValue="{Binding AppSettingData.ApplicationSetting.PopOutSetting.AutoPanning.KeyBinding, Mode=TwoWay}"
SelectedValuePath="Tag">
<ComboBoxItem Content="0" Tag="0" />
<ComboBoxItem Content="1" Tag="1" />
<ComboBoxItem Content="2" Tag="2" />
<ComboBoxItem Content="3" Tag="3" />
<ComboBoxItem Content="4" Tag="4" />
<ComboBoxItem Content="5" Tag="5" />
<ComboBoxItem Content="6" Tag="6" />
<ComboBoxItem Content="7" Tag="7" />
<ComboBoxItem Content="8" Tag="8" />
<ComboBoxItem Content="9" Tag="9" />
</ComboBox>
</WrapPanel>
<TextBlock
Width="600"
Margin="10,3,0,0"
Style="{StaticResource TextBlockLabel}">
Configure key binding for saving and recalling of custom MSFS cockpit camera view when defining the locations of pop out panel. Requires binding keystroke to custom camera in MSFS control setting. (Default: Ctrl-Alt-0 to save and Alt-0 to load).
</TextBlock>
</StackPanel>
</WrapPanel>
</WrapPanel>
<WrapPanel Margin="0,20,20,0" Orientation="Vertical">
<TextBlock Style="{StaticResource TextBlockHeading}">Minimize Pop Out Panel Manager During Pop Out</TextBlock>
<Line
Stretch="Fill"
Stroke="Gray"
X2="1" />
<WrapPanel>
<ToggleButton IsChecked="{Binding AppSettingData.ApplicationSetting.PopOutSetting.MinimizeDuringPopOut, Mode=TwoWay}" Style="{StaticResource ToggleButton}" />
<TextBlock Style="{StaticResource TextBlockLabel}">Minimize Pop Out Panel Manager during pop out process.</TextBlock>
</WrapPanel>
</WrapPanel>
<WrapPanel Margin="0,20,20,0" Orientation="Vertical">
<TextBlock Style="{StaticResource TextBlockHeading}">Minimize Pop Out Panel Manager After Pop Out</TextBlock>
<Line
Stretch="Fill"
Stroke="Gray"
X2="1" />
<WrapPanel>
<ToggleButton IsChecked="{Binding AppSettingData.ApplicationSetting.PopOutSetting.MinimizeAfterPopOut, Mode=TwoWay}" Style="{StaticResource ToggleButton}" />
<TextBlock Style="{StaticResource TextBlockLabel}">Minimize Pop Out Panel Manager after all panels have been popped out.</TextBlock>
</WrapPanel>
</WrapPanel>
<WrapPanel Margin="0,20,20,0" Orientation="Vertical">
<TextBlock Style="{StaticResource TextBlockHeading}">Enable Active Pause</TextBlock>
<Line
Stretch="Fill"
Stroke="Gray"
X2="1" />
<WrapPanel>
<ToggleButton IsChecked="{Binding AppSettingData.ApplicationSetting.PopOutSetting.AutoActivePause, Mode=TwoWay}" Style="{StaticResource ToggleButton}" />
<TextBlock Style="{StaticResource TextBlockLabel}">Enable active pause when panels are being popped out.</TextBlock>
</WrapPanel>
</WrapPanel>
<WrapPanel Margin="0,20,20,0" Orientation="Vertical">
<WrapPanel Orientation="Vertical">
<TextBlock Style="{StaticResource TextBlockHeading}">Enable Return to Predefined Camera View After Pop Out</TextBlock>
<Line
Stretch="Fill"
Stroke="Gray"
X2="1" />
<WrapPanel>
<ToggleButton IsChecked="{Binding AppSettingData.ApplicationSetting.PopOutSetting.AfterPopOutCameraView.IsEnabled, Mode=TwoWay}" Style="{StaticResource ToggleButton}" />
<TextBlock Style="{StaticResource TextBlockLabel}">Enable return to a predefined camera view after pop out.</TextBlock>
</WrapPanel>
</WrapPanel>
<WrapPanel Orientation="Vertical" Visibility="{Binding AppSettingData.ApplicationSetting.PopOutSetting.AfterPopOutCameraView.IsEnabled, Converter={StaticResource BooleanToVisibilityConverter}, Mode=OneWay}">
<WrapPanel Margin="46,10,0,0" Orientation="Horizontal">
<ComboBox
Width="160"
HorizontalAlignment="Left"
VerticalAlignment="Center"
SelectedValue="{Binding AppSettingData.ApplicationSetting.PopOutSetting.AfterPopOutCameraView.CameraView, Mode=TwoWay}"
SelectedValuePath="Tag">
<ComboBoxItem Content="Cockpit Center View" Tag="CockpitCenterView" />
<ComboBoxItem Content="Custom Camera View" Tag="CustomCameraView" />
</ComboBox>
</WrapPanel>
</WrapPanel>
<WrapPanel Orientation="Vertical" Visibility="{Binding AppSettingData.ApplicationSetting.PopOutSetting.AfterPopOutCameraView.IsEnabledCustomCameraKeyBinding, Converter={StaticResource BooleanToVisibilityConverter}, Mode=OneWay}">
<StackPanel Margin="44,10,0,0" Orientation="Horizontal">
<Label Content="Alt-" FontSize="14" />
<ComboBox
Width="35"
HorizontalAlignment="Left"
VerticalAlignment="Top"
SelectedValue="{Binding AppSettingData.ApplicationSetting.PopOutSetting.AfterPopOutCameraView.KeyBinding, Mode=TwoWay}"
SelectedValuePath="Tag">
<ComboBoxItem Content="0" Tag="0" />
<ComboBoxItem Content="1" Tag="1" />
<ComboBoxItem Content="2" Tag="2" />
<ComboBoxItem Content="3" Tag="3" />
<ComboBoxItem Content="4" Tag="4" />
<ComboBoxItem Content="5" Tag="5" />
<ComboBoxItem Content="6" Tag="6" />
<ComboBoxItem Content="7" Tag="7" />
<ComboBoxItem Content="8" Tag="8" />
<ComboBoxItem Content="9" Tag="9" />
</ComboBox>
<TextBlock
Width="620"
Margin="10,3,0,0"
Style="{StaticResource TextBlockLabel}">
Configure key binding for custom camera view to load. Requires binding keystroke to custom camera in MSFS control setting. (Default: Alt-1 to load).
</TextBlock>
</StackPanel>
</WrapPanel>
</WrapPanel>
<WrapPanel Margin="0,20,20,0" Orientation="Vertical">
<TextBlock Style="{StaticResource TextBlockHeading}">Enable Tracking of Panels When Profile Is Locked</TextBlock>
<Line
Stretch="Fill"
Stroke="Gray"
X2="1" />
<WrapPanel>
<ToggleButton IsChecked="{Binding AppSettingData.ApplicationSetting.PopOutSetting.EnablePanelResetWhenLocked, Mode=TwoWay}" Style="{StaticResource ToggleButton}" />
<TextBlock Style="{StaticResource TextBlockLabel}">
Enable tracking of panels to allow panel to go back to its original location when move if the profile is locked. Disable this setting will allow panel to be moved when profile is locked
but the profile setting will be unchanged. With this setting disable, Pop Out Panel Manager will no longer detect pop out panel's movement when profile is locked which may save some CPU cycles.
</TextBlock>
</WrapPanel>
</WrapPanel>
<WrapPanel Margin="0,20,20,0" Orientation="Vertical">
<TextBlock Style="{StaticResource TextBlockHeading}">Enable Pop Out Progress Messages</TextBlock>
<Line
Stretch="Fill"
Stroke="Gray"
X2="1" />
<WrapPanel>
<ToggleButton IsChecked="{Binding AppSettingData.ApplicationSetting.PopOutSetting.EnablePopOutMessages, Mode=TwoWay}" Style="{StaticResource ToggleButton}" />
<TextBlock Style="{StaticResource TextBlockLabel}">Enable display of pop out progress messages</TextBlock>
</WrapPanel>
</WrapPanel>
<WrapPanel Margin="0,20,20,20" Orientation="Vertical">
<TextBlock Style="{StaticResource TextBlockHeading}">Pop Out Title Bar Color Customization</TextBlock>
<Line
Stretch="Fill"
Stroke="Gray"
X2="1" />
<WrapPanel>
<ToggleButton
x:Name="TglBtnPopOutColorCustomizationEnable"
IsChecked="{Binding AppSettingData.ApplicationSetting.PopOutSetting.PopOutTitleBarCustomization.IsEnabled, Mode=TwoWay}"
Style="{StaticResource ToggleButton}" />
<TextBlock Style="{StaticResource TextBlockLabel}">
Enable setting the color of title bar for pop out panel. The color is set in Hexidemical format of RGB color (RRGGBB). For example, black is "#000000" and white is "#FFFFFF".
</TextBlock>
</WrapPanel>
<WrapPanel Visibility="{Binding AppSettingData.ApplicationSetting.PopOutSetting.PopOutTitleBarCustomization.IsEnabled, Converter={StaticResource BooleanToVisibilityConverter}, Mode=OneWay}">
<Label Margin="42,10,0,0">Color:</Label>
<Label Margin="0,10,0,0">#</Label>
<TextBox
Width="50"
Height="22"
Margin="0,10,0,0"
VerticalAlignment="Top"
materialDesign:TextFieldAssist.CharacterCounterVisibility="Hidden"
AcceptsReturn="False"
IsEnabled="{Binding Path=IsChecked, ElementName=TglBtnPopOutColorCustomizationEnable}"
MaxLength="6"
Style="{StaticResource MaterialDesignTextBox}"
Text="{Binding AppSettingData.ApplicationSetting.PopOutSetting.PopOutTitleBarCustomization.HexColor, Mode=TwoWay}" />
</WrapPanel>
</WrapPanel>
<WrapPanel Margin="0,0,20,20" Orientation="Vertical">
<TextBlock Style="{StaticResource TextBlockHeading}">Use Left Control + Right Control to Pop Out Panel</TextBlock>
<Line
Stretch="Fill"
Stroke="Gray"
X2="1" />
<WrapPanel>
<ToggleButton IsChecked="{Binding AppSettingData.ApplicationSetting.PopOutSetting.UseLeftRightControlToPopOut, Mode=TwoWay}" Style="{StaticResource ToggleButton}" />
<TextBlock Style="{StaticResource TextBlockLabel}">
If your keyboard does not have a Right-Alt key to perform left click to pop out panel, you can map Left Ctrl + Right Ctrl in MSFS control setting to pop out
panel instead. For this feature to work, please map (CTRL + RIGHT CTRL) in Control Options => Miscellaneous => New UI Window Mode in the game
</TextBlock>
</WrapPanel>
</WrapPanel>
</WrapPanel>
<!-- Game Refocus Settings -->
<WrapPanel Orientation="Vertical" Visibility="{Binding ElementName=CategoryGameRefocusSettings, Path=IsSelected, Converter={StaticResource BooleanToVisibilityConverter}, Mode=OneWay}">
<WrapPanel Margin="0,0,20,20" Orientation="Vertical">
<TextBlock Style="{StaticResource TextBlockHeading}">Refocus Game Window</TextBlock>
<Line
Stretch="Fill"
Stroke="Gray"
X2="1" />
<WrapPanel>
<ToggleButton IsChecked="{Binding AppSettingData.ApplicationSetting.RefocusSetting.RefocusGameWindow.IsEnabled, Mode=TwoWay}" Style="{StaticResource ToggleButton}" />
<TextBlock Style="{StaticResource TextBlockLabel}">Automactically set focus back to game window after a period of inactivity when either clicking on a panel or touching a panel when touch feature is enabled. This will give you flight control back when using pop out panel to overcome the current MSFS limitation. This setting needs to be enabled for each profile and each pop out panel's automatic refocus setting to work.</TextBlock>
</WrapPanel>
<StackPanel
Margin="46,10,0,0"
Orientation="Horizontal"
Visibility="{Binding AppSettingData.ApplicationSetting.RefocusSetting.RefocusGameWindow.IsEnabled, Converter={StaticResource BooleanToVisibilityConverter}, Mode=OneWay}">
<localcontrol:NumericUpDown
Width="90"
Height="24"
FontSize="12"
Increment="0.1"
MaxValue="10"
MinValue="0.5"
Places="1"
Value="{Binding AppSettingData.ApplicationSetting.RefocusSetting.RefocusGameWindow.Delay, Mode=TwoWay}" />
<TextBlock
Width="620"
Margin="10,0,0,0"
Style="{StaticResource TextBlockLabel}">
Amount of time in seconds to wait for touch inactivity before input focus goes back to game window.
</TextBlock>
</StackPanel>
</WrapPanel>
</WrapPanel>
<!-- Keyboard Shortcut Settings -->
<WrapPanel Orientation="Vertical" Visibility="{Binding ElementName=CategoryKeyboardShortcutSettings, Path=IsSelected, Converter={StaticResource BooleanToVisibilityConverter}, Mode=OneWay}">
<WrapPanel Margin="0,0,20,0" Orientation="Vertical">
<WrapPanel Orientation="Vertical">
<TextBlock Style="{StaticResource TextBlockHeading}">Keyboard Shortcuts</TextBlock>
<Line
Stretch="Fill"
Stroke="Gray"
X2="1" />
<WrapPanel>
<ToggleButton IsChecked="{Binding AppSettingData.ApplicationSetting.KeyboardShortcutSetting.IsEnabled, Mode=TwoWay}" Style="{StaticResource ToggleButton}" />
<TextBlock Style="{StaticResource TextBlockLabel}">Enable using of keyboard shortcuts to control application.</TextBlock>
</WrapPanel>
</WrapPanel>
<WrapPanel Orientation="Vertical" Visibility="{Binding AppSettingData.ApplicationSetting.KeyboardShortcutSetting.IsEnabled, Converter={StaticResource BooleanToVisibilityConverter}, Mode=OneWay}">
<StackPanel
Width="Auto"
Margin="44,15,0,0"
VerticalAlignment="Top"
Orientation="Horizontal">
<WrapPanel>
<Label Content="Ctrl-Shift-" FontSize="14" />
<ComboBox
Width="40"
VerticalAlignment="top"
SelectedValue="{Binding AppSettingData.ApplicationSetting.KeyboardShortcutSetting.StartPopOutKeyBinding, Mode=TwoWay}"
SelectedValuePath="Tag">
<ComboBoxItem Content="A" Tag="A" />
<ComboBoxItem Content="B" Tag="B" />
<ComboBoxItem Content="C" Tag="C" />
<ComboBoxItem Content="D" Tag="D" />
<ComboBoxItem Content="E" Tag="E" />
<ComboBoxItem Content="F" Tag="F" />
<ComboBoxItem Content="G" Tag="G" />
<ComboBoxItem Content="H" Tag="H" />
<ComboBoxItem Content="I" Tag="I" />
<ComboBoxItem Content="J" Tag="J" />
<ComboBoxItem Content="K" Tag="K" />
<ComboBoxItem Content="L" Tag="L" />
<ComboBoxItem Content="M" Tag="M" />
<ComboBoxItem Content="N" Tag="N" />
<ComboBoxItem Content="O" Tag="O" />
<ComboBoxItem Content="P" Tag="P" />
<ComboBoxItem Content="Q" Tag="Q" />
<ComboBoxItem Content="R" Tag="R" />
<ComboBoxItem Content="S" Tag="S" />
<ComboBoxItem Content="T" Tag="T" />
<ComboBoxItem Content="U" Tag="U" />
<ComboBoxItem Content="V" Tag="V" />
<ComboBoxItem Content="W" Tag="W" />
<ComboBoxItem Content="X" Tag="X" />
<ComboBoxItem Content="Y" Tag="Y" />
<ComboBoxItem Content="Z" Tag="Z" />
</ComboBox>
</WrapPanel>
<TextBlock
Width="600"
Margin="10,3,0,0"
Style="{StaticResource TextBlockLabel}">
Configure key binding to initiate start pop out.
</TextBlock>
</StackPanel>
</WrapPanel>
</WrapPanel>
</WrapPanel>
<!-- Touch Settings -->
<WrapPanel Orientation="Vertical" Visibility="{Binding ElementName=CategoryTouchSettings, Path=IsSelected, Converter={StaticResource BooleanToVisibilityConverter}, Mode=OneWay}">
<WrapPanel Margin="0,0,20,20" Orientation="Vertical">
<TextBlock Style="{StaticResource TextBlockHeading}">Touch Down Touch Up Delay</TextBlock>
<Line
Stretch="Fill"
Stroke="Gray"
X2="1" />
<WrapPanel>
<localcontrol:NumericUpDown
Width="90"
Height="24"
FontSize="12"
Increment="5"
MaxValue="100"
MinValue="0"
Value="{Binding AppSettingData.ApplicationSetting.TouchSetting.TouchDownUpDelay, Mode=TwoWay}" />
<TextBlock
Width="630"
Margin="10,0,0,0"
Style="{StaticResource TextBlockLabel}">
Amount of time in milliseconds to delay touch down and then touch up event when operating touch enabled panel. If your touch is not registering consistently, increasing this value may help.
</TextBlock>
<TextBlock
Margin="0,10,0,0"
FontSize="14"
TextWrapping="Wrap">
For panel display on direct connected touch monitor, 0 milliseconds work really well.<LineBreak /><LineBreak />
For panel display on a tablet using software such as Spacedesk, since there is higher latency for touch signal, increasing this value 5ms at a time may compensate for this latency.</TextBlock>
</WrapPanel>
</WrapPanel>
</WrapPanel>
<!-- TrackIR Settings -->
<WrapPanel Orientation="Vertical" Visibility="{Binding ElementName=CategoryTrackIRSettings, Path=IsSelected, Converter={StaticResource BooleanToVisibilityConverter}, Mode=OneWay}">
<WrapPanel Margin="0,0,20,20" Orientation="Vertical">
<TextBlock Style="{StaticResource TextBlockHeading}">Auto Disable Track IR</TextBlock>
<Line
Stretch="Fill"
Stroke="Gray"
X2="1" />
<WrapPanel>
<ToggleButton IsChecked="{Binding AppSettingData.ApplicationSetting.TrackIRSetting.AutoDisableTrackIR, Mode=TwoWay}" Style="{StaticResource ToggleButton}" />
<TextBlock Style="{StaticResource TextBlockLabel}">Automactically disable Track IR during panel selections and pop out process. Track IR will be re-enabled once these processes are completed.</TextBlock>
</WrapPanel>
</WrapPanel>
</WrapPanel>
<!-- Windowed Mode Settings -->
<WrapPanel Orientation="Vertical" Visibility="{Binding ElementName=CategoryWindowedModeSettings, Path=IsSelected, Converter={StaticResource BooleanToVisibilityConverter}, Mode=OneWay}">
<WrapPanel Margin="0,0,20,20" Orientation="Vertical">
<TextBlock Style="{StaticResource TextBlockHeading}">Auto Resize MSFS Game Window (Used with Windowed Display Mode only)</TextBlock>
<Line
Stretch="Fill"
Stroke="Gray"
X2="1" />
<WrapPanel>
<ToggleButton IsChecked="{Binding AppSettingData.ApplicationSetting.WindowedModeSetting.AutoResizeMsfsGameWindow, Mode=TwoWay}" Style="{StaticResource ToggleButton}" />
<TextBlock Style="{StaticResource TextBlockLabel}">
Enable automatic resize of MSFS game window when using Windowed Display Mode. When playing the game in Windowed Display Mode, this setting is used to resize game window to match original size
and location when panel profile was initially defined. When this setting is first checked, current game window size and location will also be saved automatically.
</TextBlock>
</WrapPanel>
</WrapPanel>
</WrapPanel>
</StackPanel>
</ScrollViewer>
</DockPanel>
</UserControl>

View file

@ -1,12 +0,0 @@
using System.Windows.Controls;
namespace MSFSPopoutPanelManager.MainApp
{
public partial class PreferenceDrawer : UserControl
{
public PreferenceDrawer()
{
InitializeComponent();
}
}
}

View file

@ -1,461 +0,0 @@
<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="TxtBlockDisableWhenLockedInner"
BasedOn="{StaticResource TextBlockLabel}"
TargetType="TextBlock">
<Style.Triggers>
<DataTrigger Binding="{Binding DataContext.ProfileData.ActiveProfile.IsLocked, RelativeSource={RelativeSource AncestorType=UserControl, Mode=FindAncestor}}" 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 ? &quot;Aircraft binding information is currently unavailable&quot; : 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 &#x0a;to pop out the instrumentation panels. After pop out is completed, Pop Out Manager will then &#x0a;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 Margin="0,8,0,0" Orientation="Vertical">
<WrapPanel>
<ToggleButton
IsChecked="{Binding ProfileData.ActiveProfile.ProfileSetting.RefocusOnDisplay.IsEnabled, Mode=TwoWay, NotifyOnTargetUpdated=True}"
IsEnabled="{c:Binding '!ProfileData.ActiveProfile.IsLocked',
Mode=OneWay}"
Style="{StaticResource ToggleButton}"
TargetUpdated="AddRefocusDisplay_TargetUpdated" />
<TextBlock Style="{StaticResource TxtBlockDisableWhenLocked}" ToolTip="Automactically set focus back to game window after a period of inactivity after touching the designated monitor. This is overcome a bug in MSFS where NVidia frame generation does not work when focus is not in the game window.">Enable entire monitor display to have game refocus function when touch</TextBlock>
</WrapPanel>
<WrapPanel
Margin="36,0,0,0"
IsEnabled="{c:Binding !ProfileData.ActiveProfile.IsLocked}"
Orientation="Horizontal"
Visibility="{Binding ProfileData.ActiveProfile.ProfileSetting.RefocusOnDisplay.IsEnabled, Converter={StaticResource BooleanToVisibilityConverter}, Mode=OneWay}">
<WrapPanel Orientation="Vertical" Visibility="{Binding ProfileData.ActiveProfile.ProfileSetting.RefocusOnDisplay.IsEnabled, Converter={StaticResource BooleanToVisibilityConverter}, Mode=OneWay}">
<ItemsControl
Margin="0"
Padding="8"
ItemsSource="{Binding ProfileData.ActiveProfile.ProfileSetting.RefocusOnDisplay.Monitors, Mode=TwoWay}">
<ItemsControl.ItemTemplate>
<DataTemplate DataType="{x:Type domain:MonitorInfo}">
<WrapPanel Margin="0,0,0,4" Orientation="Horizontal">
<CheckBox
VerticalAlignment="Center"
Command="{Binding DataContext.RefocusDisplaySelectionUpdatedCommand, RelativeSource={RelativeSource AncestorType=UserControl, Mode=FindAncestor}}"
CommandParameter="{Binding Name}"
IsChecked="{Binding IsSelected, Mode=TwoWay}" />
<WrapPanel
Margin="8,0,0,0"
VerticalAlignment="Center"
Orientation="Horizontal">
<TextBlock
Margin="0,0,5,0"
FontWeight="Bold"
Style="{StaticResource TxtBlockDisableWhenLockedInner}"
Text="{Binding Name}" />
<TextBlock Style="{StaticResource TxtBlockDisableWhenLockedInner}" Text="(" />
<TextBlock Style="{StaticResource TxtBlockDisableWhenLockedInner}" Text="{Binding Width}" />
<TextBlock Style="{StaticResource TxtBlockDisableWhenLockedInner}" Text="x" />
<TextBlock Style="{StaticResource TxtBlockDisableWhenLockedInner}" Text="{Binding Height}" />
<TextBlock Style="{StaticResource TxtBlockDisableWhenLockedInner}" Text=")" />
</WrapPanel>
</WrapPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</WrapPanel>
<Button
Width="160"
Margin="20,0,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Command="{Binding RefocusDisplayRefreshedCommand}"
Style="{StaticResource MaterialDesignOutlinedLightButton}">
Refresh Display List
</Button>
</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>

View file

@ -1,77 +0,0 @@
using Microsoft.Extensions.DependencyInjection;
using MSFSPopoutPanelManager.DomainModel.Profile;
using MSFSPopoutPanelManager.MainApp.ViewModel;
using System;
using System.Globalization;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Data;
using System.Windows.Input;
namespace MSFSPopoutPanelManager.MainApp
{
public partial class ProfileCard : UserControl
{
private ProfileCardViewModel? _viewModel;
public ProfileCard()
{
_viewModel = App.AppHost.Services.GetRequiredService<ProfileCardViewModel>();
InitializeComponent();
Loaded += (sender, e) => { DataContext = _viewModel; };
}
private void ToggleButtonEditProfileTitle_Click(object sender, RoutedEventArgs e)
{
ToggleButton? toggleButton = sender as ToggleButton;
if (toggleButton != null && toggleButton.IsChecked != null && (bool)toggleButton.IsChecked)
{
TxtBoxProfileTitle.Dispatcher.BeginInvoke(new Action(() => TxtBoxProfileTitle.Focus()));
TxtBoxProfileTitle.Dispatcher.BeginInvoke(new Action(() => TxtBoxProfileTitle.SelectAll()));
}
}
private void TxtBoxProfileTitle_KeyDown(object sender, KeyEventArgs e)
{
if (e.Key == Key.Enter)
{
ToggleButtonEditProfileTitle.IsChecked = false;
Keyboard.ClearFocus();
FocusManager.SetFocusedElement(FocusManager.GetFocusScope(rootCard), rootCard as IInputElement);
}
}
private void IncludeInGamePanel_TargetUpdated(object sender, DataTransferEventArgs e)
{
_viewModel.IncludeInGamePanelUpdatedCommand.Execute(null);
}
private void AddHudBar_TargetUpdated(object sender, DataTransferEventArgs e)
{
_viewModel.AddHudBarUpdatedCommand.Execute(null);
}
private void AddRefocusDisplay_TargetUpdated(object sender, DataTransferEventArgs e)
{
_viewModel.RefocusDisplayUpdatedCommand.Execute(null);
}
}
[ValueConversion(typeof(DateTime), typeof(String))]
public class StringToHudBarTypeConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
return value.ToString().Replace("_", " ");
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
string data = value.ToString();
return Enum.Parse<HudBarType>(data.Replace(" ", "_"));
}
}
}

View file

@ -1,44 +0,0 @@
<UserControl
x:Class="MSFSPopoutPanelManager.MainApp.ProfileCardEmpty"
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:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:viewmodel="clr-namespace:MSFSPopoutPanelManager.MainApp.ViewModel"
Width="900"
Height="535"
mc:Ignorable="d">
<Grid d:DataContext="{d:DesignInstance viewmodel:ProfileCardViewModel}">
<materialDesign:Card
Width="900"
Height="535"
UniformCornerRadius="16">
<StackPanel>
<StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
<TextBlock
Margin="0,16,5,0"
HorizontalAlignment="Center"
FontSize="16"
Foreground="gray">
Click here to start
</TextBlock>
<materialDesign:PackIcon
Width="40"
Height="40"
Margin="0,5,0,0"
HorizontalAlignment="Right"
Foreground="white"
Kind="ArrowRightBoldOutline" />
</StackPanel>
<TextBlock
Margin="0,210,0,0"
HorizontalAlignment="Center"
FontSize="24"
Foreground="gray">
Get started by adding a new aircraft profile
</TextBlock>
</StackPanel>
</materialDesign:Card>
</Grid>
</UserControl>

View file

@ -1,12 +0,0 @@
using System.Windows.Controls;
namespace MSFSPopoutPanelManager.MainApp
{
public partial class ProfileCardEmpty : UserControl
{
public ProfileCardEmpty()
{
InitializeComponent();
}
}
}

View file

@ -1,148 +0,0 @@
<UserControl
x:Class="MSFSPopoutPanelManager.MainApp.ProfileCardList"
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:dotNetKitControls="clr-namespace:DotNetKit.Windows.Controls;assembly=DotNetKit.Wpf.AutoCompleteComboBox"
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
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="1024"
mc:Ignorable="d">
<UserControl.Resources>
<system:Double x:Key="IconSize">22</system:Double>
<system:Double x:Key="ButtonSize">28</system:Double>
</UserControl.Resources>
<StackPanel d:DataContext="{d:DesignInstance viewmodel:ProfileCardListViewModel}" Orientation="Horizontal">
<DockPanel Width="62">
<Button
Width="{StaticResource ButtonSize}"
Height="{StaticResource ButtonSize}"
Margin="6,0,0,0"
Command="{Binding PreviousProfileCommand}"
IsEnabled="{c:Binding 'ProfileData.Profiles.Count > 1'}"
Style="{StaticResource MaterialDesignFloatingActionDarkButton}"
ToolTip="Previous aircraft profile">
<materialDesign:PackIcon
Width="{StaticResource IconSize}"
Height="{StaticResource IconSize}"
Kind="ChevronLeft" />
</Button>
</DockPanel>
<DockPanel Width="900">
<materialDesign:Transitioner x:Name="TransitionProfile" SelectedIndex="{Binding ProfileTransitionIndex}">
<materialDesign:TransitionerSlide x:Name="Slide1" ClipToBounds="True">
<materialDesign:TransitionerSlide.ForwardWipe>
<materialDesign:SlideWipe Duration="0:0:0.8" />
</materialDesign:TransitionerSlide.ForwardWipe>
<materialDesign:TransitionerSlide.BackwardWipe>
<materialDesign:SlideWipe Duration="0:0:0.8" />
</materialDesign:TransitionerSlide.BackwardWipe>
<materialDesign:TransitionerSlide.OpeningEffects>
<materialDesign:TransitionEffect Kind="SlideInFromRight" Duration="0:0:0.8" />
</materialDesign:TransitionerSlide.OpeningEffects>
<StackPanel>
<local:ProfileCardEmpty Visibility="{c:Binding 'ProfileData.Profiles.Count == 0'}" />
<local:ProfileCard Visibility="{c:Binding 'ProfileData.Profiles.Count > 0'}" />
</StackPanel>
</materialDesign:TransitionerSlide>
<materialDesign:TransitionerSlide x:Name="Slide2" ClipToBounds="True">
<materialDesign:TransitionerSlide.ForwardWipe>
<materialDesign:SlideWipe Duration="0:0:0.8" />
</materialDesign:TransitionerSlide.ForwardWipe>
<materialDesign:TransitionerSlide.BackwardWipe>
<materialDesign:SlideWipe Duration="0:0:0.8" />
</materialDesign:TransitionerSlide.BackwardWipe>
<materialDesign:TransitionerSlide.OpeningEffects>
<materialDesign:TransitionEffect Kind="SlideInFromRight" Duration="0:0:0.8" />
</materialDesign:TransitionerSlide.OpeningEffects>
<StackPanel>
<local:ProfileCardEmpty Visibility="{c:Binding 'ProfileData.Profiles.Count == 0'}" />
<local:ProfileCard Visibility="{c:Binding 'ProfileData.Profiles.Count > 0'}" />
</StackPanel>
</materialDesign:TransitionerSlide>
</materialDesign:Transitioner>
</DockPanel>
<DockPanel Width="62" Margin="-5,10,0,0">
<StackPanel Orientation="Vertical">
<Button
Width="{StaticResource ButtonSize}"
Height="{StaticResource ButtonSize}"
Command="{Binding AddProfileCommand}"
Style="{StaticResource MaterialDesignFloatingActionDarkButton}"
ToolTip="Add a new aircraft profile">
<materialDesign:PackIcon
Width="18"
Height="18"
Kind="FilePlusOutline" />
</Button>
<materialDesign:PopupBox
x:Name="PopupBoxFinder"
Margin="16,16,0,0"
materialDesign:ElevationAssist.Elevation="Dp0"
IsEnabled="{c:Binding 'ProfileData.Profiles.Count > 1'}"
PlacementMode="LeftAndAlignMiddles"
PopupHorizontalOffset="-10"
PopupUniformCornerRadius="4"
Style="{StaticResource MaterialDesignPopupBox}">
<materialDesign:PopupBox.ToggleContent>
<Button
Width="{StaticResource ButtonSize}"
Height="{StaticResource ButtonSize}"
Margin="0"
Padding="0"
Click="BtnPopupBoxFinder_Click"
Style="{StaticResource MaterialDesignFloatingActionDarkButton}"
ToolTip="Find an aircraft profile">
<materialDesign:PackIcon
Width="{StaticResource IconSize}"
Height="{StaticResource IconSize}"
Foreground="White"
Kind="Magnify" />
</Button>
</materialDesign:PopupBox.ToggleContent>
<dotNetKitControls:AutoCompleteComboBox
x:Name="ComboBoxSearchProfile"
Width="250"
Margin="5,0,5,0"
Padding="5,0,5,0"
materialDesign:ComboBoxAssist.MaxLength="20"
materialDesign:HintAssist.Hint="Search Profile"
materialDesign:HintAssist.HintOpacity="0.3"
DisplayMemberPath="Name"
Foreground="White"
ItemsSource="{Binding ProfileData.Profiles}"
MaxDropDownHeight="400"
SelectedItem="{Binding SearchProfileSelectedItem}"
SelectedValuePath="Id"
Style="{StaticResource MaterialDesignComboBox}"
TextSearch.TextPath="Name">
<i:Interaction.Triggers>
<i:EventTrigger EventName="SelectionChanged">
<i:InvokeCommandAction Command="{Binding SearchProfileSelectedCommand}" />
</i:EventTrigger>
</i:Interaction.Triggers>
</dotNetKitControls:AutoCompleteComboBox>
</materialDesign:PopupBox>
<Button
Width="{StaticResource ButtonSize}"
Height="{StaticResource ButtonSize}"
Margin="0,170,0,0"
Command="{Binding NextProfileCommand}"
DockPanel.Dock="Top"
IsEnabled="{c:Binding 'ProfileData.Profiles.Count > 1'}"
Style="{StaticResource MaterialDesignFloatingActionDarkButton}"
ToolTip="Next aircraft profile">
<materialDesign:PackIcon
Width="{StaticResource IconSize}"
Height="{StaticResource IconSize}"
Kind="ChevronRight" />
</Button>
</StackPanel>
</DockPanel>
</StackPanel>
</UserControl>

View file

@ -1,39 +0,0 @@
using Microsoft.Extensions.DependencyInjection;
using MSFSPopoutPanelManager.MainApp.ViewModel;
using System;
using System.Windows.Controls;
namespace MSFSPopoutPanelManager.MainApp
{
public partial class ProfileCardList : UserControl
{
private ProfileCardListViewModel _viewModel;
public ProfileCardList()
{
_viewModel = App.AppHost.Services.GetRequiredService<ProfileCardListViewModel>();
InitializeComponent();
Loaded += (sender, e) =>
{
DataContext = _viewModel;
_viewModel.OnProfileSelected += (sender, e) =>
{
PopupBoxFinder.StaysOpen = false;
PopupBoxFinder.IsPopupOpen = false;
};
};
}
private void BtnPopupBoxFinder_Click(object sender, System.Windows.RoutedEventArgs e)
{
PopupBoxFinder.IsPopupOpen = !PopupBoxFinder.IsPopupOpen;
PopupBoxFinder.StaysOpen = PopupBoxFinder.IsPopupOpen;
if (PopupBoxFinder.IsPopupOpen)
{
ComboBoxSearchProfile.Text = null;
ComboBoxSearchProfile.Focus();
}
}
}
}

View file

@ -1,53 +0,0 @@
<UserControl
x:Class="MSFSPopoutPanelManager.MainApp.TrayIcon"
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:tb="http://www.hardcodet.net/taskbar"
d:DesignHeight="450"
d:DesignWidth="800"
mc:Ignorable="d">
<UserControl.Resources>
<Style TargetType="MenuItem">
<Setter Property="FontSize" Value="14" />
</Style>
</UserControl.Resources>
<tb:TaskbarIcon
x:Name="Tray"
IconSource="../logo.ico"
MenuActivation="RightClick"
Visibility="Visible">
<tb:TaskbarIcon.ContextMenu>
<ContextMenu>
<MenuItem
x:Name="MenuItemProfiles"
Click="MenuItem_Click"
Header="Profiles"
ItemsSource="{Binding ProfileData.Profiles}"
Style="{StaticResource MaterialDesignMenuItem}">
<MenuItem.ItemContainerStyle>
<Style BasedOn="{StaticResource MaterialDesignMenuItem}" TargetType="MenuItem">
<Setter Property="MenuItem.Header" Value="{Binding Name}" />
<Setter Property="MenuItem.IsCheckable" Value="True" />
<Setter Property="MenuItem.IsChecked" Value="{Binding IsActive}" />
<Setter Property="MenuItem.Command" Value="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}, Path=DataContext.ChangeProfileCommand}" />
<Setter Property="MenuItem.CommandParameter" Value="{Binding Id}" />
<Setter Property="MenuItem.FlowDirection" Value="LeftToRight" />
<Setter Property="Margin" Value="0" />
</Style>
</MenuItem.ItemContainerStyle>
</MenuItem>
<MenuItem
Command="{Binding StartPopOutCommand}"
Header="Start Pop Out"
Style="{StaticResource MaterialDesignMenuItem}" />
<Separator />
<MenuItem
Command="{Binding ExitAppCommand}"
Header="Exit"
Style="{StaticResource MaterialDesignMenuItem}" />
</ContextMenu>
</tb:TaskbarIcon.ContextMenu>
</tb:TaskbarIcon>
</UserControl>

View file

@ -1,31 +0,0 @@
using Microsoft.Extensions.DependencyInjection;
using MSFSPopoutPanelManager.MainApp.ViewModel;
using Prism.Commands;
using System;
using System.Windows;
using System.Windows.Controls;
namespace MSFSPopoutPanelManager.MainApp
{
public partial class TrayIcon : UserControl
{
// This command has to be here since it doesn't work in view model, window StateChanged never gets fire
public DelegateCommand RestoreWindowCommand => new DelegateCommand(() => { ((Window)((Border)((Grid)this.Parent).Parent).Parent).WindowState = WindowState.Normal; }, () => { return true; });
private TrayIconViewModel ViewModel { get; set; }
public TrayIcon()
{
ViewModel = App.AppHost.Services.GetRequiredService<TrayIconViewModel>();
InitializeComponent();
Loaded += (sender, e) => { DataContext = ViewModel; };
Tray.DoubleClickCommand = RestoreWindowCommand;
}
private void MenuItem_Click(object sender, RoutedEventArgs e)
{
Tray.ContextMenu.IsOpen = true;
}
}
}

View file

@ -1,232 +0,0 @@
using MaterialDesignThemes.Wpf;
using MSFSPopoutPanelManager.DomainModel.Profile;
using MSFSPopoutPanelManager.Orchestration;
using MSFSPopoutPanelManager.WindowsAgent;
using Prism.Commands;
using System;
using System.Linq;
using System.Windows.Input;
namespace MSFSPopoutPanelManager.MainApp.ViewModel
{
public class PopOutPanelCardViewModel : BaseViewModel
{
public PanelConfig DataItem { get; set; }
public ICommand MovePanelUpCommand { get; set; }
public ICommand MovePanelDownCommand { get; set; }
public ICommand DeletePanelCommand { get; set; }
public ICommand AddPanelSourceLocationCommand { get; set; }
public ICommand TouchEnabledCommand { get; set; }
public ICommand MoveResizePanelCommand { get; set; }
public DelegateCommand<string> PanelAttributeUpdatedCommand { get; set; }
public PopOutPanelCardViewModel(MainOrchestrator orchestrator) : base(orchestrator)
{
DataItem = new PanelConfig();
MovePanelUpCommand = new DelegateCommand(OnMovePanelUp, () => ProfileData.ActiveProfile != null && ProfileData.ActiveProfile.PanelConfigs.IndexOf(DataItem) > 0)
.ObservesProperty(() => ProfileData.ActiveProfile)
.ObservesProperty(() => ProfileData.ActiveProfile.PanelConfigs)
.ObservesProperty(() => ProfileData.ActiveProfile.PanelConfigs.Count);
MovePanelDownCommand = new DelegateCommand(OnMovePanelDown, () => ProfileData.ActiveProfile != null && ProfileData.ActiveProfile.PanelConfigs.IndexOf(DataItem) < ProfileData.ActiveProfile.PanelConfigs.Count - 1)
.ObservesProperty(() => ProfileData.ActiveProfile)
.ObservesProperty(() => ProfileData.ActiveProfile.PanelConfigs)
.ObservesProperty(() => ProfileData.ActiveProfile.PanelConfigs.Count);
AddPanelSourceLocationCommand = new DelegateCommand(OnAddPanelSourceLocation, () => ProfileData.ActiveProfile != null && FlightSimData.IsInCockpit)
.ObservesProperty(() => ProfileData.ActiveProfile)
.ObservesProperty(() => FlightSimData.IsInCockpit);
MoveResizePanelCommand = new DelegateCommand(OnMoveResizePanel, () => ProfileData.ActiveProfile != null
&& DataItem != null
&& (ProfileData.ActiveProfile.CurrentMoveResizePanelId == DataItem.Id || ProfileData.ActiveProfile.CurrentMoveResizePanelId == Guid.Empty)
&& FlightSimData.IsInCockpit
&& DataItem.IsPopOutSuccess != null
&& DataItem.PanelHandle != IntPtr.Zero
&& !DataItem.FullScreen)
.ObservesProperty(() => ProfileData.ActiveProfile)
.ObservesProperty(() => ProfileData.ActiveProfile.CurrentMoveResizePanelId)
.ObservesProperty(() => FlightSimData.IsInCockpit)
.ObservesProperty(() => DataItem.IsPopOutSuccess)
.ObservesProperty(() => DataItem.PanelHandle)
.ObservesProperty(() => DataItem.FullScreen);
TouchEnabledCommand = new DelegateCommand(OnTouchEnabled, () => ProfileData.ActiveProfile != null)
.ObservesProperty(() => ProfileData.ActiveProfile);
DeletePanelCommand = new DelegateCommand(OnDeletePanel);
PanelAttributeUpdatedCommand = new DelegateCommand<string>(OnPanelAttributeUpdated);
IsEnabledEditPanelSource = true;
}
public int DataItemIndex => ProfileData.ActiveProfile.PanelConfigs.IndexOf(DataItem);
public int DataItemsMaxIndex => ProfileData.ActiveProfile.PanelConfigs.Count - 1;
public bool IsEnabledEditPanelSource { get; set; }
public bool IsErrorPanel => DataItem.IsPopOutSuccess != null && !(bool)DataItem.IsPopOutSuccess;
private void OnMovePanelUp()
{
var index = ProfileData.ActiveProfile.PanelConfigs.IndexOf(DataItem);
ProfileData.ActiveProfile.PanelConfigs.Insert(index - 1, DataItem);
ProfileData.ActiveProfile.PanelConfigs.RemoveAt(index + 1);
}
private void OnMovePanelDown()
{
var index = ProfileData.ActiveProfile.PanelConfigs.IndexOf(DataItem);
ProfileData.ActiveProfile.PanelConfigs.Insert(index + 2, DataItem);
ProfileData.ActiveProfile.PanelConfigs.RemoveAt(index);
}
private async void OnDeletePanel()
{
var result = await DialogHost.Show(new ConfirmationDialog("Are you sure you want to delete the panel?", "Delete"), "RootDialog");
if (result != null && result.Equals("CONFIRM"))
Orchestrator.PanelSource.RemovePanelSource(DataItem);
if (ProfileData.ActiveProfile.PanelConfigs.Where(p => p.PanelType == PanelType.CustomPopout).Count() == 0 && ProfileData.ActiveProfile.IsEditingPanelSource)
ProfileData.ActiveProfile.IsEditingPanelSource = false;
}
private void OnTouchEnabled()
{
if (DataItem != null)
Orchestrator.PanelConfiguration.PanelConfigPropertyUpdated(DataItem.PanelHandle, PanelConfigPropertyName.TouchEnabled);
}
private void OnPanelAttributeUpdated(string? commandParameter)
{
if (DataItem != null && commandParameter != null)
Orchestrator.PanelConfiguration.PanelConfigPropertyUpdated(DataItem.PanelHandle, (PanelConfigPropertyName)Enum.Parse(typeof(PanelConfigPropertyName), commandParameter));
}
private async void OnAddPanelSourceLocation()
{
Orchestrator.PanelSource.StartPanelSelectionEvent();
DataItem.IsSelectedPanelSource = true;
if (!ProfileData.ActiveProfile.IsEditingPanelSource)
await Orchestrator.PanelSource.StartEditPanelSources();
Orchestrator.PanelSource.StartPanelSelection(DataItem);
}
private void OnMoveResizePanel()
{
if (DataItem.IsEditingPanel)
{
ProfileData.ActiveProfile.CurrentMoveResizePanelId = DataItem.Id;
if (!AppSettingData.ApplicationSetting.KeyboardShortcutSetting.IsEnabled)
InputHookManager.StartKeyboardHook();
InputHookManager.OnKeyUp -= HandleKeyUpEvent;
InputHookManager.OnKeyUp += HandleKeyUpEvent;
}
else
{
ProfileData.ActiveProfile.CurrentMoveResizePanelId = Guid.Empty;
if (!AppSettingData.ApplicationSetting.KeyboardShortcutSetting.IsEnabled)
InputHookManager.EndKeyboardHook();
InputHookManager.OnKeyUp -= HandleKeyUpEvent;
}
}
private void HandleKeyUpEvent(object sender, KeyUpEventArgs e)
{
PanelConfigPropertyName panelConfigPropertyName = PanelConfigPropertyName.None;
if (e.IsHoldControl)
e.KeyCode = $"CTRL+{e.KeyCode}";
if (e.IsHoldShift)
e.KeyCode = $"SHFT+{e.KeyCode}";
switch (e.KeyCode.ToUpper())
{
case "UP":
panelConfigPropertyName = PanelConfigPropertyName.Top;
DataItem.Top -= 10;
break;
case "DOWN":
panelConfigPropertyName = PanelConfigPropertyName.Top;
DataItem.Top += 10;
break;
case "LEFT":
panelConfigPropertyName = PanelConfigPropertyName.Left;
DataItem.Left -= 10;
break;
case "RIGHT":
panelConfigPropertyName = PanelConfigPropertyName.Left;
DataItem.Left += 10;
break;
case "SHFT+UP":
panelConfigPropertyName = PanelConfigPropertyName.Top;
DataItem.Top -= 1;
break;
case "SHFT+DOWN":
panelConfigPropertyName = PanelConfigPropertyName.Top;
DataItem.Top += 1;
break;
case "SHFT+LEFT":
panelConfigPropertyName = PanelConfigPropertyName.Left;
DataItem.Left -= 1;
break;
case "SHFT+RIGHT":
panelConfigPropertyName = PanelConfigPropertyName.Left;
DataItem.Left += 1;
break;
case "CTRL+UP":
panelConfigPropertyName = PanelConfigPropertyName.Height;
DataItem.Height -= 10;
break;
case "CTRL+DOWN":
panelConfigPropertyName = PanelConfigPropertyName.Height;
DataItem.Height += 10;
break;
case "CTRL+LEFT":
panelConfigPropertyName = PanelConfigPropertyName.Width;
DataItem.Width -= 10;
break;
case "CTRL+RIGHT":
panelConfigPropertyName = PanelConfigPropertyName.Width;
DataItem.Width += 10;
break;
case "SHFT+CTRL+UP":
panelConfigPropertyName = PanelConfigPropertyName.Height;
DataItem.Height -= 1;
break;
case "SHFT+CTRL+DOWN":
panelConfigPropertyName = PanelConfigPropertyName.Height;
DataItem.Height += 1;
break;
case "SHFT+CTRL+LEFT":
panelConfigPropertyName = PanelConfigPropertyName.Width;
DataItem.Width -= 1;
break;
case "SHFT+CTRL+RIGHT":
panelConfigPropertyName = PanelConfigPropertyName.Width;
DataItem.Width += 1;
break;
}
if (panelConfigPropertyName != PanelConfigPropertyName.None)
Orchestrator.PanelConfiguration.PanelConfigPropertyUpdated(DataItem.PanelHandle, panelConfigPropertyName);
}
}
}

View file

@ -54,8 +54,6 @@ namespace MSFSPopoutPanelManager.MainApp.ViewModel
_panelSourceOrchestrator.StartPanelSelectionEvent();
DataItem.IsSelectedPanelSource = true;
_panelSourceOrchestrator.StartPanelSelection(DataItem);
}

View file

@ -1,108 +0,0 @@
using AutoUpdaterDotNET;
using MSFSPopoutPanelManager.Shared;
using MSFSPopoutPanelManager.WindowsAgent;
using System;
using System.IO;
using System.Threading.Tasks;
using System.Windows;
namespace MSFSPopoutPanelManager.Orchestration
{
public class MainOrchestrator : ObservableObject
{
public MainOrchestrator()
{
AppSettingData = new AppSettingData();
ProfileData = new ProfileData();
FlightSimData = new FlightSimData();
ProfileData.FlightSimDataRef = FlightSimData;
ProfileData.AppSettingDataRef = AppSettingData;
FlightSimData.ProfileDataRef = ProfileData;
Profile = new ProfileOrchestrator(ProfileData, FlightSimData);
PanelSource = new PanelSourceOrchestrator(ProfileData, AppSettingData, FlightSimData);
PanelPopOut = new PanelPopOutOrchestrator(ProfileData, AppSettingData, FlightSimData);
PanelConfiguration = new PanelConfigurationOrchestrator(ProfileData, AppSettingData, FlightSimData);
FlightSim = new FlightSimOrchestrator(ProfileData, AppSettingData, FlightSimData);
Help = new HelpOrchestrator();
Keyboard = new KeyboardOrchestrator(AppSettingData, FlightSimData);
PanelSource.FlightSimOrchestrator = FlightSim;
PanelPopOut.FlightSimOrchestrator = FlightSim;
PanelPopOut.PanelSourceOrchestrator = PanelSource;
PanelPopOut.PanelConfigurationOrchestrator = PanelConfiguration;
FlightSim.PanelPopOutOrchestrator = PanelPopOut;
FlightSim.PanelConfigurationOrchestrator = PanelConfiguration;
FlightSim.OnSimulatorExited += (sender, e) => { ApplicationClose(); Environment.Exit(0); };
Keyboard.PanelPopOutOrchestrator = PanelPopOut;
// Delete all existing cache version of app
Help.DeleteAppCache();
}
public ProfileOrchestrator Profile { get; set; }
public PanelSourceOrchestrator PanelSource { get; set; }
public PanelPopOutOrchestrator PanelPopOut { get; set; }
public PanelConfigurationOrchestrator PanelConfiguration { get; set; }
public ProfileData ProfileData { get; set; }
public AppSettingData AppSettingData { get; private set; }
public FlightSimData FlightSimData { get; private set; }
public FlightSimOrchestrator FlightSim { get; set; }
public HelpOrchestrator Help { get; set; }
public KeyboardOrchestrator Keyboard { get; set; }
public IntPtr ApplicationHandle { get; set; }
public Window ApplicationWindow { get; set; }
public void Initialize()
{
AppSettingData.ReadSettings();
ProfileData.ReadProfiles();
PanelSource.ApplicationHandle = ApplicationHandle;
if (AppSettingData.ApplicationSetting.GeneralSetting.CheckForUpdate)
CheckForAutoUpdate();
ProfileData.SetActiveProfile(AppSettingData.ApplicationSetting.SystemSetting.LastUsedProfileId); // Load last used profile
Task.Run(() => FlightSim.StartSimConnectServer()); // Start the SimConnect server
Keyboard.Initialize();
}
public void ApplicationClose()
{
// Force unhook all win events
PanelConfiguration.EndConfiguration();
PanelConfiguration.EndTouchHook();
InputHookManager.EndKeyboardHook();
FlightSim.EndSimConnectServer(true);
}
private void CheckForAutoUpdate()
{
string jsonPath = Path.Combine(Path.Combine(FileIo.GetUserDataFilePath(), "autoupdate.json"));
AutoUpdater.PersistenceProvider = new JsonFilePersistenceProvider(jsonPath);
AutoUpdater.Synchronous = true;
AutoUpdater.AppTitle = "MSFS Pop Out Panel Manager";
AutoUpdater.RunUpdateAsAdmin = false;
AutoUpdater.UpdateFormSize = new System.Drawing.Size(1024, 660);
AutoUpdater.Start(AppSettingData.ApplicationSetting.SystemSetting.AutoUpdaterUrl);
}
}
}

View file

@ -1,199 +0,0 @@
using MSFSPopoutPanelManager.DomainModel.Legacy;
using MSFSPopoutPanelManager.DomainModel.Profile;
using MSFSPopoutPanelManager.DomainModel.Setting;
using MSFSPopoutPanelManager.Shared;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
namespace MSFSPopoutPanelManager.Orchestration
{
internal class MigrateData
{
private const string USER_PROFILE_DATA_FILENAME = "userprofiledata.json";
private const string APP_SETTING_DATA_FILENAME = "appsettingdata.json";
private const string ERROR_LOG_FILENAME = "error.log";
private const string INFO_LOG_FILENAME = "info.log";
private const string DEBUG_LOG_FILENAME = "debug.log";
public static ApplicationSetting MigrateAppSettingFile(string content)
{
try
{
BackupAppSettingFile();
var appSetting = new ApplicationSetting();
var legacyAppSetting = JsonConvert.DeserializeObject<LegacyAppSetting>(content);
// General settings
appSetting.GeneralSetting.AlwaysOnTop = legacyAppSetting.AlwaysOnTop;
appSetting.GeneralSetting.AutoClose = legacyAppSetting.AutoClose;
appSetting.GeneralSetting.MinimizeToTray = legacyAppSetting.MinimizeToTray;
appSetting.GeneralSetting.StartMinimized = legacyAppSetting.StartMinimized;
// Auto pop out setting
appSetting.AutoPopOutSetting.IsEnabled = legacyAppSetting.AutoPopOutPanels;
// Pop out setting
appSetting.PopOutSetting.UseLeftRightControlToPopOut = legacyAppSetting.UseLeftRightControlToPopOut;
appSetting.PopOutSetting.MinimizeAfterPopOut = legacyAppSetting.MinimizeAfterPopOut;
appSetting.PopOutSetting.AutoPanning.IsEnabled = legacyAppSetting.UseAutoPanning;
appSetting.PopOutSetting.AutoPanning.KeyBinding = legacyAppSetting.AutoPanningKeyBinding;
appSetting.PopOutSetting.AfterPopOutCameraView.IsEnabled = legacyAppSetting.AfterPopOutCameraView.EnableReturnToCameraView;
appSetting.PopOutSetting.AfterPopOutCameraView.CameraView = legacyAppSetting.AfterPopOutCameraView.CameraView;
appSetting.PopOutSetting.AfterPopOutCameraView.KeyBinding = legacyAppSetting.AfterPopOutCameraView.CustomCameraKeyBinding;
// Refocus setting
appSetting.RefocusSetting.RefocusGameWindow.IsEnabled = legacyAppSetting.TouchScreenSettings.RefocusGameWindow;
var delay = Math.Round(legacyAppSetting.TouchScreenSettings.RefocusGameWindowDelay / 1000.0, 1);
appSetting.RefocusSetting.RefocusGameWindow.Delay = delay < 1.0 ? 1.0 : delay;
// Touch setting
appSetting.TouchSetting.TouchDownUpDelay = 0;
// Track IR setting
appSetting.TrackIRSetting.AutoDisableTrackIR = legacyAppSetting.AutoDisableTrackIR;
// Windowed mode setting
appSetting.WindowedModeSetting.AutoResizeMsfsGameWindow = legacyAppSetting.AutoResizeMsfsGameWindow;
return appSetting;
}
catch (Exception ex)
{
var msg = "An unknown application setting data migration error has occured. Application will close";
FileLogger.WriteException(msg, ex);
Environment.Exit(0);
}
return null;
}
public static IList<UserProfile> MigrateUserProfileFile(string content)
{
try
{
BackupUserProfileFile();
var profiles = new List<UserProfile>();
var legacyProfiles = JsonConvert.DeserializeObject<List<LegacyProfile>>(content);
legacyProfiles = legacyProfiles.OrderBy(p => p.ProfileName.ToLower()).ToList();
foreach (var legacyProfile in legacyProfiles)
{
var profile = new UserProfile();
profile.Name = legacyProfile.ProfileName;
profile.IsLocked = legacyProfile.IsLocked;
profile.AircraftBindings = legacyProfile.BindingAircrafts;
profile.ProfileSetting.PowerOnRequiredForColdStart = legacyProfile.PowerOnRequiredForColdStart;
profile.ProfileSetting.IncludeInGamePanels = legacyProfile.IncludeInGamePanels;
if (legacyProfile.MsfsGameWindowConfig != null)
{
profile.MsfsGameWindowConfig.Top = legacyProfile.MsfsGameWindowConfig.Top;
profile.MsfsGameWindowConfig.Left = legacyProfile.MsfsGameWindowConfig.Left;
profile.MsfsGameWindowConfig.Width = legacyProfile.MsfsGameWindowConfig.Width;
profile.MsfsGameWindowConfig.Height = legacyProfile.MsfsGameWindowConfig.Height;
}
foreach (var legacyPanelConfig in legacyProfile.PanelConfigs)
{
var panelConfig = new PanelConfig();
panelConfig.PanelName = legacyPanelConfig.PanelName;
panelConfig.PanelType = legacyPanelConfig.PanelType;
panelConfig.Top = legacyPanelConfig.Top;
panelConfig.Left = legacyPanelConfig.Left + 9;
panelConfig.Width = legacyPanelConfig.Width - 18;
panelConfig.Height = legacyPanelConfig.Height - 9;
if (panelConfig.PanelType == PanelType.CustomPopout)
{
var legacyPanelSource = legacyProfile.PanelSourceCoordinates.FirstOrDefault(x => x.PanelIndex == legacyPanelConfig.PanelIndex);
if (legacyPanelSource != null)
{
panelConfig.PanelSource.X = legacyPanelSource.X;
panelConfig.PanelSource.Y = legacyPanelSource.Y;
panelConfig.PanelSource.Color = PanelConfigColors.GetNextAvailableColor(profile.PanelConfigs.ToList());
}
}
panelConfig.AlwaysOnTop = legacyPanelConfig.AlwaysOnTop;
panelConfig.HideTitlebar = legacyPanelConfig.HideTitlebar;
panelConfig.FullScreen = legacyPanelConfig.FullScreen;
if (legacyProfile.RealSimGearGTN750Gen1Override)
panelConfig.TouchEnabled = false;
else
panelConfig.TouchEnabled = legacyPanelConfig.TouchEnabled;
if (legacyPanelConfig.DisableGameRefocus || panelConfig.PanelType == PanelType.BuiltInPopout)
panelConfig.AutoGameRefocus = false;
profile.PanelConfigs.Add(panelConfig);
}
profiles.Add(profile);
}
return profiles;
}
catch (Exception ex)
{
var msg = "An unknown user data migration error has occured. Application will close";
FileLogger.WriteException(msg, ex);
Environment.Exit(0);
}
return null;
}
private static void BackupAppSettingFile()
{
var srcPath = Path.Combine(FileIo.GetUserDataFilePath(), APP_SETTING_DATA_FILENAME);
var backupPath = Path.Combine(FileIo.GetUserDataFilePath(), "Backup-previous-version", APP_SETTING_DATA_FILENAME);
if (File.Exists(srcPath))
{
Directory.CreateDirectory(Path.Combine(FileIo.GetUserDataFilePath(), "Backup-previous-version"));
File.Copy(srcPath, backupPath, true);
}
// Delete existing error log
var logFilePath = Path.Combine(FileIo.GetUserDataFilePath(), "LogFiles", ERROR_LOG_FILENAME);
if (File.Exists(logFilePath))
File.Delete(logFilePath);
logFilePath = Path.Combine(FileIo.GetUserDataFilePath(), "LogFiles", INFO_LOG_FILENAME);
if (File.Exists(logFilePath))
File.Delete(logFilePath);
logFilePath = Path.Combine(FileIo.GetUserDataFilePath(), "LogFiles", DEBUG_LOG_FILENAME);
if (File.Exists(logFilePath))
File.Delete(logFilePath);
FileLogger.WriteLog("File initialized...", StatusMessageType.Error);
}
private static void BackupUserProfileFile()
{
var srcPath = Path.Combine(FileIo.GetUserDataFilePath(), USER_PROFILE_DATA_FILENAME);
var backupPath = Path.Combine(FileIo.GetUserDataFilePath(), "Backup-previous-version", USER_PROFILE_DATA_FILENAME);
if (File.Exists(srcPath))
{
Directory.CreateDirectory(Path.Combine(FileIo.GetUserDataFilePath(), "Backup-previous-version"));
File.Copy(srcPath, backupPath, true);
}
}
}
}

View file

@ -11,9 +11,9 @@
<PackageProjectUrl>https://github.com/hawkeye-stan/msfs-popout-panel-manager</PackageProjectUrl>
<RootNamespace>MSFSPopoutPanelManager.Orchestration</RootNamespace>
<Platforms>x64</Platforms>
<Version>4.0.4.1</Version>
<AssemblyVersion>4.0.4.1</AssemblyVersion>
<FileVersion>4.0.4.1</FileVersion>
<Version>4.1.0.1</Version>
<AssemblyVersion>4.1.0.1</AssemblyVersion>
<FileVersion>4.1.0.1</FileVersion>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<DebugType>Embedded</DebugType>
<Configurations>Debug;Release;Local</Configurations>

View file

@ -1,19 +1,13 @@
## Version 4.0.3
## Version 4.1.0
* Fixed rogue CPU issue when using touch feature in pop out panel which may cause computer to hang.
* Added new method to select panel source for an aircraft profile using fixed camera view instead of relying saved custom camera view. Previous method of using saved custom camera view is still available to use if desire.
* Added a new turbo mode to improve execution speed during pop out process. Turbo mode can be turned on in preferences => general settings.
Video showing how to create a new profile using the new panel selection method: https://vimeo.com/917361559
* Added support for PMDG 737 EFB.
Video showing how to updae existing profile to use the new panel selection method: https://vimeo.com/917364912
* Added please wait message when editing panel source to resolve the confusion that Pop Out Panel Manager seems to hang when trying to select panel source during creation of a new aircraft profile.
* Added new virtual number pad to be used for touch enabled screen. This number pad will first focus the game window before sending num pad keystroke to the game.
* Improved touch reliability when touch feature on pop out panel.
* Added a new button to easily close all Pop Out Panel Manager's managed pop outs.
* Removed pop out failure error message when after pop out predefined camera view has not been setup for an aircraft.
* Update text color for pop out progress dialog.
### KNOWN ISSUE:
* For A2A Comanche PA-24-250, pop out step "Resetting camera view" does not work since this aircraft does not seem to implement SimConnect variable CAMERA_VIEW_TYPE_AND_INDEX:1 which Pop Out Panel Manager uses to reset camera view.
* Fixed few reported bugs in the application.

View file

@ -11,9 +11,9 @@
<PackageProjectUrl>https://github.com/hawkeye-stan/msfs-popout-panel-manager</PackageProjectUrl>
<RootNamespace>MSFSPopoutPanelManager.Shared</RootNamespace>
<Platforms>x64</Platforms>
<Version>4.0.4.1</Version>
<AssemblyVersion>4.0.4.1</AssemblyVersion>
<FileVersion>4.0.4.1</FileVersion>
<Version>4.1.0.1</Version>
<AssemblyVersion>4.1.0.1</AssemblyVersion>
<FileVersion>4.1.0.1</FileVersion>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<DebugType>Embedded</DebugType>
<Configurations>Debug;Release;Local</Configurations>

View file

@ -1,24 +0,0 @@
using System;
using System.Collections.Generic;
namespace MSFSPopoutPanelManager.Shared
{
public class StatusMessageEventArg : EventArgs
{
public StatusMessageEventArg(List<StatusMessage> messages)
{
Messages = messages;
}
public List<StatusMessage> Messages { get; set; }
}
public class StatusMessage
{
public StatusMessageType StatusMessageType { get; set; }
public string Message { get; set; }
public bool NewLine { get; set; }
}
}

View file

@ -11,9 +11,9 @@
<PackageProjectUrl>https://github.com/hawkeye-stan/msfs-popout-panel-manager</PackageProjectUrl>
<RootNamespace>MSFSPopoutPanelManager.SimConnectAgent</RootNamespace>
<Platforms>x64</Platforms>
<Version>4.0.4.1</Version>
<AssemblyVersion>4.0.4.1</AssemblyVersion>
<FileVersion>4.0.4.1</FileVersion>
<Version>4.1.0.1</Version>
<AssemblyVersion>4.1.0.1</AssemblyVersion>
<FileVersion>4.1.0.1</FileVersion>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<DebugType>Embedded</DebugType>
<Configurations>Debug;Release;Local</Configurations>

View file

@ -1,6 +1,20 @@
# Version History
<hr/>
## Version 4.1.0
* Added new method to select panel source for an aircraft profile using fixed camera view instead of relying saved custom camera view. Previous method of using saved custom camera view is still available to use if desire.
Video showing how to create a new profile using the new panel selection method: https://vimeo.com/917361559
Video showing how to updae existing profile to use the new panel selection method: https://vimeo.com/917364912
* Added new virtual number pad to be used for touch enabled screen. This number pad will first focus the game window before sending num pad keystroke to the game.
* Added a new button to easily close all Pop Out Panel Manager's managed pop outs.
* Fixed few outstanding bugs in the application.
## Version 4.0.3
* Fixed rogue CPU issue when using touch feature in pop out panel which may cause computer to hang.

View file

@ -11,9 +11,9 @@
<PackageProjectUrl>https://github.com/hawkeye-stan/msfs-popout-panel-manager</PackageProjectUrl>
<RootNamespace>MSFSPopoutPanelManager.WindowsAgent</RootNamespace>
<Platforms>x64</Platforms>
<Version>4.0.4.1</Version>
<AssemblyVersion>4.0.4.1</AssemblyVersion>
<FileVersion>4.0.4.1</FileVersion>
<Version>4.1.0.1</Version>
<AssemblyVersion>4.1.0.1</AssemblyVersion>
<FileVersion>4.1.0.1</FileVersion>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<DebugType>Embedded</DebugType>
<Configurations>Debug;Release;Local</Configurations>