C # Mobile Development Masterdetailpage Slide

Source: Internet
Author: User

First, the result diagram:

Although the cross-platform Android and iOS can be run, because currently only configured for Android, iOS first ignore.

Let's start with a new project, cross-platform application:

Portable Class Libraries:

Portable Project Right-click to add New item

Choose Forms masterdetail Page Xaml

Will create five files that appear to be.

Open App.xaml.cs

         Public App ()        {            InitializeComponent ();             // MainPage = new Casual.mainpage ();             // comment Upstream, and change to the following:            New MasterPage ();                   }

Open MasterPageMaster.xaml.cs

Modify Error

      classmasterpagemasterviewmodel:inotifypropertychanged { PublicObservablecollection<masterpagemenuitem> MenuItems {Get; }  PublicMasterpagemasterviewmodel () {
Hint error name Masterpagemenuitems changed to MenuItems, why change here, mystery of the error MenuItems
=NewObservablecollection<masterpagemenuitem> (New[] { NewMasterpagemenuitem {Id =0, Title ="Page 1" }, NewMasterpagemenuitem {Id =1, Title ="Page 2" }, NewMasterpagemenuitem {Id =2, Title ="Page 3" }, NewMasterpagemenuitem {Id =3, Title ="Page 4" }, NewMasterpagemenuitem {Id =4, Title ="Page 5" }, }); } Public EventPropertyChangedEventHandler propertychanged; voidOnPropertyChanged ([Callermembername]stringPropertyName ="") =propertychanged?. Invoke ( This,NewPropertyChangedEventArgs (PropertyName)); }

Finally, all of the following selected blue files are the created. cs File Open

The namespaces are all erased. Maserpage "

Why do you have to change it manually, eh, you have to ask Microsoft.

Then you can run to see, instantly tall on, and know the daily almost!

Of course you have to learn your own code, and you can add more than forms Masterdetail Page Xaml

There are many, I have not tried, all kinds of pits waiting for everyone to jump, 23333.

Finally, cough, close will be an error, I think it should be righteous words ignore ...

What can I do, I'm desperate too. (╯°-°) ╯︵┻━┻

Hope not typesetting hurt you, write the = =

C # Mobile Development Masterdetailpage Slide

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.