Use Prism6 to create a common program for Windows 10., prism6windows

Source: Internet
Author: User

Use Prism6 to create a common program for Windows 10., prism6windows

 

Use Prism6 to create a common program for Windows 10.

Objective: to create a Windows general program project using prism6.

 

1. solution-add new project-General-blank application-enter name-OK-OK

 

 

2. Right-click the reference and choose manage NuGet packages. Click Browse and enter Prism. unity to find and install the NuGet package. Then click confirm to install the program.

 

 

 

3. Open App. xaml and change Application to PrismUnityApplication.

4. Open the App. xaml. cs code file.

Delete 32 rows. this. Suspending + = OnSuspending;

Delete 35 ~ 104 rows

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

Change Application to PrismUnityApplication

Add method:

Protected override Task OnLaunchApplicationAsync (LaunchActivatedEventArgs args)

{

NavigationService. Navigate ("Homepage", null );

Return Task. FromResult <object> (null );

}

5. Create the Views directory and add the blank Page "homepage Page" (Note that there must be several words behind the Page, and the navigation name is not written here)

After adding text to the homepage, you can start the program to check the effect.

 

 

 

 

Summary:

1. Use Nuget to reference Prism. Unity.

2. Change the Application in the App file to PrismUnityApplication, and change both the foreground and background.

3. Override the OnLaunchApplicationAsync method. This method is required for program startup.

 

Moving forward to a general program...

 

Related Article

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.