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

107 lines
7 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:c="clr-namespace:CalcBinding;assembly=CalcBinding"
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"
Height="670"
Width="920"
WindowStartupLocation="CenterScreen"
ResizeMode="CanMinimize"
Icon="logo.ico"
StateChanged="Window_StateChanged"
WindowState="{Binding InitialWindowState, Mode=OneWay}"
Loaded="Window_Loaded"
Closing="Window_Closing">
2022-06-30 23:53:08 +00:00
<Window.InputBindings>
<KeyBinding Command="{Binding Path=MinimizeAllPanelsCommand}" Modifiers="Ctrl+Alt" Key="M" />
2022-01-27 13:40:04 +00:00
</Window.InputBindings>
<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>
<MenuItem Header="Profiles" ItemsSource="{Binding DataStore.UserProfiles}">
<MenuItem.ItemContainerStyle>
<Style TargetType="MenuItem" BasedOn="{StaticResource {x:Type MenuItem}}">
<Setter Property="MenuItem.Header" Value="{Binding Path=ProfileName}" />
<Setter Property="MenuItem.IsChecked" Value="{Binding Path=IsActive}" />
<Setter Property="MenuItem.Command" Value="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}, Path=DataContext.UserProfileSelectCommand}" />
<Setter Property="MenuItem.CommandParameter" Value="{Binding Path=ProfileId}" />
</Style>
</MenuItem.ItemContainerStyle>
</MenuItem>
<MenuItem Header="Show Panel Location Overlay" IsChecked="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}, Path=DataContext.PanelSelectionViewModel.IsShownPanelCoorOverlay}" Command="{Binding Path=ShowPanelCoorOverlayCommand}"></MenuItem>
<MenuItem Header="Start Pop Out" Command="{Binding Path=StartPopOutCommand}" InputGestureText="Ctrl+Alt+P"></MenuItem>
<Separator></Separator>
<MenuItem Header="Exit" Command="{Binding Path=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 Path=RestartCommand}" IsEnabled="{Binding Path=IsShownPanelConfigurationScreen}"/>
<Separator />
2022-04-18 03:38:33 +00:00
<MenuItem Header="Preferences" Click="EditPreferences_Click" />
2022-01-27 13:40:04 +00:00
<Separator />
<MenuItem Name="menuItem_Exit" Header="Exit" Command="{Binding Path=ExitCommand}"/>
</MenuItem>
<MenuItem Header="View">
2022-06-30 23:53:08 +00:00
<MenuItem Name="menuItem_MinimizeAllPanels" Header="Minimize All Panels " InputGestureText="Ctrl+Alt+M" Command="{Binding Path=MinimizeAllPanelsCommand}" IsChecked="{Binding Path=IsMinimizedAllPanels, Mode=TwoWay}" IsEnabled="{c:Binding Path='IsShownPanelConfigurationScreen'}"/>
2022-01-27 13:40:04 +00:00
</MenuItem>
<MenuItem Header="Help">
<MenuItem Name="menuItem_UserGuide" Header="User Guide" Command="{Binding Path=UserGuideCommand}"/>
<MenuItem Name="menuItem_DownloadLatestRelease" Header="Download Latest Release" Command="{Binding Path=DownloadLatestReleaseCommand}"/>
</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>
<DataTrigger Binding="{Binding Path=DataStore.IsSimulatorStarted , Mode=OneWay}" Value="True">
<Setter Property="Source" Value="Resources/msfsconnected.png"/>
</DataTrigger>
<DataTrigger Binding="{Binding Path=DataStore.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="505" 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 Path=StatusMessage.Message, Mode=OneWay}">
<TextBox.Style>
<Style TargetType="TextBox" BasedOn="{StaticResource {x:Type TextBox}}">
<Style.Triggers>
<DataTrigger Binding="{Binding Path=StatusMessage.MessageType, 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">
<Label Margin="425, 0, 0, 5" FontSize="14" Content="Version" />
<Label Name="lblVersion" Margin="0, 0, 0, 5" FontSize="14" Content="{Binding Path = ApplicationVersion, Mode=OneWay}" />
</WrapPanel>
</DockPanel>
</DockPanel>
</Grid>
</mah:MetroWindow>