Skip to content

chore: remove dependson from nav sample #882

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 4 commits into
base: dev/erli/nav-sample-fix-init
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions UI/Navigation/src/Navigation/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ protected async override void OnLaunched(LaunchActivatedEventArgs args)
MainWindow = builder.Window;

#if DEBUG
MainWindow.EnableHotReload();
MainWindow.UseStudio();
#endif
MainWindow.SetWindowIcon();

Expand Down Expand Up @@ -107,12 +107,12 @@ private static void RegisterRoutes(IViewRegistry views, IRouteRegistry routes)
new RouteMap("", View: views.FindByViewModel<ShellViewModel>(),
Nested:
[
new ("Main", View: views.FindByViewModel<MainViewModel>(),
new ("Main", View: views.FindByViewModel<MainViewModel>(), IsDefault: true,
Nested:
[
#region Page Navigation
new ("PageNavigation", View: views.FindByViewModel<PageNavigationViewModel>(), IsDefault: true),
new ("Sample", View: views.FindByView<SamplePage>(), DependsOn: "PageNavigation"),
new ("Sample", View: views.FindByView<SamplePage>()),
#endregion

#region ContentControl Navigation
Expand Down Expand Up @@ -143,7 +143,7 @@ private static void RegisterRoutes(IViewRegistry views, IRouteRegistry routes)

#region Request a Value
new ("RequestValueMain", View: views.FindByViewModel<RequestValueMainViewModel>()),
new ("RequestValueSecond", View: views.FindByViewModel<RequestValueSecondViewModel>(), DependsOn: "RequestValueMain"),
new ("RequestValueSecond", View: views.FindByViewModel<RequestValueSecondViewModel>()),
#endregion

#region Message Dialog
Expand All @@ -158,13 +158,13 @@ private static void RegisterRoutes(IViewRegistry views, IRouteRegistry routes)
new ("ComplexFlyout", View: views.FindByView<ComplexFlyoutPage>(), Nested:
[
new ("ComplexFlyoutOne", View: views.FindByViewModel<ComplexFlyoutOneViewModel>(), IsDefault:true),
new ("ComplexFlyoutSecond", View: views.FindByViewModel<ComplexFlyoutTwoViewModel>(), DependsOn: "ComplexFlyoutOne")
new ("ComplexFlyoutSecond", View: views.FindByViewModel<ComplexFlyoutTwoViewModel>())
]),
#endregion

#region ToFromQuery
new ("ToFromQueryMain", View: views.FindByViewModel<ToFromQueryMainViewModel>()),
new ("ToFromQuery", View: views.FindByViewModel<ToFromQueryViewModel>(), DependsOn: "ToFromQueryMain"),
new ("ToFromQuery", View: views.FindByViewModel<ToFromQueryViewModel>()),
#endregion

#region Flyout Drawer
Expand Down
15 changes: 2 additions & 13 deletions UI/Navigation/src/Navigation/Navigation.csproj
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
<Project Sdk="Uno.Sdk">
<PropertyGroup>
<TargetFrameworks>
net8.0-android;
net8.0-ios;
net8.0-maccatalyst;
net8.0-windows10.0.19041;
net8.0-desktop;
net8.0-browserwasm;
</TargetFrameworks>
<TargetFrameworks>net9.0-android;net9.0-ios;net9.0-windows10.0.26100;net9.0-browserwasm;net9.0-desktop</TargetFrameworks>

<OutputType>Exe</OutputType>
<UnoSingleProject>true</UnoSingleProject>
Expand All @@ -29,11 +22,7 @@
the "Microsoft.Windows.SDK.BuildTools" package above, and the "revision" version number
must be the highest found in https://www.nuget.org/packages/Microsoft.Windows.SDK.NET.Ref.
-->

<!-- Uno Platform 5.4 has been updated to use WinAppSDK 1.6, which necessitates a temporary version adjustment until newer versions of .NET 8 SDKs are released. -->
<!-- Comment this WindowsSdkPackageVersion line again once .NET SDK version 8.0.403 or later is available. -->
<!-- For more details, refer to: https://aka.platform.uno/migrate-from-previous#uno-platform-54 -->
<WindowsSdkPackageVersion>10.0.19041.38</WindowsSdkPackageVersion>
<!-- <WindowsSdkPackageVersion>10.0.22621.28</WindowsSdkPackageVersion> -->

<!--
UnoFeatures let's you quickly add and manage implicit package references based on the features you want to use.
Expand Down
4 changes: 2 additions & 2 deletions UI/Navigation/src/Navigation/Platforms/Desktop/Program.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
using Uno.UI.Runtime.Skia;
using Uno.UI.Hosting;

namespace Navigation;
public class Program
{
[STAThread]
public static void Main(string[] args)
{
var host = SkiaHostBuilder.Create()
var host = UnoPlatformHostBuilder.Create()
.App(() => new App())
.UseX11()
.UseLinuxFrameBuffer()
Expand Down
2 changes: 1 addition & 1 deletion UI/Navigation/src/Navigation/Presentation/MainPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@

<muxc:NavigationView.MenuItems>

<muxc:NavigationViewItem uen:Region.Name="./PageNavigation"
<muxc:NavigationViewItem uen:Region.Name="PageNavigation"
Content="Page Navigation">
<muxc:NavigationViewItem.Icon>
<SymbolIcon Symbol="Page" />
Expand Down
6 changes: 0 additions & 6 deletions UI/Navigation/src/Navigation/Presentation/ShellViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,5 @@ public ShellViewModel(
INavigator navigator)
{
_navigator = navigator;
_ = Start();
}

public async Task Start()
{
await _navigator.NavigateViewModelAsync<MainViewModel>(this);
}
}
2 changes: 1 addition & 1 deletion UI/Navigation/src/global.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
// To update the version of Uno please update the version of the Uno.Sdk here. See https://aka.platform.uno/upgrade-uno-packages for more information.
"msbuild-sdks": {
"Uno.Sdk": "5.5.56"
"Uno.Sdk": "6.0.67"
},
"sdk": {
"allowPrerelease": false
Expand Down