Hi,
How to check if centertool of radial menu is expanded or collapsed on click of it? Also how to check it for child tools?
Regards,
Prasad
This is working :-)
Thank You Dimitar.
Hi Prasad,
Thank you for the reply.
The method wasn’t relying on the Visible property but whether the UIElement is created. However it seems that the timing in the CenterButtonClick event is a little bit off, so this approach is not good. Still the Expanded property should do the trick for the CenterButton. If the Exanded property is true in the CenterButtonClick than the menu is about to be collapsed so you can hide it.
I have attached a modified version of your sample.
Please let me know if you have any additional questions.
I am trying to hide the radial menu when it is collapsed (no child tools displayed for center tool), but I am not able to do so. It is returning true all the time.
Attached sample project.
Thanks
I am trying to call this logic inside RadialMenu_CenterTooClick handler by passing "RadialMenu.CenterTool" as parameter. In any of the cases it is returning true whether radial menu is expanded or collapsed. It is not giving the correct state.
I think tool.Visible property might not be a right candidate here.
Thank you for posting in our forums.
What you could do in your case is to check if the child tools of the tool have an UIElement. This would mean that the child tools are visible. You can use the following method for this:
private bool AreChildToolsDisplayed(RadialMenuTool tool)
{
if (tool.Tools.Count == 0)
return false;
var visibleTools = tool.Tools.Where(t => t.Visible == true).ToList();
if (visibleTools.Count == 0)
var element = visibleTools[0].GetUIElement();
return element != null;
}