Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
755
Add items programatically
posted

Hi,

I have a problem adding items programatically.

Only appears one, the first, and I don't know why:

                    XamWebMenu menu = new XamWebMenu()
                    {
                        MenuOrientation = Orientation.Vertical,
                        VerticalAlignment = VerticalAlignment.Top,
                        HorizontalAlignment = HorizontalAlignment.Stretch,
                        HorizontalContentAlignment = HorizontalAlignment.Left,
                        ExpandOnHover = true,
                        Foreground = Brushes.Black,
                        Background = (Brush)Application.Current.Resources[ "MenuBackGround" ]
                    };

                    Image simpleImage = new Image();
                    BitmapImage bimg = new BitmapImage();
                    bimg.UriSource = new Uri( "../Images/Icons/DocumentHS.png", UriKind.RelativeOrAbsolute );
                    simpleImage.Source = bimg;
                    simpleImage.Stretch = Stretch.None;

                    menu.Items.Add( new XamWebMenuItem()
                    {
                        MenuOrientation = Orientation.Vertical,
                        Header = "Add",
                        Name = "Add",
                        HorizontalAlignment = HorizontalAlignment.Left,
                        Icon = simpleImage
                    } );

                    simpleImage = new Image();
                    bimg = new BitmapImage();
                    bimg.UriSource = new Uri( "../Images/Icons/gears_run.png", UriKind.RelativeOrAbsolute );
                    simpleImage.Source = bimg;
                    simpleImage.Stretch = Stretch.None;

                    menu.Items.Add( new XamWebMenuItem()
                    {
                        MenuOrientation = Orientation.Vertical,
                        Header = "Actions",
                        Name = "Actions",
                        HorizontalAlignment = HorizontalAlignment.Left,
                        Icon = simpleImage
                    } );

 

Am I missing any option?

Cheers.

Parents
No Data
Reply
  • 7922
    posted

    I don’t see anything wrong, but you set  MenuOrientation = Orientation.Vertical. Please see the Height of the container where the menu resides. If the Height is set to fixed value, and the menu’s height is bigger than the height of the container that is why you can’t see the rest of items.

Children
No Data