Exemple #1
0
        public DropDownStyle(DropDownStyle style) : base(style)
        {
            if (null == style)
            {
                return;
            }

            this.CopyFrom(style);
        }
        /// <summary>
        /// Return default DropDown style
        /// </summary>
        internal protected override ViewStyle GetViewStyle()
        {
            DropDownStyle style = new DropDownStyle
            {
                Position = new Position(50, 50),
                // WidthResizePolicy = ResizePolicyType.FitToChildren,
                // HeightResizePolicy = ResizePolicyType.FitToChildren,
                // HeaderText = new TextLabelStyle
                // {
                //     Text = new Selector<string> { All = "TitleArea" },
                //     PointSize = new Selector<float?> { All = 28 },
                //     TextColor = new Selector<Color> { All = new Color(0, 0, 0, 1) },
                //     FontFamily = "SamsungOneUI 500C",
                // },
                // BackgroundColor = new Selector<Color> { All = new Color(1, 1, 1, 1) },

                Button = new ButtonStyle
                {
                    ParentOrigin    = ParentOrigin.TopLeft,
                    PivotPoint      = PivotPoint.TopLeft,
                    BackgroundImage = new Selector <string>
                    {
                        Normal  = DefaultStyle.GetResourcePath("nui_component_default_checkbox_bg_n.png"),
                        Pressed = DefaultStyle.GetResourcePath("nui_component_default_checkbox_bg_p.png")
                    },
                    BackgroundImageBorder = (Rectangle)6,
                    Text = new TextLabelStyle
                    {
                        Text      = "Select an item",
                        PointSize = DefaultStyle.PointSizeNormal,
                        TextColor = Color.Black,
                    },
                    Icon = new ImageViewStyle
                    {
                        Size        = new Size(28, 28),
                        ResourceUrl = DefaultStyle.GetResourcePath("nui_component_default_dropdown_button_icon.png"),
                    },
                    IconRelativeOrientation = Button.IconOrientation.Right,
                    IconPadding             = 6,
                },
                ListBackgroundImage = new ImageViewStyle
                {
                    ResourceUrl = DefaultStyle.GetResourcePath("nui_component_default_dropdown_list_bg.png"),
                    Border      = (Rectangle)6,
                    Size        = new Size(280, 360),
                },
                SpaceBetweenButtonTextAndIcon = 10,
                ListPadding = 5,
            };

            return(style);
        }
Exemple #3
0
 public DropDownStyle(DropDownStyle style) : base(style)
 {
 }
Exemple #4
0
 public DropDown(DropDownStyle dropDownStyle) : base(dropDownStyle)
 {
     AccessibilityManager.Instance.SetAccessibilityAttribute(this, AccessibilityManager.AccessibilityAttribute.Trait, "DropDown");
 }
Exemple #5
0
 public DropDown(DropDownStyle dropDownStyle) : base(dropDownStyle)
 {
 }