-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update TitleBar Control (sync with Labs)
- Loading branch information
Showing
6 changed files
with
330 additions
and
99 deletions.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
CommunityToolkit.App.Shared/Controls/TitleBar/InfoHelper.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using Windows.ApplicationModel; | ||
using Windows.Storage; | ||
using Windows.System.Profile; | ||
|
||
namespace CommunityToolkit.App.Shared.Controls; | ||
internal static class InfoHelper | ||
{ | ||
public static Version AppVersion { get; } = new Version( | ||
Package.Current.Id.Version.Major, | ||
Package.Current.Id.Version.Minor, | ||
Package.Current.Id.Version.Build, | ||
Package.Current.Id.Version.Revision | ||
); | ||
|
||
public static Version SystemVersion { get; } | ||
|
||
public static SystemDataPaths SystemDataPath { get; } = SystemDataPaths.GetDefault(); | ||
|
||
public static UserDataPaths UserDataPath { get; } = UserDataPaths.GetDefault(); | ||
|
||
public static string AppInstalledLocation { get; } = Package.Current.InstalledLocation.Path; | ||
|
||
static InfoHelper() | ||
{ | ||
string systemVersion = AnalyticsInfo.VersionInfo.DeviceFamilyVersion; | ||
ulong version = ulong.Parse(systemVersion); | ||
SystemVersion = new Version( | ||
(int)((version & 0xFFFF000000000000L) >> 48), | ||
(int)((version & 0x0000FFFF00000000L) >> 32), | ||
(int)((version & 0x00000000FFFF0000L) >> 16), | ||
(int)(version & 0x000000000000FFFFL) | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.