1
0
Fork 0
mirror of https://github.com/hawkeye-stan/msfs-popout-panel-manager.git synced 2024-11-25 07:10:10 +00:00
msfs-popout-panel-manager/WpfApp/ApplicationWindow.xaml
Stanley 43caff1ca9 Squashed commit of the following:
commit 2bbda3c4e4969fdf05566908fde01f1c9e4e23f7
Author: Stanley <hawkeyesk@outlook.com>
Date:   Mon Sep 5 23:54:39 2022 -0400

    Added in-game panel support

commit ec29b0ec2612b10e45ab9a73c10b88a98fcf6eaf
Author: Stanley <hawkeyesk@outlook.com>
Date:   Sun Sep 4 21:21:37 2022 -0400

    Added in-game panel support

commit 97edc184f349e1fde74a15a643fb90fb9bd90395
Author: Stanley <hawkeyesk@outlook.com>
Date:   Thu Sep 1 18:08:44 2022 -0400

    Update touch panel

commit da48ca0a272290466952c5c1bd1ca035d56f930c
Author: Stanley <hawkeyesk@outlook.com>
Date:   Mon Aug 29 22:19:38 2022 -0400

    Added pop out panel temporary display

commit 701346193804f93616b0e6e2222d9d55223f516f
Author: Stanley <hawkeyesk@outlook.com>
Date:   Wed Aug 24 10:33:59 2022 -0400

    Added auto resize window display mode

commit 98cbcd949f1555b44db22267ce5c54858bef47cd
Author: Stanley <hawkeyesk@outlook.com>
Date:   Wed Aug 24 09:39:38 2022 -0400

    Added auto resize window display mode
2022-09-06 00:07:03 -04:00

98 lines
6 KiB
XML

<mah:MetroWindow x:Class="MSFSPopoutPanelManager.WpfApp.ApplicationWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:tb="http://www.hardcodet.net/taskbar"
xmlns:mah="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
xmlns:shared="clr-namespace:MSFSPopoutPanelManager.Shared;assembly=Shared"
mc:Ignorable="d"
Title="MSFS Pop Out Panel Manager"
Height="740"
Width="920"
WindowStartupLocation="CenterScreen"
ResizeMode="CanMinimize"
Icon="logo.ico"
StateChanged="Window_StateChanged"
WindowState="{Binding InitialWindowState, Mode=OneWay}"
Loaded="Window_Loaded"
Closing="Window_Closing">
<Grid>
<tb:TaskbarIcon Name="notifyIcon"
ToolTipText="MSFS Pop Out Panel Manager"
IconSource="logo.ico"
MenuActivation="LeftOrRightClick"
Visibility="Visible">
<tb:TaskbarIcon.ContextMenu>
<ContextMenu>
<MenuItem Header="Profiles" ItemsSource="{Binding ProfileData.Profiles}">
<MenuItem.ItemContainerStyle>
<Style TargetType="MenuItem" BasedOn="{StaticResource {x:Type MenuItem}}">
<Setter Property="MenuItem.Header" Value="{Binding ProfileName}" />
<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 ProfileId}" />
</Style>
</MenuItem.ItemContainerStyle>
</MenuItem>
<MenuItem Header="Start Pop Out" Command="{Binding StartPopOutCommand}"></MenuItem>
<Separator></Separator>
<MenuItem Header="Exit" Command="{Binding ExitCommand}" ></MenuItem>
</ContextMenu>
</tb:TaskbarIcon.ContextMenu>
</tb:TaskbarIcon>
<DockPanel Grid.ColumnSpan="4">
<DockPanel DockPanel.Dock="Top">
<Menu Width="870" Background="#FF252525">
<MenuItem Header="File">
<MenuItem Name="menuItem_Restart" Header="Restart" Command="{Binding RestartCommand}"/>
<Separator />
<MenuItem Name="menuItem_Preferences" Header="Preferences" Command="{Binding EditPreferencesCommand}" />
<Separator />
<MenuItem Name="menuItem_Exit" Header="Exit" Command="{Binding ExitCommand}"/>
</MenuItem>
<MenuItem Header="Help">
<MenuItem Name="menuItem_UserGuide" Header="User Guide" Command="{Binding UserGuideCommand}"/>
<MenuItem Name="menuItem_DownloadLatestRelease" Header="Download Latest Release" Command="{Binding DownloadLatestReleaseCommand}"/>
</MenuItem>
</Menu>
<Image Width="20">
<Image.Style>
<Style TargetType="Image">
<Style.Triggers>
<DataTrigger Binding="{Binding FlightSimData.IsSimulatorStarted , Mode=OneWay}" Value="True">
<Setter Property="Source" Value="Resources/msfsconnected.png"/>
</DataTrigger>
<DataTrigger Binding="{Binding FlightSimData.IsSimulatorStarted , Mode=OneWay}" Value="False">
<Setter Property="Source" Value="Resources/msfsdisconnected.png"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Image.Style>
</Image>
</DockPanel>
<DockPanel>
<StackPanel Name="panelSteps" DockPanel.Dock="Top" Height="575" Background="#FF323C64">
</StackPanel>
<WrapPanel DockPanel.Dock="Top" Orientation="Horizontal" Height="70" Background="#FF252523">
<Label Content="Status" Margin="5, 10, 5, 5"/>
<TextBox Name="txtStatus" Margin="5, 10, 5, 5" Height="55" TextWrapping="Wrap" IsReadOnly="True" Width="835" Background="#FF45494A" Text="{Binding StatusMessage, Mode=OneWay}">
<TextBox.Style>
<Style TargetType="TextBox" BasedOn="{StaticResource {x:Type TextBox}}">
<Style.Triggers>
<DataTrigger Binding="{Binding StatusMessageType, Mode=OneWay}" Value="{x:Static shared:StatusMessageType.Error}">
<Setter Property="Foreground" Value="#FFFF6262"></Setter>
</DataTrigger>
</Style.Triggers>
</Style>
</TextBox.Style>
</TextBox>
</WrapPanel>
<WrapPanel DockPanel.Dock="Bottom" Orientation="Horizontal" Background="#FF252525" Height="45" HorizontalAlignment="Center">
<Label Margin="0, 0, 0, 5" FontSize="14" Content="Version" />
<Label Name="lblVersion" Margin="0, 0, 0, 5" FontSize="14" Content="{Binding ApplicationVersion, Mode=OneWay}" />
</WrapPanel>
</DockPanel>
</DockPanel>
</Grid>
</mah:MetroWindow>