コード例 #1
0
        void OnMessageSelected(MailDetailsViewModel mailDetailViewModel)
        {
            var del = this.MessageSelected;

            if (del != null)
            {
                del(mailDetailViewModel);
            }
        }
コード例 #2
0
        public MailDetailsPage(MailDetailsViewModel model) : base()
        {
            this.model          = model;
            this.BindingContext = this.model;

            this.Title = "Mail Details";

            var fromDescLbl = new Label {
                Text = "From:"
            };

            var fromLbl = new Label();

            fromLbl.SetBinding(Label.TextProperty, new Binding("From"));

            var subjectDescLbl = new Label {
                Text = "Subject:",
            };

            var subjectLbl = new Label();

            subjectLbl.SetBinding(Label.TextProperty, new Binding("Subject"));

            var bodyLbl = new Label {
                LineBreakMode        = LineBreakMode.WordWrap,
                MinimumHeightRequest = 200
            };

            bodyLbl.SetBinding(Label.TextProperty, new Binding("Body"));


            // Use a GridLayout, just to see how it works.
            var layout = new GridLayout();

            // Row 1: From
            layout.Add(fromDescLbl, 0, 0);
            layout.Add(fromLbl, 1, 0);

            // Row 2: subject
            layout.Add(subjectDescLbl, 0, 1);
            layout.Add(subjectLbl, 1, 1);

            // Row 3 (spanned): body
            layout.Add(bodyLbl, 0, 2, 2, 3);

            layout.SetColumnSpacing(0, 60);
            layout.SetRowSpacing(2, 20);

            this.Content = layout;
        }
コード例 #3
0
 void HandleMessageSelected(MailDetailsViewModel mailDetailViewModel)
 {
     this.NavigateTo(new MailDetailsPage(mailDetailViewModel));
 }