unoplatform / uno.toolkit.ui

A set of custom controls for the WinUI and the Uno Platform not offered out of the box by WinUI, such as Card, TabBar, NavigationBar, etc.
https://platform.uno/
MIT License
83 stars 27 forks source link

[Win] App crashes when navigating to a modal with a navigation bar with no main command defined #676

Open Marc-Antoine-Soucy opened 1 year ago

Marc-Antoine-Soucy commented 1 year ago

Current behavior

When you do a modal navigation toward a page that has a navigation bar, but no "MainCommand" defined, the app crashes.

Expected behavior

I would expect the app to not crash.

How to reproduce it (as minimally and precisely as possible)

Enter the app, press on open second page with modal, notice the app crash. Enter the app, press on open second page, notice the app does not crash.

(if you put navigationCacheMode to required, it will not crash if you go to the non-modal page first, but it will still crash if you go to the modal page first.)

unoExtensionBasicApp.zip

Environment

Windows

Nuget Package:

<PackageVersion Include="Uno.Extensions.Configuration" Version="3.0.0-dev.1984" />
    <PackageVersion Include="Uno.Extensions.Hosting" Version="2.4.2" />
    <PackageVersion Include="Uno.Extensions.Hosting.WinUI" Version="3.0.0-dev.1984" />
    <PackageVersion Include="Uno.Extensions.Http" Version="3.0.0-dev.1984" />
    <PackageVersion Include="Uno.Extensions.Http.Refit" Version="3.0.0-dev.1984" />
    <PackageVersion Include="Uno.Extensions.Localization" Version="2.4.2" />
    <PackageVersion Include="Uno.Extensions.Localization.WinUI" Version="3.0.0-dev.1984" />
    <PackageVersion Include="Uno.Extensions.Logging.OSLog" Version="1.6.0-dev.2" />
    <PackageVersion Include="Uno.Extensions.Logging.WebAssembly.Console" Version="1.6.0-dev.2" />
    <PackageVersion Include="Uno.Extensions.Logging.WinUI" Version="3.0.0-dev.1984" />
    <PackageVersion Include="Uno.Extensions.Navigation" Version="2.4.2" />
    <PackageVersion Include="Uno.Extensions.Navigation.WinUI" Version="3.0.0-dev.1984" />
    <PackageVersion Include="Uno.Extensions.Navigation.Toolkit.WinUI" Version="3.0.0-dev.1984" />
    <PackageVersion Include="Uno.Extensions.Reactive" Version="2.4.2" />
    <PackageVersion Include="Uno.Extensions.Reactive.WinUI" Version="3.0.0-dev.1984" />
    <PackageVersion Include="Uno.Extensions.Serialization" Version="2.4.2" />
    <PackageVersion Include="Uno.Extensions.Serialization.Http" Version="3.0.0-dev.1984" />
    <PackageVersion Include="Uno.Extensions.Serialization.Refit" Version="3.0.0-dev.1984" />
    <PackageVersion Include="Uno.Material.WinUI" Version="3.0.0-dev.264" />
    <PackageVersion Include="Uno.Dsp.Tasks" Version="1.1.0" />
    <PackageVersion Include="Uno.Toolkit.WinUI" Version="4.0.0-dev.52" />
    <PackageVersion Include="Uno.Extensions.Toolkit.WinUI" Version="3.0.0-dev.1984" />
    <PackageVersion Include="Uno.Toolkit.WinUI.Material" Version="4.0.0-dev.52" />
    <PackageVersion Include="Uno.Resizetizer" Version="1.2.0-dev.19" />
    <PackageVersion Include="Uno.UI.Adapter.Microsoft.Extensions.Logging" Version="5.0.0-dev.1433" />
    <PackageVersion Include="Uno.UniversalImageLoader" Version="1.9.36" />
    <PackageVersion Include="Uno.Wasm.Bootstrap" Version="8.0.0-dev.226" />
    <PackageVersion Include="Uno.Wasm.Bootstrap.DevServer" Version="8.0.0-dev.226" />
    <PackageVersion Include="Uno.Wasm.Bootstrap.Server" Version="8.0.0-dev.226" />
    <PackageVersion Include="Uno.WinUI" Version="5.0.0-dev.1433" />
    <PackageVersion Include="Uno.WinUI.RemoteControl" Version="5.0.0-dev.1433" />
    <PackageVersion Include="Uno.WinUI.Skia.Gtk" Version="5.0.0-dev.1433" />
    <PackageVersion Include="Uno.WinUI.WebAssembly" Version="5.0.0-dev.1433" />

Package Version(s):

Affected platform(s):

Visual Studio:

Relevant plugins:

Anything else we need to know?

WinRT.Runtime.dll!WinRT.ExceptionHelpers.ThrowExceptionForHR.__Throw|20_0(int hr = -2147024809) Unknown No symbols loaded. Microsoft.WinUI.dll!ABI.Microsoft.UI.Xaml.IFrameworkElementOverridesMethods.MeasureOverride(WinRT.IObjectReference _obj = {WinRT.ObjectReference}, Windows.Foundation.Size availableSize = {Windows.Foundation.Size}) Unknown No symbols loaded. Microsoft.WinUI.dll!Microsoft.UI.Xaml.FrameworkElement.MeasureOverride(Windows.Foundation.Size availableSize = {Windows.Foundation.Size}) Unknown No symbols loaded. Microsoft.WinUI.dll!Microsoft.UI.Xaml.FrameworkElement.Microsoft.UI.Xaml.IFrameworkElementOverrides.MeasureOverride(Windows.Foundation.Size availableSize = {Windows.Foundation.Size}) Unknown No symbols loaded. Microsoft.WinUI.dll!ABI.Microsoft.UI.Xaml.IFrameworkElementOverrides.Do_Abi_MeasureOverride_0(nint thisPtr, Windows.Foundation.Size availableSize, Windows.Foundation.Size result) Unknown No symbols loaded. [Native to Managed Transition] Annotated Frame [Managed to Native Transition] Annotated Frame Microsoft.WinUI.dll!ABI.Microsoft.UI.Xaml.IFrameworkElementOverridesMethods.MeasureOverride(WinRT.IObjectReference _obj = {WinRT.ObjectReference}, Windows.Foundation.Size availableSize = {Windows.Foundation.Size}) Unknown No symbols loaded. Microsoft.WinUI.dll!Microsoft.UI.Xaml.FrameworkElement.MeasureOverride(Windows.Foundation.Size availableSize = {Windows.Foundation.Size}) Unknown No symbols loaded. Microsoft.WinUI.dll!Microsoft.UI.Xaml.FrameworkElement.Microsoft.UI.Xaml.IFrameworkElementOverrides.MeasureOverride(Windows.Foundation.Size availableSize = {Windows.Foundation.Size}) Unknown No symbols loaded. Microsoft.WinUI.dll!ABI.Microsoft.UI.Xaml.IFrameworkElementOverrides.Do_Abi_MeasureOverride_0(nint thisPtr, Windows.Foundation.Size availableSize, Windows.Foundation.Size result) Unknown No symbols loaded. [Native to Managed Transition] Annotated Frame [Managed to Native Transition] Annotated Frame Microsoft.WinUI.dll!ABI.Microsoft.UI.Xaml.IFrameworkElementOverridesMethods.MeasureOverride(WinRT.IObjectReference _obj = {WinRT.ObjectReference}, Windows.Foundation.Size availableSize = {Windows.Foundation.Size}) Unknown No symbols loaded. Microsoft.WinUI.dll!Microsoft.UI.Xaml.FrameworkElement.MeasureOverride(Windows.Foundation.Size availableSize = {Windows.Foundation.Size}) Unknown No symbols loaded. Microsoft.WinUI.dll!Microsoft.UI.Xaml.FrameworkElement.Microsoft.UI.Xaml.IFrameworkElementOverrides.MeasureOverride(Windows.Foundation.Size availableSize = {Windows.Foundation.Size}) Unknown No symbols loaded. Microsoft.WinUI.dll!ABI.Microsoft.UI.Xaml.IFrameworkElementOverrides.Do_Abi_MeasureOverride_0(nint thisPtr, Windows.Foundation.Size availableSize, Windows.Foundation.Size* result) Unknown No symbols loaded. [Native to Managed Transition] Annotated Frame [Managed to Native Transition] Annotated Frame Microsoft.WinUI.dll!ABI.Microsoft.UI.Xaml.IApplicationStaticsMethods.Start(WinRT.IObjectReference _obj = {WinRT.ObjectReference}, Microsoft.UI.Xaml.ApplicationInitializationCallback callback = {Method = {System.Reflection.RuntimeMethodInfo}}) Unknown No symbols loaded. Microsoft.WinUI.dll!Microsoft.UI.Xaml.Application.Start(Microsoft.UI.Xaml.ApplicationInitializationCallback callback = {Method = {System.Reflection.RuntimeMethodInfo}}) Unknown No symbols loaded. unoExtensionBasicApp.Windows.dll!unoExtensionBasicApp.Program.Main(string[] args = {string[0]}) Line 31 C# Symbols loaded.

nickrandolph commented 1 year ago

@kazo0 moving this to toolkit as it seems to be related to NavigationBar (see call stack)