We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

RibbonBarCollapseImage RibbonBar.CollapseImage ImageSource Cannot find source: RelativeSource FindAncestor, AncestorType='Syncfusion.Windows.Tools.Con

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;

}

}


4 Replies

HN Harinath Navaneethakrishnan Syncfusion Team December 22, 2022 02:54 PM UTC

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:

https://www.syncfusion.com/feedback/39987/binding-error-occurs-when-setting-sfskinmanager-applystylesonapplication-property


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



GT Gokul Thanudhas Syncfusion Team January 18, 2023 01:17 PM UTC

We have fixed the reported issue but due to some internal issues, we are not able to include this fix in the recently released NuGet v20.4.0.44. We will include the fix in the next NuGet release which is scheduled for 24th January 2023. We appreciate your patience until then.


BA BagavathiPerumal Apranandham Syncfusion Team January 24, 2023 02:36 PM UTC

Sorry for the inconvenience,

We have fixed the reported issue. We don’t have a weekly release for this week. We will include this fix in our upcoming 2022 Volume 4 SP Release. We will appreciate your patience until then.


GT Gokul Thanudhas Syncfusion Team February 2, 2023 05:15 PM UTC

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.


https://www.syncfusion.com/forums/180292/essential-studio-2022-volume-4-service-pack-release-v20-4-0-48-is-available-for-download


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



Loader.
Live Chat Icon For mobile
Up arrow icon