private View CreateSelector()
        {
            var height = MainPage.PageHeight * 0.3240;

            var selector = new AppEnumSelector
            {
                HorizontalOptions = LayoutOptions.Fill,
                VerticalOptions   = LayoutOptions.Fill
            };

            selector.SetBinding(AppEnumSelector.ItemsProperty, new Binding(ItemsProperty.PropertyName, BindingMode.OneWay, null, null, null, this));
            selector.SetBinding(AppEnumSelector.SelectedItemProperty, new Binding(SelectedItemProperty.PropertyName, BindingMode.TwoWay, null, null, null, this));

            var content = new Grid
            {
                HorizontalOptions = LayoutOptions.Fill,
                VerticalOptions   = LayoutOptions.Start,
                HeightRequest     = height,
                ColumnSpacing     = 0,
                RowSpacing        = 0
            };

            content.Children.Add(selector);

            return(content);
        }
Example #2
0
        private View CreateYearSelector()
        {
            var selector = new AppEnumSelector
            {
                HorizontalOptions = LayoutOptions.Fill,
                VerticalOptions   = LayoutOptions.Fill,
                TextAlignment     = TextAlignment.End
            };

            selector.SetBinding(AppEnumSelector.ItemsProperty, new Binding(YearsProperty.PropertyName, BindingMode.OneWay, null, null, null, this));
            selector.SetBinding(AppEnumSelector.SelectedItemProperty, new Binding(SelectedYearProperty.PropertyName, BindingMode.TwoWay, null, null, null, this));

            return(selector);
        }