public JobCell()
        {
            var jobHeader = new JobHeaderView(leftPadding: 5);

            var title = new Label {
                FontSize = Device.GetNamedSize(NamedSize.Small, typeof(Label))
            };

            title.SetBinding <Job>(Label.TextProperty, job => job.Title);

            var customer = new Label {
                FontSize = Device.GetNamedSize(NamedSize.Small, typeof(Label))
            };

            customer.SetBinding <Job>(Label.TextProperty, job => job.CustomerName);


            var jobDetails = new StackLayout
            {
                Orientation = StackOrientation.Vertical,
                Padding     = 5,
                Children    =
                {
                    new StackLayout
                    {
                        Orientation = StackOrientation.Horizontal,
                        Children    =
                        {
                            new Label {
                                Text           = "Customer:",
                                FontSize       = Device.GetNamedSize(NamedSize.Small, typeof(Label)),
                                FontAttributes = FontAttributes.Bold
                            },
                            customer
                        }
                    },
                    new Label         {
                        Text           = "Description:",
                        FontSize       = Device.GetNamedSize(NamedSize.Small, typeof(Label)),
                        FontAttributes = FontAttributes.Bold
                    },
                    title
                }
            };

            var rootLayout = new StackLayout()
            {
                Orientation = StackOrientation.Vertical,
                Spacing     = 0,
                Children    =
                {
                    jobHeader,
                    jobDetails
                }
            };

            this.Height = Device.GetNamedSize(NamedSize.Small, typeof(Label)) * 11;
            this.View   = rootLayout;
        }
Ejemplo n.º 2
0
        public JobCell()
        {
            var jobHeader = new JobHeaderView();

            var title = new Label();

            //title.Font = AppStyle.DefaultFont;
            title.SetBinding <Job>(Label.TextProperty, job => job.Title);

            var customer = new Label();

            //customer.Font = AppStyle.DefaultFont;
            customer.SetBinding <Job>(Label.TextProperty, job => job.CustomerName);

            var jobDetails = new StackLayout
            {
                Orientation = StackOrientation.Vertical,
                Padding     = 5,
                Children    =
                {
                    new StackLayout
                    {
                        Orientation = StackOrientation.Horizontal,
                        Children    =
                        {
                            new Label {
                                Text = "Customer:", FontAttributes = FontAttributes.Bold
                            },
                            customer
                        }
                    },
                    new Label         {
                        Text = "Description:", FontAttributes = FontAttributes.Bold
                    },
                    title
                }
            };

            jobDetails.SetBinding <Job>(StackLayout.BackgroundColorProperty, job => job.Status, converter: new JobStatusToColorConverter(useLightTheme: true));

            var rootLayout = new StackLayout()
            {
                Orientation = StackOrientation.Vertical,
                Spacing     = 0,
                Children    =
                {
                    jobHeader,
                    jobDetails
                }
            };

            this.Height = 130;
            this.View   = rootLayout;
        }
        public JobCell()
        {
            var jobHeader = new JobHeaderView(leftPadding: 5);

            var title = new Label { FontSize =  Device.GetNamedSize(NamedSize.Small, typeof(Label)) };
            title.SetBinding<Job>(Label.TextProperty, job => job.Title);

            var customer = new Label { FontSize =  Device.GetNamedSize(NamedSize.Small, typeof(Label)) };
            customer.SetBinding<Job>(Label.TextProperty, job => job.CustomerName);  
            

            var jobDetails = new StackLayout
            {
                Orientation = StackOrientation.Vertical,
                Padding = 5,
                Children =
                {
                    new StackLayout 
                    {
                        Orientation = StackOrientation.Horizontal,
                        Children = {
                            new Label {
                                Text = "Customer:",
                                FontSize =  Device.GetNamedSize(NamedSize.Small, typeof(Label)),
                                FontAttributes = FontAttributes.Bold
                            },
                            customer
                        }
                    },
                    new Label {
                        Text = "Description:",
                        FontSize =  Device.GetNamedSize(NamedSize.Small, typeof(Label)),
                        FontAttributes = FontAttributes.Bold
                    },
                    title
                }
            };

            var rootLayout = new StackLayout()
            {
                Orientation = StackOrientation.Vertical,
                Spacing = 0,
                Children =
                {
                    jobHeader,
                    jobDetails
                }
            };

            this.Height = 120;
            this.View = rootLayout;
        }
Ejemplo n.º 4
0
        public JobCell()
        {
            var jobHeader = new JobHeaderView();

            var title = new Label();
            //title.Font = AppStyle.DefaultFont;
            title.SetBinding<Job>(Label.TextProperty, job => job.Title);

            var customer = new Label();
            //customer.Font = AppStyle.DefaultFont;
            customer.SetBinding<Job>(Label.TextProperty, job => job.CustomerName);

            var jobDetails = new StackLayout
            {
                Orientation = StackOrientation.Vertical,
                Padding = 5,
                Children =
                {
                    new StackLayout
                    {
                        Orientation = StackOrientation.Horizontal,
                        Children = {
                            new Label { Text = "Customer:", FontAttributes = FontAttributes.Bold },
                            customer
                        }
                    },
                    new Label { Text = "Description:", FontAttributes = FontAttributes.Bold },
                    title
                }
            };
            jobDetails.SetBinding<Job>(StackLayout.BackgroundColorProperty, job => job.Status, converter: new JobStatusToColorConverter(useLightTheme: true));

            var rootLayout = new StackLayout()
            {
                Orientation = StackOrientation.Vertical,
                Spacing = 0,
                Children =
                {
                    jobHeader,
                    jobDetails
                }
            };

            this.Height = 130;
            this.View = rootLayout;
        }