public static DetailColumnCollection GetDetails(MyBusinessObject businessObj)
        {
            var columns = new DetailColumnCollection();

            var column = new DetailColumn();
            var group = new DetailGroup("Computer Information");
            group.Add("Computer Name", businessObj.ComputerName);
            group.Add("Network Name", businessObj.NetworkName);

            column.Add(group);
            columns.Add(column);

            return (columns);
        }
예제 #2
0
        public static DetailColumnCollection GetDetails(MyBusinessObject businessObj)
        {
            var columns = new DetailColumnCollection();

            var column = new DetailColumn();
            var group  = new DetailGroup("Computer Information");

            group.Add("Computer Name", businessObj.ComputerName);
            group.Add("Network Name", businessObj.NetworkName);

            column.Add(group);
            columns.Add(column);

            return(columns);
        }
        public override DetailGroup GetDetails(ListObject computer)
        {
            // You can cast computer to the specific object and get
            // more detailed information

            if (computer != null)
            {
                DetailGroup group = new DetailGroup("Computer detailed information");
                group.Add("Computer Id:", computer.Id);

                return(group);
            }
            else
            {
                return(null);
            }
        }
예제 #4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="DetailPageCS"/> class.
        /// </summary>
        public DetailPageCS()
        {
            // create items list
            var groupItems = new List <DetailGroup>();

            // add group 1 items data
            DetailGroup group1 = new DetailGroup {
                ShortName = "Group Index 1"
            };

            int i;

            for (i = 1; i < 10; i++)
            {
                group1.Add(new DetailPageItem {
                    Title = "[" + i + "]elm.text.Subject", Content = "Content text will be written here"
                });
            }

            // add group 2 items data
            DetailGroup group2 = new DetailGroup {
                ShortName = "Group Index 2"
            };

            for (i = 11; i < 20; i++)
            {
                group2.Add(new DetailPageItem {
                    Title = "[" + i + "]elm.text.Subject", Content = "Content text will be written here"
                });
            }

            groupItems.Add(group1);
            groupItems.Add(group2);

            // create list view
            this.listView = new ListView
            {
                // Set the list item row height
                RowHeight         = (int)(0.13 * App.screenHeight),
                HasUnevenRows     = true,
                IsGroupingEnabled = true,

                // Set the group item display name binding
                GroupDisplayBinding = new Binding("DisplayName"),

                // Set the group item short name binding
                GroupShortNameBinding = new Binding("ShortName"),

                ItemsSource = groupItems,

                ItemTemplate = new DataTemplate(() =>
                {
                    Label titleLabel = new Label
                    {
                        TextColor = Color.Black,
                        FontSize  = FONT_SIZE,
                    };

                    Label contentLabel = new Label
                    {
                        TextColor         = Color.Gray,
                        FontSize          = FONT_SIZE - 5,
                        HorizontalOptions = LayoutOptions.StartAndExpand,
                    };

                    Label countLabel = new Label
                    {
                        TextColor = Color.Gray,
                        HorizontalTextAlignment = TextAlignment.End,
                        FontSize = FONT_SIZE - 5,
                        Text     = "[7/14]",
                    };
                    titleLabel.SetBinding(Label.TextProperty, "Title");
                    contentLabel.SetBinding(Label.TextProperty, "Content");

                    var layout = new StackLayout
                    {
                        Padding     = new Thickness(20, 25),
                        Orientation = StackOrientation.Vertical,
                        Children    =
                        {
                            titleLabel,
                            new StackLayout
                            {
                                Spacing     = 30,
                                Orientation = StackOrientation.Horizontal,
                                Children    =
                                {
                                    contentLabel,
                                    countLabel
                                }
                            }
                        }
                    };
                    return(new ViewCell
                    {
                        View = layout
                    });
                }),
            };

            // The title of this page
            this.Title = "Email UI";

            // Content view of this page.
            this.Content = new StackLayout
            {
                VerticalOptions = LayoutOptions.FillAndExpand,
                Children        =
                {
                    this.listView
                }
            };
        }
        public override DetailGroup GetDetails(ListObject computer)
        {
            // You can cast computer to the specific object and get
            // more detailed information

            if (computer != null)
            {
                DetailGroup group = new DetailGroup("Computer detailed information");
                group.Add("Computer Id:", computer.Id);

                return group;
            }
            else
            {
                return null;
            }
        }