コード例 #1
0
        // Note - The Xamarin.Forms Previewer requires a default, parameterless constructor to render a page.
        public BlogDetailsPage()
        {
            InitializeComponent();

            var item = new BlogPost
            {
                Title    = "Item 1",
                Message  = "This is an item description.",
                PostDate = "10/10/10"
            };

            viewModel      = new BlogDetailsViewModel(item);
            BindingContext = viewModel;
        }
コード例 #2
0
        public BlogDetailsPage(BlogDetailsViewModel viewModel)
        {
            InitializeComponent();

            BindingContext = this.viewModel = viewModel;

            Content = new StackLayout()
            {
                Children =
                {
                    _GetHeader(),
                    _GetPostView()
                }
            };
        }