Beispiel #1
0
        /// <inheritdoc />
        public override void UpdateConstraints()
        {
            RemoveConstraints(Constraints);

            this.AddConstraints(
                CloseButton.AtLeftOf(this, 8),
                CloseButton.AtTopOf(this, 8),
                CloseButton.Width().EqualTo(40),
                CloseButton.Height().EqualTo(40),

                DeleteButton.ToRightOf(CloseButton, 8),
                DeleteButton.AtTopOf(this, 8),
                DeleteButton.Height().EqualTo(40),
                DeleteButtonHidden
                    ? DeleteButton.Width().EqualTo(0)
                    : DeleteButton.Width().EqualTo(40),

                MenuTitle.WithSameCenterY(this).Plus(2),
                MenuTitle.WithSameCenterX(this),
                MenuTitle.Height().EqualTo(21),

                DoneButton.AtTopOf(this, 8),
                DoneButton.Height().EqualTo(40),
                DoneButton.AtRightOf(this, 8),
                DoneButtonHidden
                    ? DoneButton.Width().EqualTo(0)
                    : DoneButton.Width().EqualTo(40),

                ExtraButton.ToRightOf(MenuTitle, 8),
                ExtraButton.Height().EqualTo(40),
                ExtraButton.ToLeftOf(DoneButton, 8),
                ExtraButton.AtTopOf(this, 8),
                ExtraButtonHidden
                    ? ExtraButton.Width().EqualTo(0)
                    : ExtraButton.Width().EqualTo(40)
                );

            base.UpdateConstraints();
        }