Exemplo n.º 1
0
        protected override void Compose()
        {
            Style = ToolbarUtils.ToolbarItemStyle(this);

            ButtonPanel.Children.Add(ButtonImage);
            ButtonPanel.Children.Add(DropDownImage);

            this.Content = ButtonPanel;
        }
Exemplo n.º 2
0
        public void InsertItem(int index, IToolbarItemBackend item)
        {
            var value = item.ToWpf();

            if (value != null)
            {
                value.Style = ToolbarUtils.ToolbarItemStyle(value);
                Control.Items.Insert(index, value);
            }
        }
Exemplo n.º 3
0
        protected virtual void ComposeStyle()
        {
            var style = new Style();

            // set opacity to 50% if not enabled:
            var trigger = new DataTrigger {
                Value   = false,
                Binding = WpfExtensions.Binding(this, o => o.IsEnabled, BindingMode.OneWay),
            };

            var setter = new Setter {
                Property = UIElement.OpacityProperty,
                Value    = 0.5,
            };

            trigger.Setters.Add(setter);
            style.Triggers.Add(trigger);

            var baseStyle = ToolbarUtils.ToolbarItemStyle(this);

            style.TargetType = baseStyle.TargetType;
            style.BasedOn    = baseStyle;
            this.Style       = style;
        }
Exemplo n.º 4
0
        public void SetChild(Vidget value)
        {
            Control.Children.Clear();
            var child = value.Backend.ToWpf();

            Control.Children.Add(child);
            child.HorizontalAlignment = HorizontalAlignment.Stretch;
            child.VerticalAlignment   = VerticalAlignment.Stretch;
            child.Style = ToolbarUtils.ToolbarItemStyle(child);
            var xwtBackend = value.Backend as Limaki.View.XwtBackend.IXwtBackend;

            if (xwtBackend != null)
            {
                if (xwtBackend.Widget.WidthRequest >= 0)
                {
                    Control.Width = xwtBackend.Widget.WidthRequest;
                }
                if (xwtBackend.Widget.HeightRequest >= 0)
                {
                    Control.Height = xwtBackend.Widget.HeightRequest;
                }
            }
            Control.UpdateLayout();
        }
Exemplo n.º 5
0
 public override void Compose()
 {
     base.Compose();
     this.Control.Style = ToolbarUtils.ToolbarItemStyle(this.Control);
 }