BoldDeskWe are launching BoldDesk on Product Hunt soon. Learn more & follow us.
Hello,
I am populating my Ribbon dynamically, Everything works well but I am getting a Binding warning/error
"Severity Count Data Context Binding Path Target Target Type Description File Line Project
Error 2 null RibbonBarCollapseImage RibbonBar.CollapseImage ImageSource Cannot find source: RelativeSource FindAncestor, AncestorType='Syncfusion.Windows.Tools.Controls.Ribbon', AncestorLevel='1'."
I am not sure why this should be happening and setting the RibbonBarCollapseImage or RibbonBar.CollapseImage or binding them does not solve it.
Please, could you direct me.
Below is the source:
<UserControl x:Class="XXXXXXXXXXXXXXXXXX"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:syncfusion="http://schemas.syncfusion.com/wpf"
xmlns:converters="XXXXXXXXXXXXXXXXXX"
xmlns:selectors="XXXXXXXXXXXXXXXXXXX"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<UserControl.Resources>
<ResourceDictionary>
<selectors:MySelector x:Key="RibbonItemSelector"/>
<DataTemplate x:Key="RibbonButtonTemplate">
<syncfusion:RibbonButton Label="{FROM MY VIEWMODEL}"/>
</DataTemplate>
</ResourceDictionary>
</UserControl.Resources>
<Grid>
<syncfusion:Ribbon x:Name="MyRibbon" BackStageHeader="{FROM MY VIEWMODEL}">
<syncfusion:Ribbon.ItemContainerStyle>
<Style TargetType="{x:Type syncfusion:RibbonTab}">
<Setter Property="Caption" Value="{FROM MY VIEWMODEL}"></Setter>
<Setter Property="ItemsSource" Value="{Binding MyRibbonBars}"/>
<Setter Property="ItemTemplateSelector" Value="{StaticResource RibbonItemSelector}"/>
<Setter Property="ItemContainerStyle">
<Setter.Value>
<Style>
<Setter Property="Header" Value="{FROM MY VIEWMODEL}
</Style>
</Setter.Value>
</Setter>
</Style>
</syncfusion:Ribbon.ItemContainerStyle>
</syncfusion:Ribbon>
</Grid>
</UserControl>
public class MySelector : DataTemplateSelector
{
public override DataTemplate SelectTemplate(object item, DependencyObject container)
{
if (container is not FrameworkElement element || item == null)
return null;
if (item is NavigationRibbonItem { IsSplitButton: true })
{
return element.FindResource("SplitButtonTemplate") as DataTemplate;
}
return element.FindResource("RibbonButtonTemplate") as DataTemplate;
}
}
Hi EN,
We have confirmed the reported scenario is a defect and logged a report for the reported scenario “Binding error occurs when setting SfSkinManager.ApplyStylesOnApplication property to true in Ribbon”. We will include the fix in our Weekly NuGet release which is scheduled on 17th January 2023.
You can track the status of this defect using
the following feedback link:
If you have any more specification replication
procedures or a scenario to be tested, you can add it as a comment in the
portal.
Please let us know if you need any further
assistance.
Note: The provided feedback link is private, and you need to log in to view this feedback.
Regards,
Harinath N
We are glad to announce that the fix for this issue is included in our Essential Studio 2022 Volume 4 Service Pack Release V20.4.0.48 and is available for download under the following link.
We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance