Print Page | Close Window

Design Time Data

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2010
Forum Discription: For .NET 4.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=1773
Printed Date: 21-Apr-2026 at 10:33pm


Topic: Design Time Data
Posted By: mikedfox
Subject: Design Time Data
Date Posted: 29-Apr-2010 at 8:46am
I am using a library which allows for separate services to be called at runtime and design time. This allows me to have my view model return design time data, so that in the designer and blend I can see sample data.
 
Unfortunately, I'm not sure how to make this work with ideablade. At design time, how do I create a dummy object? Anything referencing an EntityManager breaks with
 

Object reference not set to an instance of an object.

at IdeaBlade.Core.IdeaBladeConfig.GetDefaultInstanceForEnvironment() at IdeaBlade.Core.IdeaBladeConfig.InitializeFromSource() at IdeaBlade.Core.IdeaBladeConfig.Initialize() at IdeaBlade.Core.IdeaBladeConfig.get_Instance() at IdeaBlade.Core.IdeaBladeConfig.AssertNonDefaultVersion(Boolean throwIfDefault) at IdeaBlade.EntityModel.EntityManager..ctor(Boolean shouldConnect, String dataSourceExtension, EntityServiceOption entityServiceOption) at IdeaBlade.EntityModel.EntityManager..ctor(Boolean shouldConnect) at DataModel.PowerBillEntityManager..ctor(Boolean shouldConnect) in C:\Documents and Settings\foxm1\My Documents\Visual Studio 10\Projects\SilverlightApplication1\DataModel\PowerBillData.IB.Designer.cs:line 37 at DataModel.State.CreateDesignTime() in C:\Documents and Settings\foxm1\My Documents\Visual Studio 10\Projects\SilverlightApplication1\DataModel\State.cs:line 42 at SilverlightApplication1.Services.DesignTimeDataService.GetStates(ObservableCollection`1 stateList) in C:\Documents and Settings\foxm1\My Documents\Visual Studio 10\Projects\SilverlightApplication1\SilverlightApplication1\Services\DesignTime\DesignTimeDataService.cs:line 35 at SilverlightApplication1.ViewModels.HomeViewModel.GetData() in C:\Documents and Settings\foxm1\My Documents\Visual Studio 10\Projects\SilverlightApplication1\SilverlightApplication1\ViewModels\HomeViewModel.cs:line 68 at SilverlightApplication1.ViewModels.HomeViewModel.OnServicesInjectedOverride() in C:\Documents and Settings\foxm1\My Documents\Visual Studio 10\Projects\SilverlightApplication1\SilverlightApplication1\ViewModels\HomeViewModel.cs:line 57 at MEFedMVVM.Common.BaseViewModel.OnServicesInjected() in D:\installs\MEFedMVVM\MEFedMVVM-47585\MEFedMVVMDemo\MEFedMVVM\Common\BaseViewModel.cs:line 24 at MEFedMVVM.ViewModelLocator.BasicViewModelInializer.TryInjectingServicesToVM(IViewModelMetadata vmMetaData, Object vm, Object containerContext, IEnumerable`1 dataServicesFactories) in D:\installs\MEFedMVVM\MEFedMVVM-47585\MEFedMVVMDemo\MEFedMVVM\ViewModelLocator\ViewModelInializer.cs:line 75

Any ideas? I'd hate to lose the ability to see design time data.




Replies:
Posted By: WardBell
Date Posted: 29-Apr-2010 at 6:01pm
Sorry Mike. I ran into this myself and reported it. We are working on it and hope to have it fixed for our next DF 2010 release.
 
I think the problem only exists in SL; it might work in WPF but I haven't checked yet.  I know it worked in DF 2009 with WPF.
 
Regret the inconvenience. Bear with us. Thanks.


Posted By: WardBell
Date Posted: 05-Aug-2010 at 8:41pm

This issue was resolved in DF 6.0.4. You can now make the web-model assembly name different from the silverlight-model assembly name. AND YOU SHOULD.

Remember: the NAMESPACE must be the same for both SL and Web models but the ASSEMBLY NAMES can and SHOULD DIFFER.
 
If you wrote your application with a template prior to 6.0.4, you'll want to fix the assembly names by hand. This problem should "magically" disappear.
 
The new templates preserve different assembly names for the SL and Web projects.



Print Page | Close Window