Example #1
0
        public DrawKinetic(List<GradientButton> Buttons)
        {
            this.Buttons = Buttons;
            Layout = new ButtonLayouter()
            {
                Parent = this
            };
            Layout.Init();
            Layout.Layout();
            System.Timers.Timer T = new System.Timers.Timer(10000);
            T.Elapsed += (o, e) =>
            {
                Xwt.Application.Invoke(() =>
                {
                    Layout.MakePrimary(Layout.Elements[new Random().Next(Layout.Elements.Count())]);
                });
            };
            //T.Start();

            int ColumnCount = (int)Math.Ceiling((double)Buttons.Count()/2);
            this.WidthRequest = 2 * LeftMargin + (ColumnCount+1) * ButtonSize + (ColumnCount) * Padding;
            this.HeightRequest = 2 * LeftMargin + 2 * ButtonSize + Padding;
        }
Example #2
0
        public CarouselCircle(List<GradientButton> Buttons)
        {
            this.Buttons = Buttons;
            Layout = new ButtonLayouter()
            {
                Parent = this
            };
            Layout.Init();
            Layout.Layout();
            System.Timers.Timer T = new System.Timers.Timer(10000);
            T.Elapsed += (o, e) =>
            {
                Xwt.Application.Invoke(() =>
                {
                    if (ParentWindow != null && ParentWindow.Visible)
                    {
                        Layout.MakePrimary(Layout.Elements[new Random().Next(Layout.Elements.Count())]);
                    }
                });
            };

            //T.Start();
        }