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