Ejemplo n.º 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);
            });
        }
Ejemplo n.º 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;
        }