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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T16:02:11+00:00 2026-05-27T16:02:11+00:00

I’m working with a charting tool that doesn’t support binding in the mvvm sense.

  • 0

I’m working with a charting tool that doesn’t support binding in the mvvm sense. So what I’ve decided is that I’d use a kind of messaging(like the MVVM Light’s messaging framework)service such that everytime the viewmodel observablecollection is updated, a message is sent which when received adds datapoints to the chart(this will be in the code behind unfortunately). Do you guys see any issues with this plan?

  • 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-27T16:02:13+00:00Added an answer on May 27, 2026 at 4:02 pm

    I personally think that the messaging is a bit too excessive for what you’re trying to achieve, matter of taste though. Can you not use Adapter or attached behavior patterns? That’s what they typically use to substitute for the missing functionality. If you can instanciate your chart in Xaml (which I hope you do), I’d recommend to use attached behaviors, otherwise use and apater (for the elements which have no public constructors or any other tricky stuff) and instanciate it in the code.

    For any class, which supports imperative calls only you can allways come up with a compensating behavior. here’s a quick sample:

    Code:

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Windows;
    using System.Windows.Controls;
    using System.Windows.Data;
    using System.Windows.Documents;
    using System.Windows.Input;
    using System.Windows.Media;
    using System.Windows.Media.Imaging;
    using System.Windows.Navigation;
    using System.Windows.Shapes;
    
    namespace WpfApplication1
    {
        /// <summary>
        /// Interaction logic for MainWindow.xaml
        /// </summary>
        public partial class MainWindow : Window
        {
            public MainWindow()
            {
                InitializeComponent();
            }
    
            public Dictionary<int, int> MyValues
            {
                get
                {
                    return Enumerable.Range(1, 3).ToDictionary(k => k, v => v);
                }
            }
        }
    
        // component with the 'missing' property
        public class Imperative : FrameworkElement
        {
            public void Add(int x, int y)
            {
                MessageBox.Show(string.Format("{0}_{1}", x, y));
            }
        }
    
        // compensating behavior
        public class DeclarativeBehavior : DependencyObject
        {
            public static DependencyProperty MissingPropertyProperty =
                DependencyProperty.RegisterAttached("MissingProperty",
                typeof(Dictionary<int, int>),
                typeof(DeclarativeBehavior),
                new PropertyMetadata((o, e) => 
                { 
                    //
                    Imperative imperative = (Imperative)o;
                    Dictionary<int, int> values = (Dictionary<int, int>)e.NewValue;
    
    
                    if (imperative != null)
                    {
                        foreach (KeyValuePair<int, int> value in values)
                        {
                            imperative.Add(value.Key, value.Value);
                        }
                    }
                }));
    
            public static void SetMissingProperty(DependencyObject o, Dictionary<int, int> e)
            {
                o.SetValue(DeclarativeBehavior.MissingPropertyProperty, e);
            }
    
            public static Dictionary<int, int> GetMissingProperty(DependencyObject o)
            {
                return (Dictionary<int, int>)o.GetValue(DeclarativeBehavior.MissingPropertyProperty);
            }
        }
    }
    

    XAML

    <Window x:Class="WpfApplication1.MainWindow"
            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            xmlns:local="clr-namespace:WpfApplication1"
            Title="MainWindow" Height="350" Width="525">
        <Grid>
            <!--black box, which supports imperative calls is extended to support declarative calls too-->
            <local:Imperative local:DeclarativeBehavior.MissingProperty="{Binding MyValues, 
                RelativeSource={RelativeSource AncestorType={x:Type Window}}}" />
        </Grid>
    </Window>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I would like to count the length of a string with PHP. The string
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
I want use html5's new tag to play a wav file (currently only supported

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.