View the processing status of the Windows Runtime Component to Windows Store app

A communication of the Store app with Windows Runtime Component

Target

Creating WRC requires Windows 8 or later and Visual Studio 2012 or later.

Change Visual Studio debug configuration

If you want to create WRC work with the Store app type is JavaScript or C++.

Change the [Debugger Type] to the [Mixed(Managed and Native)]. It is in the [Debugging] under the [Configuration Property] of the [Project Property Pages]. To display the Dialog, right-click Store App project select the context menu item [Properties].

If the Store app type is C# or VB.

Right-click Store App project select the context menu item [Properties].

More advanced reference

Raising Events in Windows Runtime Components

Best practices for interoperability with Windows Runtime Components (Windows Store apps using C#/VB/C++ and XAML)

Article

What is WRC. There is a restriction.

How to communicate WRC and the Store app.

The way use the roaming data is very simple.

日本語資料

Presentation file of This article.

Sample code

What is WRC. There is a restriction.

WRC is produces a metadata file.

WRC and a store app communicates via Windows metadata that can understand certain data types such as the primitive data types for parameter types or return types. Therefore types of WRC can not change after compile. It means that WRC must be created with sealed class and public static properties.

What is WRC. There is a restriction.

WRC is effective when reuses business logic.

If reusable logical code is exist, it’s better that the code includes a property as represent the progress of own processing. The property should be defined as the primitive data type with static public property. Though, there is a little hard way that use the custom type property by late binding.

How to communicate WRC and the Store app

There is three ways


The way using the roaming data is very simple

In WRC, write roaming data. And get opposite

WRC fires the Framework event to notify roaming data is changed, in case C# is like bellow.

In the store app, get the roaming data updated using the event listener. Follow is JavaScript sample.

Create HTML 5 Store app

Put the Progress Bar Control on default.html

Create a static method of shield class

Create new project using WRC project template of Visual Studio, then sealed class is created by default. Change the class name by changing the file name of the class, so create a public static methods inside.

Call the method of WRC

Add reference of WRC (NotifyProgressFromWRC project) to the Store app (HTMLWRCRelation JavaScript project that is Startup project)
Create simple code for call the method of WRC.

Tags:

No responses yet

Leave a Reply

Your email address will not be published. Required fields are marked *