Article about a WPF data matrix control

I just published an article to CodeProject called ‘Displaying a Data Matrix in WPF‘.  This one was definitely a labor of love.🙂

Enjoy!

4 Responses to Article about a WPF data matrix control

  1. Visu V says:

    Hi Josh,

    I’m a big fan of yours and i love your articles. Got inspired from you and i have written my first article in codeproject : http://www.codeproject.com/KB/WPF/WpfMenuViewModel.aspx

    appreciate your feebback and guidance.

    cheers

    Visu

  2. Wayne says:

    Hi Josh,

    I know this isn’t posted in the right place but I was wondering if you could spare a momkent to consider the following –

    I am using WPF and MVVM and I am trying to create a number of expanders containg WebBrowser controls. The html is obtained from a property in the viewmodel.

    So, I have a ListBox with a DataTemplate containing an Expander and the WebBrowser. In the ViewModel I have a List of html sections as a property.

    The problem is I need to call ‘.NavigateToString’ on the WebBrowser in each expander to get the html from the property. How can I do this using MVVM

    Cheers,

    Wayne

  3. Josh Smith says:

    Wayne,

    There are a few options. The assumption here is that the ViewModel (VM) should not have a reference to a particular UI element in the View.

    To that end, you could have the View implement an interface which is injected into the VM, and the VM calls into that interface to retrieve the HTML text.

    Or, you could have the VM expose an event that is raised when it needs the HTML text,the View listens for that event, and supplies the VM with the text via a property on the eventArg.

    Lastly, you could check out Bill Kempf’s Onyx framework, which is a clean solution to these types of issues: http://wpfonyx.codeplex.com/

    Josh

  4. Visu V says:

    I had been having issues with ViewModel when it is something like i need to call a Control.Focus() method if i need to like navigate to a control from an error grid. Was wondering how to implement it without the help of any reference of view in the viewmodel. But maybe “View implement an interface which is injected” which you mentioned can be helpful. any further inputs Josh?

    cheers

    Visu

    mywpf-visu.blogspot

%d bloggers like this: