I am trying to persist QAT items. I've been running into two issues (so far):
1. When using the following markup:
<r:XamRibbon.QuickAccessToolbar> <r:QuickAccessToolbar> <r:QuickAccessToolbar.ItemTemplate> <DataTemplate> <r:QatPlaceholderTool TargetId="{Binding}" /> </DataTemplate> </r:QuickAccessToolbar.ItemTemplate> </r:QuickAccessToolbar> </r:XamRibbon.QuickAccessToolbar>
and code:
ribbon.QuickAccessToolbar.ItemsSource = settings.QuickAccessItems;
I'm getting UnsupportedOperationException with the message:
Item of type 'System.String' cannot be added directly to the QuickAccessToolbar. [...]
2. When attempting to restore a group, I'm getting UnsupportedOperationException with the message:
An item with the specified TargetId 'GroupId' being added to the QuickAccessToolbar is not registered with the associated XamRibbon.
Is it me or is it XamRibbon? Is QAT persistence a planned feature? If it is, when will it be available?
Hello,
Thank you for your post. I have been looking into it and since this is not a known issue I cannot be completely sure what can cause such behavior, so could you please send an isolated sample project, where the issue is reproduced, so I can investigate it further for you.
Looking forward for your reply.
Instead of using QuickAccessToolbarItems as ObservableCollection<FrameworkElement>
Can we use some ObservableCollection<XXX> where XXX is my class.. (object)
<Style TargetType="{x:Type igRibbon:QuickAccessToolbar}"> <Setter Property="ItemTemplate" Value="{StaticResource Local_DefaultQuickAccessToolbarTemplate}" /> <Setter Property="ItemsSource" Value="{Binding Items}"/> <Setter Property="Visibility" Value="{Binding IsVisible, Converter={StaticResource BooleanToVisibilityConverter}}" /> </Style>
<DataTemplate x:Key="Local_DefaultQuickAccessToolbarTemplate" > <!--<igRibbon:ToolHorizontalWrapPanel>--> <igRibbon:QatPlaceholderTool igRibbon:RibbonGroup.MaximumSize="ImageAndTextLarge" TargetId="{Binding Name}" TargetType="Tool" /> <!--</igRibbon:ToolHorizontalWrapPanel>--> </DataTemplate>IF we do that can we achieve something? it was giving me error, you can not add into QAT.
I just sent an email to Infragistics asking to add me as contributor to the CodePlex project. I'll check in the updated sources as soon as they do.
Dmitry
can u post your refreshed version of ncal, perhaps on SkyDrive or anywhere else?
Wow, it's been almost a full year!
I have since abandoned binding in favor of Prism. I brought NCAL up to date with Prism 2.x and added region adapters for XamRibbon parts, including QAT. All QatPlaceholderTools and SeparatorTools are now mirrored by views, and an elaborate method for determining the target type by id is used.