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 8605127
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T02:44:54+00:00 2026-06-12T02:44:54+00:00

So I have a primary MainViewModel that collects and distributes a fair amount of

  • 0

So I have a primary MainViewModel that collects and distributes a fair amount of real-time data (changes every .1 seconds). Currently all of my Controls are referencing my MainViewModel.

I’m using a UserControl Control to replicate many objects of the same type of Digital Gauge.

My question is, is there a best practice for “pushing” or “referencing” data from my MainViewModel to a ControlViewModel? The purpose I have in mind is to keep the DependencyProperties I need tucked away cleanly in a ControlViewModel and keep the MainViewModel as clean and tidy as possible.

Is MVVMLight Messaging an option?
Is an event appropriate?
Can I setup bindings from the ControlViewModel to the MainViewModel so when the MainViewModel data is updated, it gets reflected in the ControlViewModel?

  • 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-12T02:44:55+00:00Added an answer on June 12, 2026 at 2:44 am

    If I understand the question properly, I think you may just want to create a property of that exposes a collection of ControlViewModels in your MainViewModel:

    public class MainViewModel : INotifyPropertyChanged
    {
        public IEnumerable<ControlViewModel> Controls { get; private set; }
    }
    

    You can set this with all of the necessary ControlViewModel objects in the constructor. If you might add or remove gauges, change IEnumerable to ObservableCollection.

    Then for your gauges, you’d use an ItemsControl and set ItemsSource="{Binding Controls}". This will automatically make the DataContext for each item one of your ControlViewModels.

    To render the items with your gauge control, set the ItemTemplate on the ItemsControl:

    <ItemsControl.ItemTemplate>
        <DataTemplate DataType="{x:Type YourNamespace:ControlViewModel}">
            <YourNamespace:DigitalGauge />
        </DataTemplate>
    </ItemsControl.ItemTemplate>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a primary table for Articles that is linked by a join table
Consider a database(MSSQL 2005) that consists of 100+ tables which have primary keys defined
I have a primary key that I don't want to auto increment (for various
I have two data tables which have a primary key column in common but
I have three tables, table A has a unique primary key that is auto-incremented,
I have a primary key OrderHeaderID that auto increments, but i also need to
I have some tables in my database that have primary keys of type int
I have a bunch of huge tables that don't have primary keys. (Don't ask
I have a table on MySQL with a primary key, I inserted to that
I have a MySQL database with 60 tables. Most of the tables have primary

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.