I'm using CSLA 3.8.3 in a VS 2008 WPF app. Actually, it's a WinForms app that is hosting a WPF UserControl, but I doubt (or at least hope) that this makes a difference for my question.
This particular UserControl has the outside container's DataContext set to a CslaDataProvider that points to a top-level single parent, with children and grandchildren and great-grandchildren (...).
Here's my issue: When I add a new child using AddNew(), the VS outpout window shows a bunch of binding errors indicating that properties don't exist. It doesn' appear to affect anything, because once the process is finished, the new item shows up and everything's fine. But I don't like seeing the errors, and I'm worried that they are affecting the speed of adding a new item, which takes a few seconds longer than I would have thought it should.
I was hoping that if I wrapped the call to AddNew() with a "using _dp.DeferRefresh", it would eliminate the binding error messages, but it doesn't. So I'm thinking that perhaps the DeferRefresh needs to be called for the child list, which doesn't have its own CslaDataProvider.
So here's my questions:
Thanks for any help!
I don't think the data provider model has a bright future in WPF. You might consider using an MVVM approach with ViewModel<T> viewmodel objects instead of data providers.
In that case you might use a viewmodel for each list, or even each item in each list. Anywhere you need to add verbs/commands to your model, you would use a viewmodel.
Thanks for the reply, I think . Man, I'm just now moving from WinForms to WPF, and you want me to learn something else new at the same time? What do you think I am, a software developer or something?
Seriously, thanks for the information. I just wish the target would stand still long enough to hit it, you know what I mean? (Of course you do -- these things impact you way more than they do me...)
OK, I give. Where can I find information on using CSLA's ViewModel<T>? I'm not talking about abstract concepts like MVVM, but the specifics of using CSLA's ViewModel<T>. I searched this site (perhaps not very well, but as well as I could) for information, and didn't find a whole lot. I looked at MVVMexperiment, and while having examples is nice, it doesn't really explain anything. And "ViewModel" is not in the index of your book (again, I could be blind - in fact, my wife swears I am).
So what do I need to know about ViewModel<T>, and how do I use it? I suppose I can just plug away and code, and see what happens (in fact, I will indeed do that), but I like it a lot better when I've got some idea of what I'm doing before I start doing it. Call me silly...
Edit: I'd at least like to know why using a ViewModel<T> will help me over a CslaDataProvider. In other words, how are they different?
Copyright (c) Marimer LLC