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

  • Home
  • SEARCH
  • 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 3953402
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T01:58:14+00:00 2026-05-20T01:58:14+00:00

I have wholly adopted the MVVM pattern for our silverlight app. However, some of

  • 0

I have wholly adopted the MVVM pattern for our silverlight app. However, some of our UI is data driven. Mainly two items…

  1. The menu. We are using Infragistics XamMenu.

  2. We have a “dashboard” which allows users to add “snap-ins”. This is sort of like a portal site such as iGoogle.

In both cases above the UI needs to be built at runtime. Currently I am running the code in the code behind because I don’t see an easy way to access the UI tree in the ViewModel.

In order to run the code in the view I have created an event in the ViewModel that fires once the data is loaded. So, I have to kludge a reference to the viewmodel in the view code behind. I don’t like it an it is very ugly… so basically two question:

  1. How can I have the view get a message from the viewmodel that the data is loaded without getting a direct reference to the viewmodel in the view code behind? Currently I pull the reference from the data context.

  2. Is it possible to build the UI in the view model and use data binding. I was wondering if I could bind the “content” of a contentcontrol to some type (not sure what the type would be) in the viewmodel? Of course, the bad part about this is the testability of the view model seems to go away. Can binding be used this way?

  • 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-05-20T01:58:15+00:00Added an answer on May 20, 2026 at 1:58 am

    To answer question 1, why dont you make use of the MVVM light “Messenger” class.

    In your view,you register to listen to a message in the following way:

    Messenger.Default.Register<bool>(this, "MessageId", DoSomething);
    

    Where DoSomething is a method that takes in a boolean parameter (for example).

    Then, to send the message from your view model, you do the following:

     Messenger.Default.Send(false, "MessageId");
    

    Hope that helps 🙂 You’ll need to add this to your usings:

    using GalaSoft.MvvmLight.Messaging;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Have just started using Google Chrome , and noticed in parts of our site,
Have you refactored from an ActiveRecord to a DataMapper pattern? What conditions prompted the
I'm working on an application which has data imported from a foreign (and wholly
Have noticed issue while testing iphone app that if one quickly opens/dismisses a modal
I have a script that appends some rows to a table. One of the
I have a new web app that is packaged as a WAR as part
I have a snippet to create a 'Like' button for our news site: <iframe
i have a input tag which is non editable, but some times i need
Have you ever seen any of there error messages? -- SQL Server 2000 Could
Have you guys had any experiences (positive or negative) by placing your source code/solution

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.