Skip to content
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

Regression with NavigationView now producing binding error when minimising it #9384

Closed
beeradmoore opened this issue Mar 2, 2024 · 16 comments
Labels
area-NavigationView NavView control bug Something isn't working closed-Fixed Described behavior has been fixed. fix-released The fix has been in a release (experimental, preview, stable, or servicing). needs-triage Issue needs to be triaged by the area owners Regression team-Controls Issue for the Controls team
Milestone

Comments

@beeradmoore
Copy link

beeradmoore commented Mar 2, 2024

Describe the bug

Updating my app to the latest WinUI version (1.5.240227000) I noticed I started getting a binding warning when I run it. The previous version (1.4.240211001) does not have this issue.

Error: Converter failed to convert value of type 'Windows.Foundation.IReference`1<Microsoft.UI.Xaml.GridLength>' to type 'Double'; BindingExpression: Path='TemplateSettings.CompactPaneGridLength' DataItem='Microsoft.UI.Xaml.Controls.SplitView'; target element is 'Microsoft.UI.Xaml.Media.Animation.SplineDoubleKeyFrame' (Name='null'); target property is 'Value' (type 'Double').

I was able to keep deleting code until I got it to dissapear and I got an app layout down to a single NavigationView.

<?xml version="1.0" encoding="utf-8"?>
<Window
    x:Class="NavViewBindingIssue.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:NavViewBindingIssue"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
    mc:Ignorable="d">
    <muxc:NavigationView>

    </muxc:NavigationView>
</Window>

If you launch this there will be no binding issues. If you minmise the nav by clicking the hamburger button it will generate the above binding issue.

Additionally if you make your nav view this it will show the binding error on launch.

    <muxc:NavigationView PaneDisplayMode="LeftCompact">
    
    </muxc:NavigationView>

Steps to reproduce the bug

  1. Create new WinUI project
  2. Update nugets to latest versions
  3. Change MainWindow.xaml to have the above NavigationView
  4. (fix any issues of not compiling because you remove the normal button)
  5. Run and toggle the side menu to see the binding error output on the debug console (and on screen helper bar)
  6. Roll back one version to 1.4.240211001 and test again, binding issue is now gone.

Expected behavior

No binding errors.

Screenshots

N/A

NuGet package version

WinUI 3 - Windows App SDK 1.5.0: 1.5.240227000

Windows version

Windows 11 (23H2): Build 22631

Additional context

N/A

@beeradmoore beeradmoore added the bug Something isn't working label Mar 2, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the needs-triage Issue needs to be triaged by the area owners label Mar 2, 2024
Copy link

github-actions bot commented Mar 2, 2024

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one. Thank you!

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@molesmoke
Copy link

I'm also seeing this if MAUI is built against WinUI 3 v1.5.240227000

@27k1
Copy link

27k1 commented Mar 22, 2024

I get the same problem with WINUI 3 all latest nuGet packages. This issue is not closed, Please reopen.

@kmgallahan
Copy link
Contributor

Please reopen.

@27k1 It isn't closed.

@parko65
Copy link

parko65 commented Mar 26, 2024

Issue is still present in 1.5.240311000

@MPITech
Copy link

MPITech commented Mar 31, 2024

Confirmed, happens here as well still in 1.5.240311000.

@ranjeshj
Copy link
Contributor

ranjeshj commented Apr 4, 2024

The offending piece is the makrup below in the SplitView template - we are trying to bind a gridlength to translatex - which are not compatible types.

<DoubleAnimationUsingKeyFrames Storyboard.TargetName="PaneClipRectangleTransform" Storyboard.TargetProperty="TranslateX">
      <SplineDoubleKeyFrame KeyTime="{StaticResource SplitViewPaneAnimationCloseDuration}" KeySpline="0.0,0.35 0.15,1.0" Value="{Binding TemplateSettings.CompactPaneGridLength, RelativeSource={RelativeSource Mode=TemplatedParent}}" />
  </DoubleAnimationUsingKeyFrames>

@llongley llongley added this to the WinAppSDK 1.6 milestone Apr 10, 2024
@llongley llongley added the closed-Fixed Described behavior has been fixed. label Apr 10, 2024
@kanyu
Copy link

kanyu commented May 31, 2024

Hi, I'm using 1.5.240428000 in WinUI3 and this problem has still happened. When does 1.6 come out? Thanks

@microsoft-github-policy-service microsoft-github-policy-service bot added the needs-triage Issue needs to be triaged by the area owners label May 31, 2024
@codendone codendone added fix-released The fix has been in a release (experimental, preview, stable, or servicing). and removed needs-triage Issue needs to be triaged by the area owners labels Jul 3, 2024
@voroninp
Copy link

Seeing this error on MAUI when opening/closing Flyout:

Error: Converter failed to convert value of type 'Windows.Foundation.IReference`1<Microsoft.UI.Xaml.GridLength>' to type 'Double'; BindingExpression: Path='TemplateSettings.CompactPaneGridLength' DataItem='Microsoft.UI.Xaml.Controls.SplitView'; target element is 'Microsoft.UI.Xaml.Media.Animation.SplineDoubleKeyFrame' (Name='null'); target property is 'Value' (type 'Double').

@microsoft-github-policy-service microsoft-github-policy-service bot added the needs-triage Issue needs to be triaged by the area owners label Aug 10, 2024
@codendone codendone removed the needs-triage Issue needs to be triaged by the area owners label Aug 12, 2024
@TinTin-Esoterico
Copy link

@voroninp I'm with the same problem when trying to close the flyout page. Latest version of SDK and all up to date nugetpkgs

@microsoft-github-policy-service microsoft-github-policy-service bot added the needs-triage Issue needs to be triaged by the area owners label Sep 4, 2024
@parko65
Copy link

parko65 commented Sep 8, 2024

Has this issue been resolved, I'm no longer seeing any runtime binding errors. What, if any, update did this?

@beeradmoore
Copy link
Author

I was working with 1.6 on the weekend, I don't recall seeing it anymore.

I'll check later though.

@Fred-Hudson-CST
Copy link

Seeing this error on MAUI when opening/closing Flyout:

Error: Converter failed to convert value of type 'Windows.Foundation.IReference`1<Microsoft.UI.Xaml.GridLength>' to type 'Double'; BindingExpression: Path='TemplateSettings.CompactPaneGridLength' DataItem='Microsoft.UI.Xaml.Controls.SplitView'; target element is 'Microsoft.UI.Xaml.Media.Animation.SplineDoubleKeyFrame' (Name='null'); target property is 'Value' (type 'Double').

I am also seeing this error in my MAUI project, did you find any workarounds

@beeradmoore
Copy link
Author

@Fred-Hudson-CST , did you update the WindowsAppSDK with MAUI or just using what it comes with?

Looking at the NuGet package for the current stable Microsoft.Maui.Core (v8.0.91), under dependencies it looks like all variants of net8.0-windows have a dependency of Microsoft.WindowsAppSDK >= 1.5.240802000.

In theory installing the latest Microsoft.WindowsAppSDK nuget should fix this issue as it should have been fixed in v1.6. But there may be things break in MAUI because it is using a WindowsAppSDK that is newer than what its minimum dependency version is. Worst case scenario you add it and things break and you have to roll back and wait for MAUI team to bump the minimum dependency. Best case scenario everything works and you get the advantages of updated WindowsAppSDK version.

@MartyIX
Copy link
Contributor

MartyIX commented Oct 14, 2024

A few days ago dotnet/maui#24266 was merged into the MAUI .NET 9 branch https://github.com/dotnet/maui/commits/net9.0/. MAUI .NET 9 GA will be released in one month.

@Fred-Hudson-CST
Copy link

In theory installing the latest Microsoft.WindowsAppSDK nuget should fix this issue as it should have been fixed in v1.6. But there may be things break in MAUI because it is using a WindowsAppSDK that is newer than what its minimum dependency version is. Worst case scenario you add it and things break and you have to roll back and wait for MAUI team to bump the minimum dependency. Best case scenario everything works and you get the advantages of updated WindowsAppSDK version.

Adding that did in fact break it, looks like ill just have to wait

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-NavigationView NavView control bug Something isn't working closed-Fixed Described behavior has been fixed. fix-released The fix has been in a release (experimental, preview, stable, or servicing). needs-triage Issue needs to be triaged by the area owners Regression team-Controls Issue for the Controls team
Projects
None yet
Development

No branches or pull requests