Hello,
I want to replace image in MenuTool with Viewbox containing Canvas nad Paths also those paths have property bound to parent MenuTool so I can control e.g Stroke Color. I mostly achived that but got problems with binding. I think its coused by DependancyProperty which is holding vector and its outside visual/logical tree.
Strange thing is that on first ribbon tab this solution works but on any other ribbon tab it doesnt.
I attach sample.
Thanks
I have created case for you with ID CAS-174212-Y7G8G8 to privately discuss this further. You could reach your case following the link bellow:
https://ko.infragistics.com/my-account/support-activity I will update you via the mentioned case, so if you have any further questions or comments please update your case.
After further research this behavior is to be expected. A workaround is provided. (See below)
The MyContent property shown in the sample will be set for all the elements when the window is shown, but only the elements in the first tab are actually in the visual tree. Therefore, the FindAncestor binding within the Ellipse element being set for MyContent has no ancestor MenuTool for the tools not on the first tab and so the WPF framework initializes the status of that BindingExpression to "PathError".
The better thing would probably be to define a DataTemplate property and define the Ellipse within the DataTemplate. The elements of the DataTemplate will only be hydrated by the ContentPresenter (in this case they would set the ContentTemplate on the ContentPresenter within the MenuButtonArea instead of the Content) so it'll happen when the associate menu tool is within the visual tree.
I've attached a modified version of the sample to this issue.