Use PRISM6 to build a Windows 10 generic program.

Source: Internet
Author: User
Tags blank page

use PRISM6 to build a Windows 10 generic program.

Objective: To establish a Windows Generic program project using PRISM6.

1. Solution-Add new project-general-blank app-Enter name-OK-OK

2, reference on right--Select Manage NuGet Package--point browse-Enter prism.unity Find-install-ok install

3, open App.xaml change application to Prismunityapplication.

4. Open the App.xaml.cs code file

Delete 32 rows. This. Suspending + = onsuspending;

Delete 35~104 lines

Add: Using Prism.Unity.Windows; Using System.Threading.Tasks;

Change application to Prismunityapplication

To add a method:

protected override Task Onlaunchapplicationasync (Launchactivatedeventargs args)

{

Navigationservice.navigate ("Home", null);

return task.fromresult<object> (NULL);

}

5, create the Views directory, inside Add a blank page "home page" (Note that there will be page several words, the navigation name is not written there)

Add text to the homepage and you can start the program to see the effect.

Summary points:

1, reference prism.unity through NuGet.

2, change the app file inside application is prismunityapplication, foreground and backstage are to change.

3, override the Onlaunchapplicationasync method. This method is required to run the program startup.

Forward to the Universal program ...

Use PRISM6 to build a Windows 10 generic program.

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.