0

I have A Toolbardropdown with menu list .

  • How can i hide the Arrow on top of the menu list when i want to hide the menu list conditionally .

Currently i am changing visibility property to false for the menu list using:

 Visibility.Collapsed

But i am still able to see the small triangle icon over top of the menu list .

Please refer the image

Nilay Vishwakarma
  • 3,105
  • 1
  • 27
  • 48
user3125908
  • 45
  • 1
  • 1
  • 6

1 Answers1

0

Helo,

You need to create your own ToolBarDropDown by overriding the original Template.

 

    public class MyDropDown : C1ToolbarDropDown
        {
            internal Polygon btn;
            internal Popup popup;

            public override void OnApplyTemplate()
            {
                base.OnApplyTemplate();

                btn = GetTemplateChild("ArrowPolygon") as Polygon;
                btn.Visibility = System.Windows.Visibility.Collapsed;
                popup = GetTemplateChild("DropDownPopup") as Popup;
                popup.Opened += popup_Opened;
                popup.Closed += popup_Closed;
            }

            void popup_Opened(object sender, EventArgs e)
            {
                btn.Visibility = System.Windows.Visibility.Visible;
            }

            void popup_Closed(object sender, EventArgs e)
            {
                btn.Visibility = System.Windows.Visibility.Collapsed;
            }
        }

and use the above MyDropDown as the ToolBarDropDown in your Xaml.

Regards, Reema

Reema
  • 41
  • 2