예제 #1
0
        public static IReflectedPrimitive <Xamarin.Forms.Slider> Slider(int?min = default, int?max = default)
        {
            if (Components.Primitives.NeverInclude)
            {
                var _ = new Xamarin.Forms.Slider();
            }

            var control = new XamFormsVisualElement <Xamarin.Forms.Slider>();

            if (min.HasValue && max.HasValue)
            {
                control.MinMax(min.Value, max.Value);
            }

            return(control);
        }
예제 #2
0
            protected override void Update(XamFormsContext context, IShadow <TControl> shadow, XamFormsVisualElement <TControl> current, XamFormsVisualElement <TControl> next)
            {
                base.Update(context, shadow, current, next);

                shadow.UpdateContent <Xamarin.Forms.View>(context, current?.Attributes.GetAttributeOrDefault(ViewExtensions.ContentAttribute), next?.Attributes.GetAttributeOrDefault(ViewExtensions.ContentAttribute),
                                                          (s) =>
                {
                    shadow.Item.Content = s.Item;
                }, (s) =>
                {
                    shadow.Item.Content = null;
                });
            }
예제 #3
0
            protected override TControl CreateItem(XamFormsContext context, XamFormsVisualElement <TControl> element)
            {
                var view = (TControl)Activator.CreateInstance(typeof(TControl));

                return(view);
            }