Only if you are interested in seeing some sample data in Blend
(or VS designer) for WPF and SL applications. The default will return
null. The problem used to be that you would get errors in blend as objects
were instantiated and trying to connect to application server.
Sergey Barskiy
Principal Consultant
office: 678.405.0687 |
mobile: 404.388.1899
Magenic ®
Microsoft Worldwide Partner of the Year | Custom
Development Solutions, Technical Innovation
From: ajj3085
[mailto:cslanet@lhotka.net]
Sent: Wednesday, October 29, 2008 1:27 PM
To: Sergey Barskiy
Subject: Re: [CSLA .NET] Wpf & Csla
Also, I noticed this code:
private Csla.Server.DataPortalResult CreateDesignTimeObject(Type objectType, object criteria,
Csla.Server.DataPortalContext context)
{
var obj = Activator.CreateInstance(objectType, true);
object returnValue
= null;
returnValue = MethodCaller.CallMethodIfImplemented(obj,
"DesignTime_Create");
return new
Csla.Server.DataPortalResult(returnValue);
}
Does this mean that our BO's should implement DesignTime_Create to provide
better designer support?
You should get some sample data. I verrifed this in Blend,
and I was able to see the data given that I overrode design_create method.
There is actually a demo project (WpfDesignTimeSupportDemo) that I used for
testing in WPF. Maybe you can loot and see what the differences are
between your implementation and sample implementation.
Sergey Barskiy
Principal Consultant
office: 678.405.0687 |
mobile: 404.388.1899
Microsoft Worldwide Partner of the Year | Custom
Development Solutions, Technical Innovation
From: ajj3085
[mailto:cslanet@lhotka.net]
Sent: Wednesday, October 29, 2008 2:56 PM
To: Sergey Barskiy
Subject: Re: [CSLA .NET] RE: Wpf & Csla
Hmm.. I'm not getting any sample data back, but I seem to
not be crashing anymore due to some checks I've added.
Yes, it does have to return design-time object. It does
not have to return “this”, you could use some kind of factory
instead. You can probably use design time flag to bypass some other run
time functionality as well.
Sergey Barskiy
Principal Consultant
office: 678.405.0687 |
mobile: 404.388.1899
Microsoft Worldwide Partner of the Year | Custom
Development Solutions, Technical Innovation
From: ajj3085
[mailto:cslanet@lhotka.net]
Sent: Wednesday, October 29, 2008 3:24 PM
To: Sergey Barskiy
Subject: Re: [CSLA .NET] RE: RE: Wpf & Csla
Does DesignTime_Create have to return this? I have it
as a void method.
Mine is a little more complex... I try to follow the same data access patterns
I usaually would and have calls to DataPortal.ChildFetch. Would that
screw things up?
Weird that this does not work – unless VS designer works differently
from Blend. You can try to attach debugger to blend and see if your
design time code gets hist. This will at least narrow down problem
areas. If you have data providers with initial load enabled, data portal
will try to call fetch, but it should design time proxy currently, thus
bypassing normal portal operations.
Sergey Barskiy
Principal Consultant
office: 678.405.0687 |
mobile: 404.388.1899
Microsoft Worldwide Partner of the Year | Custom
Development Solutions, Technical Innovation
From: ajj3085
[mailto:cslanet@lhotka.net]
Sent: Wednesday, October 29, 2008 4:10 PM
To: Sergey Barskiy
Subject: Re: [CSLA .NET] RE: RE: RE: Wpf & Csla
Hmm... still no joy. Not a huge deal. I'm more
concerned if there are any well known gotacha's when coding for Wpf using
Csla... like specifically what code might get run if you follow the pattern in
the Wpf sample.
Copyright (c) Marimer LLC