WPF and RibbonControlsLibrary throws a BindingExpression path error without even using Bindings?
Asked Answered
E

2

8

I have a question regarding WPF and RibbonControlsLibrary. I tried to find the source of this error myself but I just do not seem to be able to find it.

I am using the WPF RibbonControlsLibrary from Microsoft. When using the RibbonToggleButton I get the following error even without any bindings in my XAML code.

<r:RibbonWindow x:Class="WpfApplication.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="MainWindow" Height="300" Width="300"
    xmlns:r="clr-namespace:Microsoft.Windows.Controls.Ribbon;assembly=RibbonControlsLibrary">
    <r:Ribbon>
        <r:RibbonTab Header="Admin" >
            <r:RibbonMenuButton/>
        </r:RibbonTab>
    </r:Ribbon>
</r:RibbonWindow>

System.Windows.Data Error: 39 : BindingExpression path error: 'IsChecked' property not found on 'object' ''RibbonMenuButton' (Name='')'. BindingExpression:Path=IsChecked; DataItem='RibbonMenuButton' (Name=''); target element is 'RibbonToggleButton' (Name='PART_ToggleButton'); target property is 'NoTarget' (type 'Object')

I am a bit confused by the last part of the error: target element is RibbonToggleButton (Name='PART_ToggleButton'); target property is 'NoTarget' (type 'Object'). There is no RibbonToggleButton in my XAML code at all?

Did someone else see such a behavior and is able to point me into the right direction to get rid of this error output?

Etan answered 5/5, 2012 at 13:9 Comment(0)
B
7

I see that error in the VS output for any ribbontogglebutton. I have attempted to resolve it, but with no luck. Unfortunately, the only fix I have come up with is that it's one of those errors you can ignore.

Bailey answered 5/5, 2012 at 13:35 Comment(5)
It should only appear in the VS Console unless you set up a logger for it.Bailey
Is this still not fixed after 8 years?Unusual
I have no idea, but it appears to still be a popular question.Bailey
I just reported it here: developercommunity.visualstudio.com/content/problem/665487/…Lactalbumin
Which was moved to github.com/dotnet/wpf/issues/1473Lactalbumin
U
1

Looking at the RibbonMenuButton class documentation on MSDN I see that it uses PART_ToggleButton as a TemplatePart attribute. This article describes how TemplateParts work. Since it's baked into the control it's probably expected behavior.

Update:

Looks like the WPF team has been notified of the problem in the comments here. Perhaps it will be fixed in the next release.

Uplift answered 5/5, 2012 at 14:28 Comment(1)
That article titled "WPF Ribbon October 2010 Update Details" has no comments anymore...Lactalbumin

© 2022 - 2024 — McMap. All rights reserved.