Hi,
I'm trying to use the TextSearch class in the MenuTool, but I can't make it work.
My current implementation:
<igRibbon:MenuTool ButtonType="DropDown" ItemsSource="{Binding Path=Container.Items}" IsTextSearchEnabled="True" TextSearch.TextPath="DisplayName">
...
DisplayName is a string property of my objects that are in the Container.Items collection.
What I'm trying to achive, is to make the ToolMenu jump to the next best item (bring it into view) that starts with the typed in string.
Is this possible? Does anybody have any working example for me?
Regards,
Darius
Hi Darius,
The MenuTool is an ItemsControl which is how it gets the IsTextSearchEnabled property, but inside the MenuTool there is a MenuToolPresenter which is another ItemsControl and this is what actually contains the menu items. The IsTextSearchEnabled property on MenuTool is not propagated down to MenuToolPresenter so you'll have to add a style with a setter for it.
<Style TargetType="{x:Type igRibbon:MenuToolPresenter}"> <Setter Property="IsTextSearchEnabled" Value="True"/> <Setter Property="TextSearch.TextPath" Value="DisplayName"/></Style>
Thank you. Works as expected.
I just want to mention that I have logged a development issue (209616) for this as I think those text search options should only need to be set on the MenuTool itself. You shouldn't need to create a style to enable them. All we should need to do for this is bind the MenuToolPresenter text search properties to the MenuTool ones. Until we resolve this in the final product I recommend that you keep using my workaround.
I created a private support case for you so that I can link the development issue to it. This way you will be automatically notified when a fix has been released. The case number is CAS-166670-K2W4H7 and you can view it here.