Skip to content

Commit

Permalink
Add icon to title bar
Browse files Browse the repository at this point in the history
  • Loading branch information
NotYoojun committed Dec 23, 2024
1 parent 5189d40 commit 9d7bcee
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 25 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:iNKORE.UI.WPF.Modern.Gallery"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern" xmlns:controls="clr-namespace:iNKORE.UI.WPF.Modern.Gallery.Controls"
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern" xmlns:controls="clr-namespace:iNKORE.UI.WPF.Modern.Gallery.Controls" xmlns:ikw="http://schemas.inkore.net/lib/ui/wpf"
Title="NavigationRootPage"
d:DesignHeight="450"
d:DesignWidth="800"
Expand Down Expand Up @@ -60,11 +60,13 @@
<ColumnDefinition/>
<ColumnDefinition Width="137"/>
</Grid.ColumnDefinitions>
<TextBlock
x:Name="AppTitle" Grid.Column="1"
VerticalAlignment="Center"
Style="{DynamicResource CaptionTextBlockStyle}"
Text="{x:Static local:NavigationRootPage.GetAppTitleFromSystem}" Margin="0,1,20,0" TextWrapping="NoWrap"/>
<ikw:SimpleStackPanel x:Name="AppTitle" Orientation="Horizontal" Spacing="12">
<Image Source="/Assets/WpfLibrary_Minimal_64w.png" Width="20" RenderOptions.BitmapScalingMode="HighQuality" Margin="-3,0,0,0"/>
<TextBlock x:Name="AppTitleText" Grid.Column="1"
VerticalAlignment="Center"
Style="{DynamicResource CaptionTextBlockStyle}"
Text="{x:Static local:NavigationRootPage.GetAppTitleFromSystem}" Margin="0,1,20,0" TextWrapping="NoWrap"/>
</ikw:SimpleStackPanel>
</Grid>
</Border>

Expand All @@ -75,7 +77,7 @@
Canvas.ZIndex="0"
DisplayModeChanged="NavigationViewControl_DisplayModeChanged"
Header=" " IsFooterSeparatorVisible="{x:Null}"
PaneTitle="App Gallery"
PaneTitle="Gallery App"
IsTabStop="False"
IsTitleBarAutoPaddingEnabled="False"
Loaded="OnNavigationViewControlLoaded"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,15 @@ public NavigationRootPage()
{
//NavigationOrientationHelper.UpdateTitleBar(NavigationOrientationHelper.IsLeftMode);
};

NavigationViewControl.PaneTitle = NavigationViewControl.PaneTitle + $" (v{ThemeManager.AssemblyVersion})";
}

public static string GetAppTitleFromSystem
{
get
{
return "iNKORE.UI.WPF.Modern - Modern styles for your WPF applications by iNKORE Studios";
return "iNKORE.UI.WPF.Modern";
//if (PackagedAppHelper.IsPackagedApp)
//{
// try
Expand Down
3 changes: 2 additions & 1 deletion source/iNKORE.UI.WPF.Modern.Gallery/Pages/SettingsPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@

</TextBlock>
<TextBlock Margin="0,10,0,0">
Version:<Run FontWeight="Bold" Text="{Binding Version, Mode=OneWay}" />
Version:
<Run FontWeight="Bold" Text="{Binding Version, Mode=OneWay}" />
</TextBlock>

<!--<TextBlock
Expand Down
17 changes: 1 addition & 16 deletions source/iNKORE.UI.WPF.Modern.Gallery/Pages/SettingsPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,7 @@ namespace iNKORE.UI.WPF.Modern.Gallery.Pages
/// </summary>
public partial class SettingsPage : Page
{
public string Version
{
get
{
if (PackagedAppHelper.IsPackagedApp)
{
var version = Windows.ApplicationModel.Package.Current.Id.Version;
return string.Format("{0}.{1}.{2}.{3}", version.Major, version.Minor, version.Build, version.Revision);
}
else
{
var version = Assembly.GetEntryAssembly()?.GetName().Version;
return string.Format("{0}.{1}.{2}.{3}", version.Major, version.Minor, version.Build, version.Revision);
}
}
}
public string Version => ThemeManager.AssemblyVersion;

public SettingsPage()
{
Expand Down

0 comments on commit 9d7bcee

Please sign in to comment.