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?
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With