1
0
Fork 0
mirror of https://github.com/hawkeye-stan/msfs-popout-panel-manager.git synced 2024-11-24 14:50:10 +00:00
msfs-popout-panel-manager/WpfApp/ApplicationWindow.xaml

99 lines
6 KiB
Text
Raw Normal View History

2022-01-27 13:40:04 +00:00
<mah:MetroWindow x:Class="MSFSPopoutPanelManager.WpfApp.ApplicationWindow"
2022-06-30 23:53:08 +00:00
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"
2022-01-27 13:40:04 +00:00
Title="MSFS Pop Out Panel Manager"
2022-07-23 19:23:32 +00:00
Height="710"
2022-01-27 13:40:04 +00:00
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"
2022-06-30 23:53:08 +00:00
MenuActivation="LeftOrRightClick"
2022-01-27 13:40:04 +00:00
Visibility="Visible">
<tb:TaskbarIcon.ContextMenu>
<ContextMenu>
2022-07-23 19:23:32 +00:00
<MenuItem Header="Profiles" ItemsSource="{Binding ProfileData.Profiles}">
2022-01-27 13:40:04 +00:00
<MenuItem.ItemContainerStyle>
<Style TargetType="MenuItem" BasedOn="{StaticResource {x:Type MenuItem}}">
2022-07-23 19:23:32 +00:00
<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}" />
2022-01-27 13:40:04 +00:00
</Style>
</MenuItem.ItemContainerStyle>
</MenuItem>
2022-07-23 19:23:32 +00:00
<MenuItem Header="Start Pop Out" Command="{Binding StartPopOutCommand}"></MenuItem>
2022-01-27 13:40:04 +00:00
<Separator></Separator>
2022-07-23 19:23:32 +00:00
<MenuItem Header="Exit" Command="{Binding ExitCommand}" ></MenuItem>
2022-01-27 13:40:04 +00:00
</ContextMenu>
</tb:TaskbarIcon.ContextMenu>
</tb:TaskbarIcon>
<DockPanel Grid.ColumnSpan="4">
<DockPanel DockPanel.Dock="Top">
<Menu Width="870" Background="#FF252525">
<MenuItem Header="File">
2022-07-23 19:23:32 +00:00
<MenuItem Name="menuItem_Restart" Header="Restart" Command="{Binding RestartCommand}"/>
2022-01-27 13:40:04 +00:00
<Separator />
2022-07-23 19:23:32 +00:00
<MenuItem Name="menuItem_Preferences" Header="Preferences" Command="{Binding EditPreferencesCommand}" />
2022-01-27 13:40:04 +00:00
<Separator />
2022-07-23 19:23:32 +00:00
<MenuItem Name="menuItem_Exit" Header="Exit" Command="{Binding ExitCommand}"/>
2022-01-27 13:40:04 +00:00
</MenuItem>
<MenuItem Header="Help">
2022-07-23 19:23:32 +00:00
<MenuItem Name="menuItem_UserGuide" Header="User Guide" Command="{Binding UserGuideCommand}"/>
<MenuItem Name="menuItem_DownloadLatestRelease" Header="Download Latest Release" Command="{Binding DownloadLatestReleaseCommand}"/>
2022-01-27 13:40:04 +00:00
</MenuItem>
</Menu>
2022-04-18 04:52:43 +00:00
<Image Width="20">
2022-01-27 13:40:04 +00:00
<Image.Style>
<Style TargetType="Image">
<Style.Triggers>
2022-07-23 19:23:32 +00:00
<DataTrigger Binding="{Binding FlightSimData.IsSimulatorStarted , Mode=OneWay}" Value="True">
2022-01-27 13:40:04 +00:00
<Setter Property="Source" Value="Resources/msfsconnected.png"/>
</DataTrigger>
2022-07-23 19:23:32 +00:00
<DataTrigger Binding="{Binding FlightSimData.IsSimulatorStarted , Mode=OneWay}" Value="False">
2022-01-27 13:40:04 +00:00
<Setter Property="Source" Value="Resources/msfsdisconnected.png"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Image.Style>
</Image>
</DockPanel>
<DockPanel>
2022-07-23 19:23:32 +00:00
<StackPanel Name="panelSteps" DockPanel.Dock="Top" Height="545" Background="#FF323C64">
2022-01-27 13:40:04 +00:00
</StackPanel>
<WrapPanel DockPanel.Dock="Top" Orientation="Horizontal" Height="70" Background="#FF252523">
<Label Content="Status" Margin="5, 10, 5, 5"/>
2022-07-23 19:23:32 +00:00
<TextBox Name="txtStatus" Margin="5, 10, 5, 5" Height="55" TextWrapping="Wrap" IsReadOnly="True" Width="835" Background="#FF45494A" Text="{Binding StatusMessage, Mode=OneWay}">
2022-01-27 13:40:04 +00:00
<TextBox.Style>
<Style TargetType="TextBox" BasedOn="{StaticResource {x:Type TextBox}}">
<Style.Triggers>
2022-07-23 19:23:32 +00:00
<DataTrigger Binding="{Binding StatusMessageType, Mode=OneWay}" Value="{x:Static shared:StatusMessageType.Error}">
2022-01-27 13:40:04 +00:00
<Setter Property="Foreground" Value="#FFFF6262"></Setter>
</DataTrigger>
</Style.Triggers>
</Style>
</TextBox.Style>
</TextBox>
</WrapPanel>
2022-07-23 19:23:32 +00:00
<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}" />
2022-01-27 13:40:04 +00:00
</WrapPanel>
</DockPanel>
</DockPanel>
</Grid>
</mah:MetroWindow>