Hi, I would like to separately handle clicking on an image and clicking on text in the items in an UltraExplorerBarGroup. I'm sure this is possible with the UI Elements, but I'm not sure what elements to check if the mouse is over in the click event. Anybody know?
Thanks,
~Karen
/// <summary>/// Handles the UltraExplorerBar's MouseDown event./// </summary>private void explorerBar_MouseDown(object sender, MouseEventArgs e){ UltraExplorerBar explorerBar = sender as UltraExplorerBar; UIElement controlElement = explorerBar.UIElement; UIElement elementAtPoint = controlElement != null ? controlElement.ElementFromPoint( e.Location ) : null; TextUIElement textElement = null; ImageUIElement imageElement = null;
while ( elementAtPoint != null ) { textElement = elementAtPoint as TextUIElement; imageElement = textElement != null ? null : elementAtPoint as ImageUIElement;
if ( textElement != null || imageElement != null ) break;
elementAtPoint = elementAtPoint.Parent; }
if ( textElement != null ) { // Text was clicked } else if ( imageElement != null ) { // Image was clicked }}