Skip to content

Commit 5ee14b0

Browse files
authored
Merge pull request #611 from unoplatform/pj/update-code-on-mvvm-samples
Update code on mvvm samples for SimpleCalc
2 parents 9911209 + 412423b commit 5ee14b0

File tree

13 files changed

+487
-506
lines changed

13 files changed

+487
-506
lines changed

reference/SimpleCalc/MVVM-CSharp/Directory.Packages.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<PackageVersion Include="Uno.Extensions.Core.WinUI" Version="3.0.9" />
1717
<PackageVersion Include="Uno.Extensions.Logging.OSLog" Version="1.7.0" />
1818
<PackageVersion Include="Uno.Extensions.Logging.WebAssembly.Console" Version="1.7.0" />
19-
<PackageVersion Include="Uno.Material.WinUI" Version="4.0.3" />
19+
<PackageVersion Include="Uno.Material.WinUI" Version="4.0.6" />
2020
<PackageVersion Include="Uno.Toolkit.WinUI" Version="5.0.13" />
2121
<PackageVersion Include="Uno.Toolkit.WinUI.Material" Version="5.0.13" />
2222
<PackageVersion Include="Uno.Resizetizer" Version="1.2.1" />
Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,39 @@
1-
using Application = Microsoft.UI.Xaml.Application;
1+
using Application = Microsoft.UI.Xaml.Application;
22

33
namespace SimpleCalculator;
44

55
public class App : Application
66
{
7-
public static Window? _window;
7+
public static Window? _window;
88

9-
protected override void OnLaunched(LaunchActivatedEventArgs args)
10-
{
9+
protected override void OnLaunched(LaunchActivatedEventArgs args)
10+
{
1111
#if NET6_0_OR_GREATER && WINDOWS && !HAS_UNO
1212
_window = new Window();
1313
#else
14-
_window = Microsoft.UI.Xaml.Window.Current;
14+
_window = Microsoft.UI.Xaml.Window.Current;
1515
#endif
1616

17-
// Do not repeat app initialization when the Window already has content,
18-
// just ensure that the window is active
19-
if (_window.Content is not Frame rootFrame)
20-
{
21-
// Create a Frame to act as the navigation context and navigate to the first page
22-
rootFrame = new Frame();
17+
// Do not repeat app initialization when the Window already has content,
18+
// just ensure that the window is active
19+
if (_window.Content is not Frame rootFrame)
20+
{
21+
// Create a Frame to act as the navigation context and navigate to the first page
22+
rootFrame = new Frame();
2323

24-
// Place the frame in the current Window
25-
_window.Content = rootFrame;
26-
}
24+
// Place the frame in the current Window
25+
_window.Content = rootFrame;
26+
}
2727

28-
if (rootFrame.Content == null)
29-
{
30-
// When the navigation stack isn't restored navigate to the first page,
31-
// configuring the new page by passing required information as a navigation
32-
// parameter
33-
rootFrame.Navigate(typeof(MainPage), args.Arguments);
34-
}
28+
if (rootFrame.Content == null)
29+
{
30+
// When the navigation stack isn't restored navigate to the first page,
31+
// configuring the new page by passing required information as a navigation
32+
// parameter
33+
rootFrame.Navigate(typeof(MainPage), args.Arguments);
34+
}
3535

36-
// Ensure the current window is active
37-
_window.Activate();
38-
}
39-
}
36+
// Ensure the current window is active
37+
_window.Activate();
38+
}
39+
}

reference/SimpleCalc/MVVM-CSharp/SimpleCalculator/AppResources.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
using Uno.Toolkit.UI;
21
using Uno.Material;
2+
using Uno.Toolkit.UI;
33

44
namespace SimpleCalculator;
55

@@ -19,5 +19,5 @@ public AppResources()
1919
// Load Uno.UI.Toolkit Resources
2020
this.Build(r => r.Merged(
2121
new ToolkitResources()));
22-
}
23-
}
22+
}
23+
}

0 commit comments

Comments
 (0)