Exemplo n.º 1
0
 public void IconLabel_OnDisappearing(double scale, uint millisecond)
 {
     IconImage.TranslateTo(0, +4, millisecond, Easing.BounceIn);
     IconLabel.ScaleTo(scale, millisecond, Easing.BounceIn);
     //Label obj = (Label)this.FindByName<Label>(myclass);
     //obj.ScaleTo(scale, millisecond, Easing.BounceIn);
 }
Exemplo n.º 2
0
 public void Setup()
 {
     TestDetails       = new TestDetailsView();
     TestDetails.Test  = new Test(new TestCase("Foo", "foo.pmlobj"), "bar");
     TestNameLabel     = TestDetails.FindControl <Label>("TestNameLabel");
     StatusLabel       = TestDetails.FindControl <IconLabel>("TestResultIconLabel");
     ElapsedTimeLabel  = TestDetails.FindControl <Label>("ElapsedTimeLabel");
     ErrorMessageLabel = TestDetails.FindControl <Label>("ErrorMessageLabel");
 }
Exemplo n.º 3
0
        public ApacheSitesList()
        {
            this.Build ();

            /*model = new TreeStore(typeof (string), typeof (string), typeof (string));
            treeView.Model = model;
            treeView.HeadersVisible = true;

            treeView.AppendColumn("Sites", new CellRendererText (), "text", 0);
            treeView.AppendColumn("Status", new CellRendererText (), "text", 1);
            treeView.AppendColumn("Config File", new CellRendererText (), "text", 2);*/

            // TreeView

            model = new TreeStore(typeof (ApacheSite));
            treeView.Model = model;
            treeView.HeadersVisible = true;

            // Name Column
            TreeViewColumn nameColumn = new TreeViewColumn ();
            nameColumn.Title = "Sites";
            CellRendererText nameCell = new CellRendererText();
            nameColumn.PackStart (nameCell, true);
            // Status Column
            TreeViewColumn statusColumn = new TreeViewColumn ();
            statusColumn.Title = "Status";
            CellRendererText statusCell = new CellRendererText();
            statusColumn.PackStart (statusCell, true);
            // Config Column
            TreeViewColumn configColumn = new TreeViewColumn ();
            configColumn.Title = "Config File";
            CellRendererText configCell = new CellRendererText();
            configColumn.PackStart (configCell, true);

            treeView.AppendColumn (nameColumn);
            treeView.AppendColumn (statusColumn);
            treeView.AppendColumn (configColumn);

            nameColumn.SetCellDataFunc (nameCell, new TreeCellDataFunc (RenderName));
            statusColumn.SetCellDataFunc (statusCell, new TreeCellDataFunc (RenderStatus));
            configColumn.SetCellDataFunc (configCell, new TreeCellDataFunc (RenderConfig));

            treeView.Selection.Changed += OnSelectionChanged;

            // Buttons

            iconLabelStatusButton = new JLWidgets.IconLabel();
            iconLabelStatusButton.SetImageFromIcon("gtk-ok");
            iconLabelStatusButton.SetText("Activate");

            statusButton.Remove(statusButton.Child);
            statusButton.Add(iconLabelStatusButton);

            statusButton.Sensitive = false;
            editButton.Sensitive = false;
        }
Exemplo n.º 4
0
        private void AddCell(ListElement item, int x, int y)
        {
            StackLayout sl = new StackLayout()
            {
                HorizontalOptions = LayoutOptions.Center
            };

            if (!string.IsNullOrWhiteSpace(item.Image))
            {
                CachedImage img = new CachedImage()
                {
                    Source           = item.Image,
                    Aspect           = Aspect.AspectFit,
                    WidthRequest     = App.Current.MainPage.Width / Columns,
                    InputTransparent = true
                };
                sl.Children.Add(img);
            }
            else
            {
                IconLabel icon = new IconLabel()
                {
                    Text = item.Icon,
                    HorizontalOptions = LayoutOptions.Center,
                    FontSize          = item.IconFontSize,
                    InputTransparent  = true,
                    TextColor         = item.IconTextColor
                };
                sl.Children.Add(icon);
            }

            Label label = new Label()
            {
                Text = item.Title,
                HorizontalOptions       = LayoutOptions.Center,
                FontSize                = item.FontSize,
                HorizontalTextAlignment = TextAlignment.Center,
                InputTransparent        = true,
                TextColor               = item.TextColor
            };

            sl.Children.Add(label);

            TapGestureRecognizer tgr = new TapGestureRecognizer()
            {
                NumberOfTapsRequired = 1
            };

            tgr.Tapped += (s, ee) =>
            {
                SelectedItem = item;
                ItemSelected?.Invoke(sl, new SelectedItemChangedEventArgs(item));
            };
            sl.GestureRecognizers.Add(tgr);
            gGrid.Children.Add(sl, x, y);
        }
Exemplo n.º 5
0
        public ApacheModsList()
        {
            this.Build();

            // TreeView

            model                   = new TreeStore(typeof(ApacheMod));
            treeView.Model          = model;
            treeView.HeadersVisible = true;

            // Name Column
            TreeViewColumn nameColumn = new TreeViewColumn();

            nameColumn.Title = "Mods";
            CellRendererText modsNameCell = new CellRendererText();

            nameColumn.PackStart(modsNameCell, true);
            // Status Column
            TreeViewColumn statusColumn = new TreeViewColumn();

            statusColumn.Title = "Status";
            CellRendererText modsStatusCell = new CellRendererText();

            statusColumn.PackStart(modsStatusCell, true);
            // Config Column
            TreeViewColumn configColumn = new TreeViewColumn();

            configColumn.Title = "Config File";
            CellRendererText modsConfigCell = new CellRendererText();

            configColumn.PackStart(modsConfigCell, true);

            treeView.AppendColumn(nameColumn);
            treeView.AppendColumn(statusColumn);
            treeView.AppendColumn(configColumn);

            nameColumn.SetCellDataFunc(modsNameCell, new TreeCellDataFunc(RenderModName));
            statusColumn.SetCellDataFunc(modsStatusCell, new TreeCellDataFunc(RenderModStatus));
            configColumn.SetCellDataFunc(modsConfigCell, new TreeCellDataFunc(RenderModConfig));

            treeView.Selection.Changed += OnSelectionChanged;

            // Buttons

            iconLabelStatusButton = new JLWidgets.IconLabel();
            iconLabelStatusButton.SetImageFromIcon("gtk-ok");
            iconLabelStatusButton.SetText("Activate");

            statusButton.Remove(statusButton.Child);
            statusButton.Add(iconLabelStatusButton);

            statusButton.Sensitive = false;
            editButton.Sensitive   = false;
        }
Exemplo n.º 6
0
        public void TestMeasureSingleIcon()
        {
            var style = LayoutTestStyle.Create();
            var l     = new IconLabel(style);

            style.StyleResolver.AddRoot(l);

            l.Image.Texture = LayoutTestStyle.CreateTexture("Image", 40, 30);

            l.Measure(Size.Auto);

            l.DesiredSize.Should().Be(new Size(60, 50));
        }
Exemplo n.º 7
0
        public void TestMeasureSingleLabel()
        {
            var style = LayoutTestStyle.Create();
            var l     = new IconLabel(style);

            style.StyleResolver.AddRoot(l);

            l.Label.Text = "Test";

            l.Measure(Size.Auto);

            l.DesiredSize.Should().Be(new Size(64, 35));
        }
        public void Initialize()
        {
            BackgroundView = new UIView {
                BackgroundColor = UIColor.White
            };
            SelectedBackgroundView = new UIView {
                BackgroundColor = UIColor.White
            };

            _label           = new IconLabel();
            _label.TextColor = UIColor.Black;
            _label.Font      = UIFont.SystemFontOfSize(12);
            ContentView.AddSubview(_label);
        }
Exemplo n.º 9
0
        public void TestArrangeFull()
        {
            var style = LayoutTestStyle.Create();
            var l     = new IconLabel(style);

            style.StyleResolver.AddRoot(l);

            l.Image.Texture = LayoutTestStyle.CreateTexture("Image", 40, 30);
            l.Label.Text    = "Test";

            l.Arrange(new Rectangle(10, 20, 300, 200));
            l.IconTextGap.Should().Be(10);
            l.LayoutRect.Should().Be(new Rectangle(10, 20, 134, 200));
            l.Image.LayoutRect.Should().Be(new Rectangle(20, 105, 40, 30));
            l.Label.LayoutRect.Should().Be(new Rectangle(70, 30, 64, 180));

            l.LayoutRect.Center.Y.Should().Be(120);
            l.Image.LayoutRect.Center.Y.Should().Be(120);
            l.Label.LayoutRect.Center.Y.Should().Be(120);
        }
Exemplo n.º 10
0
        public void TestArrangeFullZeroWidth()
        {
            var style = LayoutTestStyle.Create();
            var l     = new IconLabel(style);

            style.StyleResolver.AddRoot(l);

            l.Image.Texture = LayoutTestStyle.CreateTexture("Image", 40, 30);
            l.Label.Text    = "Test";

            l.Arrange(new Rectangle(10, 20, 0, 0));

            l.LayoutRect.Should().Be(new Rectangle(10, 5, 70, 50));
            l.Image.LayoutRect.Should().Be(new Rectangle(20, 15, 40, 30));
            l.Label.LayoutRect.Should().Be(new Rectangle(70, 30, 0, 0));

            l.LayoutRect.Center.Y.Should().Be(30);
            l.Image.LayoutRect.Center.Y.Should().Be(30);
            l.Label.LayoutRect.Center.Y.Should().Be(30);
        }
Exemplo n.º 11
0
        public MatchCell()
        {
            var roundLabel = new Label
            {
                HorizontalTextAlignment = TextAlignment.Center,
                VerticalTextAlignment   = TextAlignment.Start,
                FontAttributes          = FontAttributes.Bold,
                FontSize = 10,
                Text     = "Round"
            };

            var roundNumber = new Label
            {
                HorizontalTextAlignment = TextAlignment.Center,
                VerticalTextAlignment   = TextAlignment.Center,
                FontAttributes          = FontAttributes.Bold,
                FontSize = 15
            };

            roundNumber.SetBinding(Label.TextProperty, "RoundNumber");

            var roundStack = new StackLayout
            {
                Spacing           = 0,
                Padding           = 0,
                Orientation       = StackOrientation.Vertical,
                HorizontalOptions = LayoutOptions.Center,
                VerticalOptions   = LayoutOptions.Center,
                Children          =
                {
                    roundLabel,
                    roundNumber
                }
            };

            var teamsLabel = new Label
            {
                HorizontalOptions = LayoutOptions.Start,
                VerticalOptions   = LayoutOptions.Center,
                FontSize          = 14,
                LineBreakMode     = LineBreakMode.WordWrap
            };

            teamsLabel.SetBinding(Label.TextProperty, "VersingTeams");

            var scoreLabel = new Label
            {
                HorizontalOptions = LayoutOptions.Start,
                VerticalOptions   = LayoutOptions.Center,
                FontSize          = 14,
                LineBreakMode     = LineBreakMode.WordWrap
            };

            scoreLabel.SetBinding(Label.TextProperty, "ShortTotalScore");

            var detailStack = new StackLayout
            {
                Spacing           = 0,
                Padding           = 10,
                Orientation       = StackOrientation.Vertical,
                HorizontalOptions = LayoutOptions.Center,
                VerticalOptions   = LayoutOptions.Center,
                Children          =
                {
                    teamsLabel,
                    //scoreLabel
                }
            };

            var disclosureIndicator = new IconLabel
            {
                FontSize = 26,
                Text     = "fa-angle-right",
                VerticalTextAlignment   = TextAlignment.Center,
                HorizontalTextAlignment = TextAlignment.Center
            };

            var layout = new RelativeLayout {
                HeightRequest = 65
            };

            layout.Children.Add(roundStack,
                                Constraint.Constant(0), // x
                                Constraint.Constant(0),
                                Constraint.Constant(65),
                                Constraint.RelativeToParent(cell => cell.Height));

            layout.Children.Add(detailStack,
                                Constraint.Constant(65),                                     // x
                                Constraint.Constant(0),                                      // y
                                Constraint.RelativeToParent(cell => (cell.Width - 30 - 65)), // width
                                Constraint.RelativeToParent(cell => cell.Height));           // height);

            layout.Children.Add(disclosureIndicator,
                                Constraint.RelativeToParent(c => c.Width - 30),
                                Constraint.Constant(0),
                                Constraint.Constant(30),
                                Constraint.Constant(65));

            View = layout;
        }
        private void AddTitleBar(ContentView layout, MobilePage page)
        {
            nav = ( StackLayout )layoutManager.GetElement("NavBar");
            if (nav != null)
            {
                nav.IsVisible = true;
                if (page.Attributes.ContainsKey("AccentColor") && !string.IsNullOrEmpty(page.Attributes["AccentColor"]))
                {
                    nav.BackgroundColor = (Color) new ColorTypeConverter().ConvertFromInvariantString(page.Attributes["AccentColor"]);
                }

                StackLayout stackLayout = new StackLayout
                {
                    HeightRequest   = 44,
                    Orientation     = StackOrientation.Horizontal,
                    VerticalOptions = LayoutOptions.Center
                };

                nav.Children.Add(stackLayout);

                if (App.Navigation.Navigation.NavigationStack.Count > 1)
                {
                    IconLabel icon = new IconLabel
                    {
                        Text = "fa fa-chevron-left",
                        HorizontalOptions = LayoutOptions.Start,
                        VerticalOptions   = LayoutOptions.Center,
                        FontSize          = 30,
                        Margin            = new Thickness(10, 7, 0, 0),
                        TextColor         = Color.Black
                    };

                    TapGestureRecognizer tgr = new TapGestureRecognizer()
                    {
                        NumberOfTapsRequired = 1
                    };
                    tgr.Tapped += (s, ee) =>
                    {
                        AvalancheNavigation.RemovePage();
                    };
                    nav.GestureRecognizers.Add(tgr);

                    stackLayout.Children.Add(icon);
                }

                Label label = new Label
                {
                    Text = page.Title,
                    HorizontalTextAlignment = TextAlignment.Center,
                    HorizontalOptions       = LayoutOptions.CenterAndExpand,
                    VerticalOptions         = LayoutOptions.Center,
                    FontSize  = 20,
                    Margin    = new Thickness(0, 6, 0, 0),
                    TextColor = Color.Black
                };
                stackLayout.Children.Add(label);

                BoxView boxview = new BoxView
                {
                    HeightRequest     = 0.5,
                    HorizontalOptions = LayoutOptions.FillAndExpand,
                    BackgroundColor   = Color.Black
                };
                nav.Children.Add(boxview);
            }
        }
Exemplo n.º 13
0
        public UcHsLabelValueCell()
        {
            layout = new StackLayout()
            {
                Orientation = StackOrientation.Horizontal,
                Spacing     = 0,
                Padding     = new Thickness(13)
            };

            StackLayout labelLayout = new StackLayout()
            {
                Orientation       = StackOrientation.Vertical,
                HorizontalOptions = LayoutOptions.FillAndExpand,
                VerticalOptions   = LayoutOptions.FillAndExpand,
                Spacing           = 2
            };

            Label label = new Label()
            {
                FontSize          = Device.GetNamedSize(NamedSize.Default, typeof(Label)),
                HorizontalOptions = LayoutOptions.StartAndExpand
            };

            label.SetBinding(Xamarin.Forms.Label.TextProperty, new Binding()
            {
                Source = HsLabelValue, Path = "Label"
            });
            label.SetBinding(Xamarin.Forms.Label.TextColorProperty, new Binding()
            {
                Source = HsLabelValue, Path = "LabelColor"
            });

            Label value = new Label()
            {
                FontSize = Device.GetNamedSize(NamedSize.Small, typeof(Label)), FontAttributes = FontAttributes.Italic, HorizontalOptions = LayoutOptions.StartAndExpand
            };

            value.SetBinding(Xamarin.Forms.Label.TextProperty, new Binding()
            {
                Source = HsLabelValue, Path = "Value"
            });
            value.SetBinding(Xamarin.Forms.Label.TextColorProperty, new Binding()
            {
                Source = HsLabelValue, Path = "ValueColor"
            });

            IconLabel showDatail = new IconLabel()
            {
                Text            = "ion-chevron-right",
                VerticalOptions = LayoutOptions.Center
            };

            showDatail.SetBinding(Xamarin.Forms.Label.IsVisibleProperty, new Binding()
            {
                Source = HsLabelValue, Path = "ItemShowDetailImage"
            });

            labelLayout.Children.Add(label);
            labelLayout.Children.Add(value);

            layout.Children.Add(labelLayout);
            layout.Children.Add(showDatail);



            View = layout;
        }
Exemplo n.º 14
0
        private void AddCell(ListElement item, int x, int y)
        {
            StackLayout sl = new StackLayout()
            {
                HorizontalOptions = LayoutOptions.Center,
                Spacing           = 0
            };

            if (!string.IsNullOrWhiteSpace(item.Image))
            {
                if (item.Image.Contains(".svg"))
                {
                    SvgCachedImage img = new SvgCachedImage()
                    {
                        Source           = item.Image,
                        Aspect           = Aspect.AspectFit,
                        WidthRequest     = App.Current.MainPage.Width / Columns,
                        InputTransparent = true
                    };
                    if (ImageWidth > 0)
                    {
                        img.WidthRequest = ImageWidth;
                    }

                    sl.Children.Add(img);
                }
                else
                {
                    CachedImage img = new CachedImage()
                    {
                        Source           = item.Image,
                        Aspect           = Aspect.AspectFit,
                        WidthRequest     = Application.Current.MainPage.Width / Columns,
                        InputTransparent = true
                    };
                    if (ImageWidth > 0)
                    {
                        img.WidthRequest = ImageWidth;
                    }

                    sl.Children.Add(img);
                }
            }
            else
            {
                IconLabel icon = new IconLabel()
                {
                    Text = item.Icon,
                    HorizontalOptions = LayoutOptions.Center,
                    FontSize          = item.IconFontSize,
                    InputTransparent  = true,
                    TextColor         = item.IconTextColor
                };
                sl.Children.Add(icon);
            }

            Label title = new Label()
            {
                Text = item.Title,
                HorizontalOptions       = LayoutOptions.Center,
                FontSize                = item.FontSize,
                HorizontalTextAlignment = TextAlignment.Center,
                FontAttributes          = FontAttributes.Bold,
                InputTransparent        = true,
                TextColor               = item.TextColor
            };

            sl.Children.Add(title);

            if (!string.IsNullOrWhiteSpace(item.Description))
            {
                Label description = new Label()
                {
                    Margin                  = new Thickness(0, -2, 0, 2),
                    Text                    = item.Description,
                    HorizontalOptions       = LayoutOptions.Center,
                    FontSize                = item.FontSize,
                    HorizontalTextAlignment = TextAlignment.Center,
                    InputTransparent        = true,
                    TextColor               = item.TextColor
                };
                sl.Children.Add(description);
            }

            TapGestureRecognizer tgr = new TapGestureRecognizer()
            {
                NumberOfTapsRequired = 1
            };

            tgr.Tapped += (s, ee) =>
            {
                SelectedItem = item;
                ItemSelected?.Invoke(sl, new SelectedItemChangedEventArgs(item));
            };
            sl.GestureRecognizers.Add(tgr);
            gGrid.Children.Add(sl, x, y);
        }
Exemplo n.º 15
0
        public IconLabelPage()
        {
            this.Title           = "Icon Label (Font anwsome label)";
            this.BackgroundColor = Color.Black;
            IconLabel label1 = new IconLabel()
            {
                Icon      = "\uf1d8",
                Text      = "Text and icon",
                TextColor = Color.White,
                IconColor = Color.White
            };

            IconLabel label2 = new IconLabel()
            {
                Icon      = "\uf1d8",
                Text      = "Different color and size",
                IconColor = Color.Red,
                TextColor = Color.White,
                IconSize  = 50,
                FontSize  = 20
            };

            IconLabel label3 = null;

            Device.OnPlatform(null, () =>
            {
                //Orientation boottom and top only supported on Android
                label3 = new IconLabel()
                {
                    Icon        = "\uf1d8",
                    Text        = "Orientation icon on top",
                    TextColor   = Color.White,
                    IconColor   = Color.White,
                    FontSize    = 20,
                    Orientation = Enums.ImageOrientation.ImageOnTop
                };
            }, null);
            IconLabel label4 = new IconLabel()
            {
                Icon        = "\uf1d8",
                Text        = "Orientation icon on the right",
                TextColor   = Color.White,
                IconColor   = Color.White,
                FontSize    = 20,
                Orientation = Enums.ImageOrientation.ImageToRight
            };

            IconLabel label5 = null;

            Device.OnPlatform(null, () =>
            {
                //Orientation boottom and top only supported on Android
                label5 = new IconLabel()
                {
                    Icon        = "\uf1d8",
                    Text        = "Orientation icon on bottom",
                    TextColor   = Color.White,
                    IconColor   = Color.White,
                    FontSize    = 20,
                    Orientation = Enums.ImageOrientation.ImageOnBottom,
                };
            }, null);

            IconLabel label6 = new IconLabel()
            {
                Icon           = "\uf1d8",
                Text           = "TextAlignment Center",
                TextColor      = Color.White,
                IconColor      = Color.White,
                FontSize       = 20,
                TextAlignement = TextAlignment.Center
            };
            IconLabel label7 = new IconLabel()
            {
                Icon           = "\uf1d8",
                Text           = "TextAlignment End",
                TextColor      = Color.White,
                IconColor      = Color.White,
                FontSize       = 20,
                TextAlignement = TextAlignment.End
            };
            IconLabel label8 = new IconLabel()
            {
                Icon           = "\uf1d8",
                Text           = " TextAlignment Start",
                TextColor      = Color.White,
                IconColor      = Color.White,
                FontSize       = 20,
                TextAlignement = TextAlignment.Start
            };

            IconLabel label9 = new IconLabel()
            {
                Icon = "\uf1d8",
                Text = "With icon separator",
                ShowIconSeparator = true,
                TextColor         = Color.Red,
                IconColor         = Color.White,
                IconSize          = 20,
                FontSize          = 20
            };

            string    up         = "\uf102";
            string    down       = "\uf103";
            IconLabel SwitchIcon = new IconLabel()
            {
                Icon = up,

                IconColor = Color.Blue,
                IconSize  = 30,
            };

            Button switchBtn = new Button()
            {
                Text      = "Toggle icon up/down",
                TextColor = Color.White
            };

            switchBtn.Clicked += (s, a) =>
            {
                SwitchIcon.Icon = SwitchIcon.Icon == up ? down : up;
            };

            StackLayout content = null;

            Device.OnPlatform(() =>
            {
                content = new StackLayout()
                {
                    HorizontalOptions = LayoutOptions.FillAndExpand,
                    VerticalOptions   = LayoutOptions.FillAndExpand,
                    Children          =
                    {
                        label1,
                        label2,
                        label4,
                        label6,
                        label7,
                        label8,
                        label9,
                        new StackLayout()
                        {
                            Orientation = StackOrientation.Vertical,
                            Children    =
                            {
                                switchBtn,
                                SwitchIcon
                            }
                        }
                    }
                };
            }, () =>
            {
                content = new StackLayout()
                {
                    HorizontalOptions = LayoutOptions.FillAndExpand,
                    VerticalOptions   = LayoutOptions.FillAndExpand,
                    Children          =
                    {
                        label1,
                        label2,
                        label3,
                        label4,
                        label5,
                        label6,
                        label7,
                        label8,
                        label9,
                        new StackLayout()
                        {
                            Orientation = StackOrientation.Vertical,
                            Children    =
                            {
                                switchBtn,
                                SwitchIcon
                            }
                        }
                    }
                };
            }, null);
            this.Content = content;
        }
Exemplo n.º 16
0
        public ApacheSitesList()
        {
            this.Build();

            /*model = new TreeStore(typeof (string), typeof (string), typeof (string));
            *  treeView.Model = model;
            *  treeView.HeadersVisible = true;
            *
            *  treeView.AppendColumn("Sites", new CellRendererText (), "text", 0);
            *  treeView.AppendColumn("Status", new CellRendererText (), "text", 1);
            *  treeView.AppendColumn("Config File", new CellRendererText (), "text", 2);*/

            // TreeView

            model                   = new TreeStore(typeof(ApacheSite));
            treeView.Model          = model;
            treeView.HeadersVisible = true;

            // Name Column
            TreeViewColumn nameColumn = new TreeViewColumn();

            nameColumn.Title = "Sites";
            CellRendererText nameCell = new CellRendererText();

            nameColumn.PackStart(nameCell, true);
            // Status Column
            TreeViewColumn statusColumn = new TreeViewColumn();

            statusColumn.Title = "Status";
            CellRendererText statusCell = new CellRendererText();

            statusColumn.PackStart(statusCell, true);
            // Config Column
            TreeViewColumn configColumn = new TreeViewColumn();

            configColumn.Title = "Config File";
            CellRendererText configCell = new CellRendererText();

            configColumn.PackStart(configCell, true);

            treeView.AppendColumn(nameColumn);
            treeView.AppendColumn(statusColumn);
            treeView.AppendColumn(configColumn);

            nameColumn.SetCellDataFunc(nameCell, new TreeCellDataFunc(RenderName));
            statusColumn.SetCellDataFunc(statusCell, new TreeCellDataFunc(RenderStatus));
            configColumn.SetCellDataFunc(configCell, new TreeCellDataFunc(RenderConfig));

            treeView.Selection.Changed += OnSelectionChanged;

            // Buttons

            iconLabelStatusButton = new JLWidgets.IconLabel();
            iconLabelStatusButton.SetImageFromIcon("gtk-ok");
            iconLabelStatusButton.SetText("Activate");

            statusButton.Remove(statusButton.Child);
            statusButton.Add(iconLabelStatusButton);

            statusButton.Sensitive = false;
            editButton.Sensitive   = false;
        }
        private void AddCell(ListElement item, int x, int y)
        {
            var frame = new Frame()
            {
                Padding   = new Thickness(0, 0, 0, 10),
                HasShadow = true
            };

            StackLayout sl = new StackLayout()
            {
                HorizontalOptions = LayoutOptions.Center,
                WidthRequest      = (App.Current.MainPage.Width / Columns) - 10
            };

            frame.Content = sl;

            if (!string.IsNullOrWhiteSpace(item.Image))
            {
                if (item.Image.Contains(".svg"))
                {
                    SvgCachedImage img = new SvgCachedImage()
                    {
                        Source           = item.Image,
                        Aspect           = Aspect.AspectFit,
                        WidthRequest     = App.Current.MainPage.Width / Columns,
                        InputTransparent = true
                    };
                    sl.Children.Add(img);
                }
                else
                {
                    CachedImage img = new CachedImage()
                    {
                        Source           = item.Image,
                        Aspect           = Aspect.AspectFit,
                        WidthRequest     = App.Current.MainPage.Width / Columns,
                        InputTransparent = true
                    };

                    sl.Children.Add(img);
                }
            }
            else
            {
                IconLabel icon = new IconLabel()
                {
                    Text = item.Icon,
                    HorizontalOptions = LayoutOptions.Center,
                    FontSize          = item.IconFontSize,
                    Margin            = new Thickness(0, 15, 0, 0),
                    TextColor         = item.IconTextColor
                };
                sl.Children.Add(icon);
            }

            Label title = new Label()
            {
                Text = item.Title,
                HorizontalOptions = LayoutOptions.Center,
                FontSize          = item.FontSize,
                TextColor         = item.TextColor,
                Margin            = new Thickness(10, 0)
            };

            sl.Children.Add(title);

            MarkdownView description = new MarkdownView()
            {
                Markdown = item.Description,
                Margin   = new Thickness(10, 0)
            };

            sl.Children.Add(description);

            TapGestureRecognizer tgr = new TapGestureRecognizer()
            {
                NumberOfTapsRequired = 1
            };

            tgr.Tapped += (s, ee) =>
            {
                SelectedItem = item;
                ItemSelected?.Invoke(sl, new SelectedItemChangedEventArgs(item));
            };
            sl.GestureRecognizers.Add(tgr);
            gGrid.Children.Add(frame, x, y);
        }