Exemple #1
0
        public RadioButton(View parent, View layoutParent = null, string id = null, Template template = null, bool deferInitialization = false) :
            base(parent, layoutParent, id, template ?? RadioButtonTemplates.Default, deferInitialization)
        {
            if (deferInitialization)
            {
                return;
            }

            // constructing Group (RadioButtonGroup)
            RadioButtonGroup = new Group(this, this, "RadioButtonGroup", RadioButtonGroupTemplate);

            // binding <Group Spacing="{Spacing}">
            Bindings.Add(new Binding(new List <BindingPath> {
                new BindingPath(new List <string> {
                    "Spacing"
                }, new List <Func <BindableObject> > {
                    () => this
                })
            }, new BindingPath(new List <string> {
                "RadioButtonGroup", "Spacing"
            }, new List <Func <BindableObject> > {
                () => this, () => RadioButtonGroup
            }), () => RadioButtonGroup.Spacing = Spacing, () => { }, false));
            RadioButtonImageView = new Image(this, RadioButtonGroup.Content, "RadioButtonImageView", RadioButtonImageViewTemplate);
            RadioButtonLabel     = new Label(this, RadioButtonGroup.Content, "RadioButtonLabel", RadioButtonLabelTemplate);
            Click.RegisterHandler(this, "RadioButtonClick");
            this.AfterInitializeInternal();
        }
Exemple #2
0
        public Button(View parent, View layoutParent = null, string id = null, Template template = null, Action <View> initializer = null) :
            base(parent, layoutParent, id, template ?? ButtonTemplates.Default, initializer)
        {
            // constructing Label (Label)
            Label = new Label(this, this, "Label", LabelTemplate);

            // binding <Label Offset="{TextOffset}">
            Bindings.Add(new Binding(new List <BindingPath> {
                new BindingPath(new List <string> {
                    "TextOffset"
                }, new List <Func <BindableObject> > {
                    () => this
                })
            }, new BindingPath(new List <string> {
                "Label", "Offset"
            }, new List <Func <BindableObject> > {
                () => this, () => Label
            }), () => Label.Offset = TextOffset, () => { }, false));
            Click.RegisterHandler(this, "ButtonMouseClick");
            MouseEnter.RegisterHandler(this, "ButtonMouseEnter");
            MouseExit.RegisterHandler(this, "ButtonMouseExit");
            MouseDown.RegisterHandler(this, "ButtonMouseDown");
            MouseUp.RegisterHandler(this, "ButtonMouseUp");
            this.AfterInitializeInternal();
        }
Exemple #3
0
 public ListItem(View parent, View layoutParent = null, string id = null, Template template = null, Action <View> initializer = null) :
     base(parent, layoutParent, id, template ?? ListItemTemplates.Default, initializer)
 {
     Click.RegisterHandler(this, "ListItemMouseClick");
     MouseEnter.RegisterHandler(this, "ListItemMouseEnter");
     MouseExit.RegisterHandler(this, "ListItemMouseExit");
     MouseDown.RegisterHandler(this, "ListItemMouseDown");
     MouseUp.RegisterHandler(this, "ListItemMouseUp");
     this.AfterInitializeInternal();
 }
Exemple #4
0
        public Button(View parent, View layoutParent = null, string id = null, Template template = null, bool deferInitialization = false) :
            base(parent, layoutParent, id, template ?? ButtonTemplates.Default, deferInitialization)
        {
            if (deferInitialization)
            {
                return;
            }

            // constructing Label (Label)
            Label = new Label(this, this, "Label", LabelTemplate);

            // binding <Label Offset="{TextOffset}">
            Bindings.Add(new Binding(new List <BindingPath> {
                new BindingPath(new List <string> {
                    "TextOffset"
                }, new List <Func <object> > {
                    () => this
                })
            }, new BindingPath(new List <string> {
                "Label", "Offset"
            }, new List <Func <object> > {
                () => this, () => Label
            }), () => Label.Offset = TextOffset, () => { }, false));

            // binding <Label IsActive="{DisplayLabel}">
            Bindings.Add(new Binding(new List <BindingPath> {
                new BindingPath(new List <string> {
                    "DisplayLabel"
                }, new List <Func <object> > {
                    () => this
                })
            }, new BindingPath(new List <string> {
                "Label", "IsActive"
            }, new List <Func <object> > {
                () => this, () => Label
            }), () => Label.IsActive = DisplayLabel, () => { }, false));
            this.StateAnimations.Clear();
            var stateAnimation0 = new StateAnimation(AnyStateName, "Highlighted");

            stateAnimation0.Add(new Animator <UnityEngine.Color>(this, 0.05f, 0f, false, false, 0f, false, EasingFunctions.Get("Linear"), Delight.ColorValueConverter.Interpolator, x => this.BackgroundColor = x, () => this.BackgroundColor, () => Button.BackgroundColorProperty.NotifyPropertyChanged(this), Button.BackgroundColorProperty, AnyStateName, "Highlighted"));
            stateAnimation0.Add(new Animator <UnityEngine.Color>(this, 0.05f, 0f, false, false, 0f, false, EasingFunctions.Get("Linear"), Delight.ColorValueConverter.Interpolator, x => this.FontColor       = x, () => this.FontColor, () => Button.FontColorProperty.NotifyPropertyChanged(this), Button.FontColorProperty, AnyStateName, "Highlighted"));
            this.StateAnimations.Add(stateAnimation0);
            var stateAnimation1 = new StateAnimation("Highlighted", DefaultStateName);

            stateAnimation1.Add(new Animator <UnityEngine.Color>(this, 0.5f, 0f, false, false, 0f, false, EasingFunctions.Get("Linear"), Delight.ColorValueConverter.Interpolator, x => this.BackgroundColor = x, () => this.BackgroundColor, () => Button.BackgroundColorProperty.NotifyPropertyChanged(this), Button.BackgroundColorProperty, "Highlighted", DefaultStateName));
            stateAnimation1.Add(new Animator <UnityEngine.Color>(this, 0.5f, 0f, false, false, 0f, false, EasingFunctions.Get("Linear"), Delight.ColorValueConverter.Interpolator, x => this.FontColor       = x, () => this.FontColor, () => Button.FontColorProperty.NotifyPropertyChanged(this), Button.FontColorProperty, "Highlighted", DefaultStateName));
            this.StateAnimations.Add(stateAnimation1);
            Click.RegisterHandler(this, "ButtonMouseClick");
            MouseEnter.RegisterHandler(this, "ButtonMouseEnter");
            MouseExit.RegisterHandler(this, "ButtonMouseExit");
            MouseDown.RegisterHandler(this, "ButtonMouseDown");
            MouseUp.RegisterHandler(this, "ButtonMouseUp");
            this.AfterInitializeInternal();
        }
Exemple #5
0
        public NavigationButton(View parent, View layoutParent = null, string id = null, Template template = null, bool deferInitialization = false) :
            base(parent, layoutParent, id, template ?? NavigationButtonTemplates.Default, deferInitialization)
        {
            if (deferInitialization)
            {
                return;
            }

            Click.RegisterHandler(this, "NavigationButtonClick");
            this.AfterInitializeInternal();
        }
        public ExpanderHeader(View parent, View layoutParent = null, string id = null, Template template = null, bool deferInitialization = false) :
            base(parent, layoutParent, id, template ?? ExpanderHeaderTemplates.Default, deferInitialization)
        {
            if (deferInitialization)
            {
                return;
            }

            Click.RegisterHandler(this, "ExpanderHeaderClick");
            SetExpanderState = new AttachedProperty <System.Boolean>(this, "SetExpanderState");
            this.AfterInitializeInternal();
        }
Exemple #7
0
        public ListItem(View parent, View layoutParent = null, string id = null, Template template = null, bool deferInitialization = false) :
            base(parent, layoutParent, id, template ?? ListItemTemplates.Default, deferInitialization)
        {
            if (deferInitialization)
            {
                return;
            }

            Click.RegisterHandler(this, "ListItemMouseClick");
            MouseEnter.RegisterHandler(this, "ListItemMouseEnter");
            MouseExit.RegisterHandler(this, "ListItemMouseExit");
            MouseDown.RegisterHandler(this, "ListItemMouseDown");
            MouseUp.RegisterHandler(this, "ListItemMouseUp");
            SetListItemState = new AttachedProperty <System.Boolean>(this, "SetListItemState");
            this.AfterInitializeInternal();
        }
        public CheckBox(View parent, View layoutParent = null, string id = null, Template template = null, Action <View> initializer = null) :
            base(parent, layoutParent, id, template ?? CheckBoxTemplates.Default, initializer)
        {
            // constructing Group (CheckBoxGroup)
            CheckBoxGroup = new Group(this, this, "CheckBoxGroup", CheckBoxGroupTemplate);

            // binding <Group Spacing="{Spacing}">
            Bindings.Add(new Binding(new List <BindingPath> {
                new BindingPath(new List <string> {
                    "Spacing"
                }, new List <Func <BindableObject> > {
                    () => this
                })
            }, new BindingPath(new List <string> {
                "CheckBoxGroup", "Spacing"
            }, new List <Func <BindableObject> > {
                () => this, () => CheckBoxGroup
            }), () => CheckBoxGroup.Spacing = Spacing, () => { }, false));
            CheckBoxImageView = new Image(this, CheckBoxGroup.Content, "CheckBoxImageView", CheckBoxImageViewTemplate);
            CheckBoxLabel     = new Label(this, CheckBoxGroup.Content, "CheckBoxLabel", CheckBoxLabelTemplate);
            Click.RegisterHandler(this, "CheckBoxClick");
            this.AfterInitializeInternal();
        }