Record of mvvm reconstruction on WP7 client of Douban radio station-conclusion

Source: Internet
Author: User

After several nights of struggle, the mvvm transformation journey of dbfm7 finally came to an end. From ignorance of mvvm to the current half-solution of mvvm, this process has learned a lot.

Mvvm aims to separate development concerns, write background logic to the background, and design UI to the UI. However, it is not so easy to achieve this. For example, navigation, such as animations, are not so easy to control in viewmodel, or once controlled in the VM, the original intention of mvvm is damaged. The above two problems are handled by using the message mechanism of mvvm light. Although it seems decoupled, it is still not thorough enough. In particular, viewmodel notifies the view to operate the storyboard.CodeThe viewmodel is still focusing on The View. I didn't think of a better solution yet. I was thinking that when a bound property (image URI) changes, the view will automatically trigger an animation (flying on the right ), this is perfect. It may be feasible. Which of the following experts will give you some advice.

The current viewmodel is much more fresh than codebehind, and there is no business mixed with UI operations. Of course codebehind does not have a single line of code. Codebehind is a part of the view. Some UI copying operations that cannot be defined in XAML can be put here. In addition, mvvm light is really easy to use, making your mvvm development simple and elegant!

Download the latest code to codeplex: http://dbfm7.codeplex.com/SourceControl/list/changesets

I just finished the change and haven't tested it well. Bugs are inevitable. Please tell me if you find it.

The following is a record of the transformation process. We hope to help mvvm beginners.

Mvvm reconstruction record of WP7 client of Douban station using mvvm light for Data Binding

Mvvm reconstruction record of WP7 client of Douban station using mvvm light for event binding

Mvvm reconstruction record on WP7 client of Douban station using message of mvvm light for navigation

Using appbarutils to bind applicationbariconbutton (including iconuri)

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.