Main.xaml
<Controls:MetroWindow
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks" xmlns:Controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro" Title="Windows Update Pwsh Module v1.2" Name="MainPanel" Height="545" Width="880" WindowStartupLocation="CenterScreen" ResizeMode="NoResize" WindowStyle="None" BorderThickness="0" GlowBrush="{DynamicResource AccentColorBrush}" Icon="./images/favicon.ico"> <Window.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Themes/HamburgerMenuTemplate.xaml" /> <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" /> <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml" /> <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Colors.xaml" /> <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/Cobalt.xaml" /> <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/BaseLight.xaml"/> </ResourceDictionary.MergedDictionaries> <!-- This is the template for all menu items. In this sample we use the glyph items. --> <DataTemplate x:Key="HamburgerMenuItem" DataType="{x:Type Controls:HamburgerMenuGlyphItem}"> <Grid Height="48"> <Grid.ColumnDefinitions> <ColumnDefinition Width="48" /> <ColumnDefinition /> </Grid.ColumnDefinitions> <Image Margin="12" HorizontalAlignment="Center" VerticalAlignment="Center" Source="{Binding Glyph}" Stretch="UniformToFill" /> <ContentControl Grid.Column="0" HorizontalAlignment="Center" VerticalAlignment="Center" Focusable="False" Content="{Binding Icon}" /> <TextBlock Grid.Column="1" VerticalAlignment="Center" FontSize="16" Text="{Binding Label}" /> </Grid> </DataTemplate> <!-- This is the template for all option menu items. --> <DataTemplate x:Key="HamburgerOptionsMenuItem" DataType="{x:Type Controls:HamburgerMenuItem}"> <Grid Height="48"> <Grid.ColumnDefinitions> <ColumnDefinition Width="48" /> <ColumnDefinition /> </Grid.ColumnDefinitions> <ContentControl Grid.Column="0" Content="{Binding Tag}" Focusable="False" IsTabStop="False" /> <TextBlock Grid.Column="1" VerticalAlignment="Center" FontSize="16" Text="{Binding Label}" /> </Grid> </DataTemplate> <ObjectDataProvider x:Key="DisplayModeEnumValues" MethodName="GetValues" ObjectType="{x:Type Controls:SplitViewDisplayMode}"> <ObjectDataProvider.MethodParameters> <x:Type TypeName="Controls:SplitViewDisplayMode" /> </ObjectDataProvider.MethodParameters> </ObjectDataProvider> <ObjectDataProvider x:Key="VisibilityEnumValues" MethodName="GetValues" ObjectType="{x:Type Visibility}"> <ObjectDataProvider.MethodParameters> <x:Type TypeName="Visibility" /> </ObjectDataProvider.MethodParameters> </ObjectDataProvider> <Style x:Key="HamburgerMenuCreatorsItemStyle" BasedOn="{StaticResource HamburgerMenuItemStyle}" TargetType="{x:Type ListBoxItem}"> <Setter Property="Controls:ItemHelper.ActiveSelectionBackgroundBrush" Value="Transparent" /> <Setter Property="Controls:ItemHelper.ActiveSelectionForegroundBrush" Value="{DynamicResource AccentBaseColorBrush}" /> <Setter Property="Controls:ItemHelper.DisabledForegroundBrush" Value="{DynamicResource GrayNormalBrush}" /> <Setter Property="Controls:ItemHelper.DisabledSelectedBackgroundBrush" Value="Transparent" /> <Setter Property="Controls:ItemHelper.DisabledSelectedForegroundBrush" Value="{DynamicResource GrayNormalBrush}" /> <Setter Property="Controls:ItemHelper.HoverBackgroundBrush" Value="{DynamicResource GrayBrush9}" /> <Setter Property="Controls:ItemHelper.HoverSelectedBackgroundBrush" Value="{DynamicResource GrayBrush9}" /> <Setter Property="Controls:ItemHelper.SelectedBackgroundBrush" Value="Transparent" /> <Setter Property="Controls:ItemHelper.SelectedForegroundBrush" Value="{DynamicResource AccentBaseColorBrush}" /> </Style> <Style x:Key="HamburgerMenuCreatorsStyle" BasedOn="{StaticResource {x:Type Controls:HamburgerMenu}}" TargetType="{x:Type Controls:HamburgerMenu}"> <Setter Property="ItemContainerStyle" Value="{StaticResource HamburgerMenuCreatorsItemStyle}" /> <Setter Property="OptionsItemContainerStyle" Value="{StaticResource HamburgerMenuCreatorsItemStyle}" /> <Setter Property="PaneBackground" Value="{DynamicResource GrayBrush10}" /> <Setter Property="PaneForeground" Value="{DynamicResource TextBrush}" /> <Setter Property="ShowSelectionIndicator" Value="True" /> </Style> </ResourceDictionary> </Window.Resources> <Controls:MetroWindow.RightWindowCommands> <Controls:WindowCommands> <Button Name="GitHub"> <StackPanel Orientation="Horizontal"> <Rectangle Width="20" Height="20" Fill="{Binding RelativeSource={RelativeSource AncestorType=Button}, Path=Foreground}" ToolTip="GitHub"> <Rectangle.OpacityMask> <VisualBrush Stretch="Fill" Visual="{iconPacks:PackIconMaterial Kind=GithubCircle}" /> </Rectangle.OpacityMask> </Rectangle> </StackPanel> </Button> </Controls:WindowCommands> </Controls:MetroWindow.RightWindowCommands> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="*" /> <ColumnDefinition Width="Auto" /> </Grid.ColumnDefinitions> <StackPanel Margin="10,0,0,0" Orientation="Horizontal" HorizontalAlignment="Center"> <StackPanel Margin="0,-0,0,0" Orientation="Horizontal" > <Image Margin="-35 -490 40 0" Source="images/macDialog.png" Height="250" Width="250" ></Image> <Label FontSize="30" Content=" Management" Foreground="#FF444444" Margin="-190,20,0,0" ></Label> <Label FontSize="30" Content="Pwsh" Foreground="#FF082C9D" Margin="0,20,0,0"></Label> <Label FontSize="30" Content="Module" Foreground="#FF444444" Margin="0,20,0,0"></Label> </StackPanel> </StackPanel> <Border Grid.Column="0" Margin="10 90 10 10" BorderBrush="{DynamicResource AccentBaseColorBrush}" BorderThickness="1"> <Controls:HamburgerMenu x:Name="TabMenuHamburger" HamburgerVisibility="Visible" HamburgerWidth="48" IsPaneOpen="False" ItemTemplate="{StaticResource HamburgerMenuItem}" SelectedIndex="0" Style="{StaticResource HamburgerMenuCreatorsStyle}" VerticalScrollBarOnLeftSide="False"> <!-- Items --> <Controls:HamburgerMenu.ItemsSource> <Controls:HamburgerMenuItemCollection> <Controls:HamburgerMenuIconItem Icon="{iconPacks:PackIcon {x:Static iconPacks:PackIconEntypoKind.Install}, Width=26, Height=26}" Label="Installed"> <Controls:HamburgerMenuIconItem.Tag> <Grid x:Name="Installed"></Grid> </Controls:HamburgerMenuIconItem.Tag> </Controls:HamburgerMenuIconItem> <Controls:HamburgerMenuIconItem Icon="{iconPacks:PackIcon {x:Static iconPacks:PackIconMaterialKind.Update}, Width=26, Height=26}" Label="Updated"> <Controls:HamburgerMenuIconItem.Tag> <Grid x:Name="Updated"></Grid> </Controls:HamburgerMenuIconItem.Tag> </Controls:HamburgerMenuIconItem> <Controls:HamburgerMenuIconItem Icon="{iconPacks:PackIcon {x:Static iconPacks:PackIconOcticonsKind.Terminal}, Width=32, Height=32}" Label="Install PowerShell Module"> <Controls:HamburgerMenuIconItem.Tag> <Grid x:Name="InstalleOne"></Grid> </Controls:HamburgerMenuIconItem.Tag> </Controls:HamburgerMenuIconItem> </Controls:HamburgerMenuItemCollection> </Controls:HamburgerMenu.ItemsSource> <Controls:HamburgerMenu.ContentTemplate> <DataTemplate DataType="{x:Type Controls:HamburgerMenuItem}"> <Grid> <Grid.RowDefinitions> <RowDefinition Height="48" /> <!-- Height of the Horizonyal bar --> <RowDefinition/> </Grid.RowDefinitions> <Border Grid.Row="0"> <!--TextBlock x:Name="Header" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="24" Foreground="Black" Text="{Binding Label}" /--> </Border> <ContentControl Grid.Row="1" Focusable="False" Foreground="{DynamicResource BlackBrush}" Content="{Binding Tag}" /> </Grid> </DataTemplate> </Controls:HamburgerMenu.ContentTemplate> </Controls:HamburgerMenu> </Border> </Grid> </Controls:MetroWindow> |