Just in case you didn't have enough to look at with the 3.7.1 release and VB 3.6.3 release - here's more :)
CSLA .NET version 3.8.0 alpha 3 is now available.
The primary focus of version 3.8 is to enable more seamless support for the MVVM design pattern in Silverlight and WPF. The alpha 3 release brings the features I’ve been implementing in Silverlight into WPF.
Also, the samples downloads now include my MVVM experimental applications. I suppose you can call these samples, but they are really the apps I’m using to try out different ideas – so they aren’t what I’d consider a “full sample”. Still, you can see how the various new features work, and how the MVVM features allow creation of at least a basic CRUD UI (with some navigation) with no code-behind any XAML.
Please note that version 3.8 requires System.Windows.Interactivity.dll to build. This assembly is installed with Expression Blend 3, or the Blend 3 SDK. You must install at least the SDK before you can build CSLA .NET 3.8.0.
The new features (now in Silverlight and WPF) include:
Please give these new features a try and let me know your thoughts.
Rocky,
I'm plugging in the ViewModel<T> as child ViewModels in my pre-exisiting UI ViewModel. I'm going to expose them as DataXyz depending on how many I end up using.
When I trigger a save I need to know that all the children have saved okay or do something specific post save.
Anyhow I need to subscribe to the Saved event which right now is only available by copying what you do in the ViewModelBase of (Model as ISaveable).Saved. Would it not make sense to expose a Saved event in the ViewModel that you can trigger via OnSaved in the ViewModelBase.
Thanks
jack
That is a good point. You could see that Model or Error changed - but that'd be awkward too.
I wonder if ViewModelBase shouldn't have a protected virtual OnSaved() that you can override to do any post-processing. If you want a public Saved method you could implement one, but if you just wanted your viewmodel to alter some properties (and thus indirectly the UI) you could do that too.
So you could do this:
protected override void OnSaved()
{
if (Error != null)
// handle exception
else
// handle new Model
}
Does this seem like a good plan?
Works perfectly for me.
From: RockfordLhotka [mailto:cslanet@lhotka.net]
Sent: October-05-09 3:06 PM
To: jaddington@alexandergracie.com
Subject: Re: [CSLA .NET] RE: CSLA .NET 3.8.0 Beta 1
That is a good point. You could see that Model or Error changed - but that'd
be awkward too.
I wonder if ViewModelBase shouldn't have a protected virtual OnSaved() that
you can override to do any post-processing. If you want a public Saved method
you could implement one, but if you just wanted your viewmodel to alter some
properties (and thus indirectly the UI) you could do that too.
So you could do this:
protected override void OnSaved()
{
if (Error != null)
// handle exception
else
// handle new Model
}
Does this seem like a good plan?
Good, I’ll make it happen then.
Rocky,
I do not get or see how the CanSave is ever set to true.
The SetProperties is not really attached to very much. Should it not fire
when a property in the model changes or something?
I must be missing something... I thought I was getting a
lot of the plumbing from the DataProvider.
thanks
jack
From: Rockford Lhotka [mailto:cslanet@lhotka.net]
Sent: October-05-09 3:56 PM
To: jaddington@alexandergracie.com
Subject: RE: [CSLA .NET] RE: CSLA .NET 3.8.0 Beta 1
Good, I’ll make it happen then.
This is a beta, and so there could very easily be bugs - which is why I'm so happy you are working with it! :)
This is ViewModel<T> you are using?
Yes.
I hooked up a save button with IsEnabled = MyUIModel.CanSave
(SomeLogic && ViewModel<abc>.CanSave). It never enables or
updates.
I was expecting something to be connected to IsDirty etc.
thanks
From: RockfordLhotka [mailto:cslanet@lhotka.net]
Sent: October-07-09 7:28 AM
To: jaddington@alexandergracie.com
Subject: Re: [CSLA .NET] RE: RE: CSLA .NET 3.8.0 Beta 1
This is a beta, and so there could very easily be bugs - which is why I'm so
happy you are working with it! :)
This is ViewModel<T> you are using?
If IsBusy then CanSave and CanCancel should be false
From: Jack Addington [mailto:cslanet@lhotka.net]
Sent: October-07-09 7:36 AM
To: jaddington@alexandergracie.com
Subject: RE: [CSLA .NET] RE: RE: CSLA .NET 3.8.0 Beta 1
Yes.
I hooked up a save button with IsEnabled = MyUIModel.CanSave
(SomeLogic && ViewModel<abc>.CanSave). It never enables or
updates.
I was expecting something to be connected to IsDirty etc.
thanks
From: RockfordLhotka [mailto:cslanet@lhotka.net]
Sent: October-07-09 7:28 AM
To: jaddington@alexandergracie.com
Subject: Re: [CSLA .NET] RE: RE: CSLA .NET 3.8.0 Beta 1
This is a beta, and so there could very easily be bugs - which is why I'm so
happy you are working with it! :)
This is ViewModel<T> you are using?
sergeyb:On the same OnSaved note, I think it would be nice to also have OnRefreshed as well. Reason being is that it would be nice to have a spot to plug in error handling during Refresh call. Thanks.
Yes, very good idea!
Should there be an OnXyz for any other? OnCancelled, etc
Also would it be useful nice to be able to force a SetProperties
call?
From: RockfordLhotka [mailto:cslanet@lhotka.net]
Sent: October-07-09 8:31 AM
To: jaddington@alexandergracie.com
Subject: Re: [CSLA .NET] RE: RE: RE: CSLA .NET 3.8.0 Beta 1
sergeyb:
On the same OnSaved note, I think it would be nice to also have OnRefreshed as well. Reason being is that it would be nice to have a spot to plug in error handling during Refresh call. Thanks.
Yes, very good idea!
I don't understand what you are looking for then?
If I create DoRefresh(string factoryMethodName) as an overload you still can't pass your null?
Right now I can call DoRefresh() in several ways:
DoRefresh("NewCustomerEdit");
DoRefresh("GetCustomerEdit", 123);
DoRefresh("GetCustomerList", "Ander*", DateTime.Now);
and so forth.
What kind of call are you hoping to achieve that isn't currently covered?
Unless I'm in the wrong spot I can't get to it. I know I've
done it before...
http://www.lhotka.net/cslacvs/viewvc.cgi/trunk/
An Exception Has Occurred
trunk:
unknown location
HTTP
Response Status
404
Not Found
Python
Traceback
Traceback
(most recent call last):
File "C:\Program Files\viewvc-1.0.0\lib\viewvc.py", line 3629, in
main
request.run_viewvc()
File "C:\Program Files\viewvc-1.0.0\lib\viewvc.py", line 314, in
run_viewvc
% self.where, '404 Not Found')
ViewVCException:
404 Not Found: trunk: unknown location
From: RockfordLhotka [mailto:cslanet@lhotka.net]
Sent: October-08-09 11:32 PM
To: jaddington@alexandergracie.com
Subject: Re: [CSLA .NET] RE: RE: RE: RE: CSLA .NET 3.8.0 Beta 1
Sergey and Jack, if you have the capability you should
probably be grabbing the code out of svn directly. I've addressed some of the
issues you've brought up, and will address more as time permits. I really
appreciate your feedback - this is very useful!
I rearranged the svn repository last week. The new /trunk URL is
Rocky,
I had a question about the chaining of CSLADataProviders for
parent/child and what the real use case of this is. Is it basically just
so you can databind to the child dp in lieu of the parent instead of using dot
notation? Can you provide a basic example where this would benefit
a developer? I have lots of UOW type base objects with
EditableChildLists. I'm just trying to see where this would benefit me.
Moving further from that is where does the DataProvider fit with
the ViewModel? Does it fit in anymore? Or is the fact we can do all
that in simple code in the ViewModel mean we don't need it (my assumption).
From: RockfordLhotka [mailto:cslanet@lhotka.net]
Sent: October-08-09 11:32 PM
To: jaddington@alexandergracie.com
Subject: Re: [CSLA .NET] RE: RE: RE: RE: CSLA .NET 3.8.0 Beta 1
Sergey and Jack, if you have the capability you should
probably be grabbing the code out of svn directly. I've addressed some of the
issues you've brought up, and will address more as time permits. I really
appreciate your feedback - this is very useful!
Jack:I hooked up a save button with IsEnabled = MyUIModel.CanSave (SomeLogic && ViewModel<abc>.CanSave). It never enables or updates.
That sounds like a bug, I'll look into it.
Rocky,
Have you tried databinding to the Model property? Say in a
MainView with a few childViews.
<MyLib.SomeChildView x:Name="ChildViewABC"
Model="{Binding Path=ChildViewABCModel}" />
Is that a supported feature?
thanks
jack
From: Jack Addington
[mailto:jaddington@alexandergracie.com]
Sent: October-07-09 7:36 AM
To: 'cslanet@lhotka.net'
Subject: RE: [CSLA .NET] RE: RE: CSLA .NET 3.8.0 Beta 1
Yes.
I hooked up a save button with IsEnabled = MyUIModel.CanSave
(SomeLogic && ViewModel<abc>.CanSave). It never enables or
updates.
I was expecting something to be connected to IsDirty etc.
thanks
From: RockfordLhotka [mailto:cslanet@lhotka.net]
Sent: October-07-09 7:28 AM
To: jaddington@alexandergracie.com
Subject: Re: [CSLA .NET] RE: RE: CSLA .NET 3.8.0 Beta 1
This is a beta, and so there could very easily be bugs - which is why I'm so
happy you are working with it! :)
This is ViewModel<T> you are using?
Hi Rocky,
do you plan to release an eBook/Video in the next couple months on the new features as an update to the 2008 book?
Regards Luzius
Yes, I am working on a video series for 3.8.
The planned structure for the video series is in two parts.
There’s the “core series” which is a 6 part set covering object
design, data access, the data portal, security and so forth. Things that are
common to any interface type. My plan is to sell this core series as a unit.
Then there’ll be interface-specific videos for WPF, ASP.NET MVC,
etc. Those will be sold individually, but will assume you’ve seen the core
series first.
Copyright (c) Marimer LLC