Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8526555
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T08:18:18+00:00 2026-06-11T08:18:18+00:00

I was wondering if any of you guys know some good tutorial explaining MVVM

  • 0

I was wondering if any of you guys know some good tutorial explaining MVVM for large applications. Every tutorial on MVVM i found are just basics explained (how to implement model, viewmodel and view), but I’m curious on techniques and patterns when it comes to passing data between application pages, where to init viewmodels, where to store common application data (shared between multiple viewmodels) etc.

I prefer pure c#/XAML solutions without any MVVM frameworks (MVVMLight etc).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T08:18:20+00:00Added an answer on June 11, 2026 at 8:18 am

    techniques and patterns when it comes to passing data between
    application pages

    If the data passing is event-driven (i.e: you want to notify when you receive data pushed from a server), use weak events. Prism’s EventAggregator is one of many implementations.

    If the data passing is constant, let the DataContext flow down the XAML tree and simply use binding.
    That means if you have a “master” UserControl that uses other, more specific, UserControls, don’t set their DataContext, they will inherit the master’s and all is well.
    If you want to separate functionality, use composition in the master’s viewmodel.

    where to init viewmodels

    Purists will tell you to instantiate them directly in XAML. I almost never do that.
    First of all, ViewModels usually need services, and they’re passed as constructor parameters, or injected via MEF in the constructor… etc. So you can’t have a parameterless constructor, or it’s harder.

    Now, we can do hard stuff, but what’s the gain? It’s perfectly fine to let the code-behind of the view retrieve the ViewModel, or get it injected in its constructor.

    where to store common application data (shared between multiple
    viewmodels)

    If the data is global: use static classes/properties,
    in XAML you can access them via {x:Static my:StaticClass.StaticProperty}, if you want to reach a nested class/enum, use + instead of .

    If the data is only shared between several ViewModels but not all, use inheritance/composition on the viewmodels, along with a controller pattern.

    Other tips gathered from experience:

    • Only bind strictly what you need: don’t bind to an entire object when you just need a string in there.

    • If you’re binding the same thing again and again, don’t hesitate to make custom markup by inheriting from Binding/MultiBinding. It’s DRY 101, but most people just copy/paste Bindings for some reason.

    Example:

    public class VisibilityBinding : MultiBinding, IMultiValueConverter
    {
       public VisibilityBinding()
       {
          var isSomething = new Binding("IsSomething");
          isSomething.ElementName = myUsrCtrl;
          this.Bindings.Add(isSomething);
    
          //Add more bindings
    
          this.Converter = this;
        }
    
        //Implement IMultiValueConverter to compute a System.Visibility from the bound values.
    }
    

    And in XAML:

     <TextBox Visibility={customMrkup:VisibilityBinding} />
    
    • Avoid at all cost any data duplication, all the way down to the DAL. It becomes complex really fast to synchronize fields that could just be deduced through an I(Multi)ValueConverter.
      Example: You have an audio file. It has a start time, an end time, and a duration. Get rid of any of these 3 properties, the third can be deduced.

    If I think of any more tips I’ll come back and add them.

    Hope this helps!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Just wondering if any of you guys know of any web-based/browser-based employee scheduling software/tools?
I was wondering if any of you know some libraries that will help/improve the
I was just wondering if any one knows of a good script to emulate
I was wondering if you guys know of any software that allows me to
Hello guys I was wondering why some websites which uses php (or any other
Hej guys, I was wondering if you know any well working Math or Calculation
I was wondering if any of you guys know how to show that dashed
Hi guys I downloaded Jaspersoft ireport and was wondering if you know of any
Hey guys I wanted to know if I get get some advice from some
just wondering is there any chance that their will be a dummy database schemas

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.