Exemple #1
0
        public CollectionViewTest3Page()
        {
            InitializeComponent();
            BindingContext = new TestSourceModel();
            var winSize  = NUIApplication.GetDefaultWindow().WindowSize;
            var itemSize = (winSize.Width / 2);

            ColView.ItemTemplate = new DataTemplate(() =>
            {
                var item = new RecyclerViewItem()
                {
                    WidthSpecification  = itemSize,
                    HeightSpecification = 200,
                };
                item.SetBinding(View.BackgroundColorProperty, "BgColor");
                var label = new TextLabel()
                {
                    ParentOrigin           = Tizen.NUI.ParentOrigin.Center,
                    PivotPoint             = Tizen.NUI.PivotPoint.Center,
                    PositionUsesPivotPoint = true,
                };
                label.PixelSize = 30;
                label.SetBinding(TextLabel.TextProperty, "Index");
                item.Add(label);

                return(item);
            });
        }
        public CollectionViewTest1()
        {
            InitializeComponent();
            BindingContext = new TestSourceModel();
            var RadioGroup = new RadioButtonGroup();

            RadioGroup.Add(ShowBar);
            RadioGroup.Add(HideBar);

            ColView.ItemTemplate = new DataTemplate(() =>
            {
                var item = new RecyclerViewItem()
                {
                    HeightSpecification = LayoutParamPolicies.MatchParent,
                    WidthSpecification  = 200,
                };
                item.SetBinding(View.BackgroundColorProperty, "BgColor");
                var label = new TextLabel()
                {
                    ParentOrigin           = Tizen.NUI.ParentOrigin.Center,
                    PivotPoint             = Tizen.NUI.PivotPoint.Center,
                    PositionUsesPivotPoint = true,
                };
                label.PixelSize = 30;
                label.SetBinding(TextLabel.TextProperty, "Index");
                item.Add(label);

                return(item);
            });
        }
Exemple #3
0
        public CollectionViewTest7()
        {
            InitializeComponent();
            BindingContext = new TestSourceModel(40);

            ColView.ItemTemplate = new DataTemplate(() =>
            {
                var item = new RecyclerViewItem()
                {
                    WidthSpecification  = LayoutParamPolicies.MatchParent,
                    HeightSpecification = 100,
                };
                item.SetBinding(View.BackgroundColorProperty, "BgColor");
                var label = new TextLabel()
                {
                    ParentOrigin           = Tizen.NUI.ParentOrigin.Center,
                    PivotPoint             = Tizen.NUI.PivotPoint.Center,
                    PositionUsesPivotPoint = true,
                };
                label.PixelSize = 30;
                label.SetBinding(TextLabel.TextProperty, "Index");
                item.Add(label);

                return(item);
            });
            // Currently ScrollableBase only support Scrolling and ScrollOutOfBound event.
            ColView.Scrolling += OnScrolling;
        }
Exemple #4
0
        public CollectionViewTest6Page()
        {
            InitializeComponent();

            var MyModel = new TestSourceModel(20);

            ColView.ItemsSource  = source = MyModel.TestSource;
            ColView.ItemTemplate = LinearTemplate;
        }
Exemple #5
0
        public CollectionViewCustomItemTestPage()
        {
            InitializeComponent();
            BindingContext = new TestSourceModel(50);

            ColView.ItemTemplate = new DataTemplate(() =>
            {
                return(new CollectionViewCustomItem());;
            });
        }
        public CollectionViewTest4Page()
        {
            InitializeComponent();
            BindingContext = new TestSourceModel();

            var RadioGroup = new RadioButtonGroup();

            RadioGroup.Add(Linear);
            RadioGroup.Add(Grid);

            ColView.ItemTemplate = LinearTemplate;
        }
Exemple #7
0
        public CollectionViewTest8Page()
        {
            InitializeComponent();
            BindingContext = new TestSourceModel(40);

            var customStyle = new RecyclerViewItemStyle()
            {
                BackgroundColor = new Selector <Color>()
                {
                    Normal   = Color.White,
                    Pressed  = Color.Red,
                    Selected = Color.Blue,
                    Disabled = Color.Grey,
                },
            };

            ColView.ItemTemplate = new DataTemplate(() =>
            {
                var item = new RecyclerViewItem(customStyle)
                {
                    WidthSpecification  = 100,
                    HeightSpecification = LayoutParamPolicies.MatchParent,
                };
                var label = new TextLabel()
                {
                    ParentOrigin           = Tizen.NUI.ParentOrigin.Center,
                    PivotPoint             = Tizen.NUI.PivotPoint.Center,
                    PositionUsesPivotPoint = true,
                };
                label.PixelSize = 30;
                label.SetBinding(TextLabel.TextProperty, "Index");
                item.Add(label);

                return(item);
            });
        }