コード例 #1
0
        public static LayoutAlignment GetVerticalLayoutAlignment(this View view, ContainerView container, LayoutAlignment defaultSizing = LayoutAlignment.Start)
        {
            var sizing = view.GetEnvironment <LayoutAlignment?>(view, EnvironmentKeys.Layout.VerticalLayoutAlignment);

            if (sizing != null)
            {
                return((LayoutAlignment)sizing);
            }

            if (container != null)
            {
                sizing = view.GetEnvironment <LayoutAlignment?>(view, $"{container.GetType().Name}.{EnvironmentKeys.Layout.VerticalLayoutAlignment}");
            }
            return(sizing ?? defaultSizing);
        }
コード例 #2
0
        public static Sizing GetVerticalSizing(this View view, ContainerView container, Sizing defaultSizing = Sizing.Fit)
        {
            var sizing = view.GetEnvironment <Sizing?>(view, EnvironmentKeys.Layout.VerticalSizing);

            if (sizing != null)
            {
                return((Sizing)sizing);
            }

            if (container != null)
            {
                sizing = view.GetEnvironment <Sizing?>(view, $"{container.GetType().Name}.{EnvironmentKeys.Layout.VerticalSizing}");
            }
            return(sizing ?? defaultSizing);
        }