Windows.Andy.Code4App.dll win8.1/wp8.1 General Class library @ver1.0.0

Source: Internet
Author: User

Straight into question!

Win8.1 and WP8.1 are now gradually merged into one, WP8.1 constantly toward Win8.1, although some methods WP8.1 and Win8.1 different (ps:wp8.1 and Win8.1 differences), but most of the same.

In order to facilitate the use of WP8.1 and Win8.1 call the same method, reduce unnecessary trouble, now I personally summarize some of the simple methods of encapsulation. The code is very simple, the wrong place, also please each road great God many advice ~

The project structure of Windows.Andy.Code4App.dll is as follows:

First, Extension:

1, Commandex:

The main is to use the dependency property to implement the control any method can use Mvvmlight command, to achieve further separation of view and background code.

For example, the tapped method of the grid is expanded.

Use the following:

For commandparameter arguments, including strings, property values for a control, and a control itself, the notation is as familiar as the commandparameter of the mvvmlight, and there is no more to be said.

You can see that the Dependencypropertyex is reserved, primarily to extend the properties of the control itself, rather than the source property of the slice, to extend the random animation of the picture when it is displayed. It hasn't been written yet, and the next extension will be added.

2, Messagedialogex:

Here is the main extension to Messagedialog, referring to the Winrtxamltoolkit, added Showasyncqueue and showasyncifpossible. The main problem is that when two messagedialog are ejected at the same time, the application will collapse. Do not know everyone met, or how do we solve? Use this extension to avoid this problem. What good ways we can communicate.

Use the following:

(Note the reference to add a namespace: using Windows.Andy.Code4App.Extension;)

3, Visualtreehelperex:

This people are very familiar with, not much to say.

Use the following:

Second, Serializationanddeserialization:

1, JsonConvert:

The main is to serialize and deserialize JSON, not much to say, very simple.

Use the following:

Serialization of

Deserialization

A Web site that automatically generates JSON serialized deserialized data Model entities: http://json2csharp.com/

A Web site formatted to view the JSON string: http://json.parser.online.fr/

2, XmlConvert:

The main is to serialize and deserialize XML, not much to say, very simple.

Use the following:

Serialization of

Deserialization

Third, Store:

(fixed means persistent storage, the application will exist as long as it does not unload; temporary means temporary storage, just turn off application data and disappear)

1, Fixed/jsonstore

The main storage here is to save the JSON serialized data as a file to the Localfolder folder. It is also possible to read the specified file data from the Localfolder and deserialize it. Is this used? Maybe it's useful if you use more.

Use the following:

Serialization of storage

Now looking at the Localfolder file, a JSON-named "DATE.JK" has been serialized to save the current time file.

Deserialization Read

2, Fixed/xmlstore:

It is primarily a relative JSON method for serializing stored data, where XML is used to serialize the stored data.

Use the following:

Serialization of storage

Now looking at the Localfolder file, a JSON-named "Date.xk" has been serialized to save the current time file.

Deserialization Read

3, Fixed/settingdstore:

The main use of the system's ApplicationData localsettings to serialize the storage and deserialization of storage.

Note: This method can only serialize some basic data types, such as a datetime type that cannot use this method, and can be substituted with Jsonstore or Xmlstore.

Use the following:

Serialization of storage

Deserialization Read

4, Temporary/dicstore:

The main use of dictionary is to implement serialization storage and deserialization storage. Dictionary is a temporary storage, and the application restart data disappears.

Use the following:

Serialization of storage

Deserialization Read

The above is the Windows.Andy.Code4App.dll @ver1.0.0 of the content, the function is too few, need to encapsulate a lot of, and then add.

Component: Windows.Andy.Code4App.dll

Windows.Andy.Code4App.dll win8.1/wp8.1 General Class library @ver1.0.0

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.