Ejemplo n.º 1
0
        /// <summary>
        /// Sets default values of the view.
        /// </summary>
        public override void SetDefaultValues()
        {
            base.SetDefaultValues();
            Breadth.DirectValue     = new ElementSize(40);
            Length.DirectValue      = new ElementSize(120);
            TextPadding.DirectValue = new ElementMargin();

            // list item label
            if (ItemLabel != null)
            {
                ItemLabel.TextAlignment.DirectValue = ElementAlignment.Center;
                ItemLabel.Width.DirectValue         = ElementSize.FromPercents(1);
                ItemLabel.Height.DirectValue        = ElementSize.FromPercents(1);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Sets default values of the view.
        /// </summary>
        public override void SetDefaultValues()
        {
            base.SetDefaultValues();

            Length.DirectValue                          = new ElementSize(160);
            Breadth.DirectValue                         = new ElementSize(40);
            Orientation.DirectValue                     = ElementOrientation.Horizontal;
            Min.DirectValue                             = 0;
            Max.DirectValue                             = 100;
            CanSlide.DirectValue                        = true;
            SetValueOnDragEnded.DirectValue             = false;
            SliderFillImageView.Alignment.DirectValue   = ElementAlignment.Left;
            SliderHandleImageView.Alignment.DirectValue = ElementAlignment.Left;
            SliderHandleImageView.Width.DirectValue     = new ElementSize(20);
            SliderHandleImageView.Height.DirectValue    = ElementSize.FromPercents(1);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Sets default values of the view.
        /// </summary>
        public override void SetDefaultValues()
        {
            base.SetDefaultValues();

            Width.DirectValue  = new ElementSize(200);
            Height.DirectValue = new ElementSize(40);

            // input text
            InputText.Margin.DirectValue        = new ElementMargin(9);
            InputText.TextAlignment.DirectValue = ElementAlignment.TopLeft;
            InputText.Width.DirectValue         = ElementSize.FromPercents(1);
            InputText.Height.DirectValue        = ElementSize.FromPercents(1);

            // inputfield component
            InputFieldComponent.textComponent = InputText.TextComponent;
            InputFieldComponent.placeholder   = InputFieldPlaceholder.ImageComponent;
            InputFieldComponent.transition    = Selectable.Transition.None;
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Called when the layout of the view has been changed.
        /// </summary>
        public override void LayoutChanged()
        {
            // adjust width and height to ParentList
            if (ParentList == null || ParentList.Orientation == ElementOrientation.Horizontal)
            {
                Width.DirectValue = Width.IsSet && Width.Value.Unit != ElementSizeUnit.Percents ? Width.Value : new ElementSize(Length.Value);

                if (!Height.IsSet)
                {
                    Height.DirectValue = Breadth.IsSet ? new ElementSize(Breadth.Value) : ElementSize.FromPercents(1);
                }
            }
            else
            {
                // if neither width nor length is set, use 100% width
                if (!Width.IsSet)
                {
                    Width.DirectValue = Length.IsSet ? new ElementSize(Length.Value) : ElementSize.FromPercents(1);
                }

                Height.DirectValue = Height.IsSet && Height.Value.Unit != ElementSizeUnit.Percents ? Height.Value : new ElementSize(Breadth.Value);
            }

            base.LayoutChanged();
        }