Ejemplo n.º 1
0
        private static void OnDirectionChanged(FrameButton instance, FlexDirection direction)
        {
            switch (direction)
            {
            case FlexDirection.Row:
                AlignContent(instance, new Thickness(0, 0, 10, 0), LayoutOptions.StartAndExpand, TextAlignment.Start);
                break;

            case FlexDirection.RowReverse:
                AlignContent(instance, new Thickness(10, 0, 0, 0), LayoutOptions.StartAndExpand, TextAlignment.Start);
                break;

            case FlexDirection.Column:
                AlignContent(instance, new Thickness(0, 0, 0, 10), LayoutOptions.CenterAndExpand, TextAlignment.Center);
                break;

            case FlexDirection.ColumnReverse:
                AlignContent(instance, new Thickness(0, 10, 0, 0), LayoutOptions.CenterAndExpand, TextAlignment.Center);
                break;
            }
        }
Ejemplo n.º 2
0
 private static void AlignContent(FrameButton instance, Thickness margin, LayoutOptions layout, TextAlignment text)
 {
     instance.ButtonImage.Margin                 = margin;
     instance.ButtonText.HorizontalOptions       = layout;
     instance.ButtonText.HorizontalTextAlignment = text;
 }