Skip to content

Commit

Permalink
Now TestEditor.App has the application's version
Browse files Browse the repository at this point in the history
  • Loading branch information
iconstudio committed Oct 3, 2023
1 parent 491a134 commit fd3ff77
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
10 changes: 10 additions & 0 deletions Editor/TestEditor/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Diagnostics;
using System.Runtime.InteropServices;

using Windows.ApplicationModel;
using Windows.Devices.Display;
using Windows.Devices.Enumeration;
using Windows.Graphics;
Expand All @@ -18,6 +19,11 @@ namespace TestEditor

public partial class App : Application, ISingleton<App>, IDisposable
{
public static readonly string Version = string.Format(null, "v{0}.{1}.{2}.{3}", Package.Current.Id.Version.Major,
Package.Current.Id.Version.Minor,
Package.Current.Id.Version.Build,
Package.Current.Id.Version.Revision);

public const int minWidth = 600;
public const int minHeight = 400;
internal static readonly SizeInt32 minSize = new(minWidth, minHeight);
Expand All @@ -32,6 +38,10 @@ internal event WindowSubRoutine SubRoutines
remove => myProject.SubRoutines -= value;
}

static App()
{

}
public App()
{
InitializeComponent();
Expand Down
11 changes: 1 addition & 10 deletions Editor/TestEditor/Infrastructures/HomePage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,10 @@
using Microsoft.UI.Xaml.Media.Animation;
using Microsoft.UI.Xaml.Navigation;

using Windows.ApplicationModel;
using Windows.UI;

namespace TestEditor
{
public sealed partial class HomePage : Page
{
private static readonly string appVersion = string.Format(null, "v{0}.{1}.{2}.{3}",
Package.Current.Id.Version.Major,
Package.Current.Id.Version.Minor,
Package.Current.Id.Version.Build,
Package.Current.Id.Version.Revision);

private bool isSettingOpened;
private bool isSettingTransitioning;
private readonly TimeSpan settingTransitionDuration;
Expand All @@ -23,7 +14,7 @@ public HomePage()
{
InitializeComponent();

appVersionText.Text = appVersion;
appVersionText.Text = App.Version;

if (Resources["SettingTransitionDuration"] is string represent)
{
Expand Down

0 comments on commit fd3ff77

Please sign in to comment.