Editting Guidance package

Topics: CAB & Smart Client Software Factory
Oct 19, 2007 at 11:00 AM
Hi all,
I'm using the SCSF (of course), but I have a question about adding a new item in the package. In a module, you have the possibilty to add a view (either a WPF or winforms view), these views are "empty". What I want to do, is to create a "template" (based on the regular view) for a "parameter" view (wich contains a listbox, an (unboun) datasource and navigator and a few textboxes. (Since al my "edit parameter views" share the same look-and-feel, this spares me some copy&paste work).

My question : how can I do this ??

thnx in advance

Geert
Oct 19, 2007 at 9:51 PM
Edited Oct 19, 2007 at 9:52 PM
Hi

Firts you must install the source code of the GuiancePackage. Then open the GuidancePackage solution and go to the SmartClientFactoryPackage project. Navigate to the Templates\Items\View.CS folder inside the project. Replace the content of the View.Designer.cs.t4 file with the file of your design's view. For the code that you add it works fine when the recipy Add View (with Presenter) be executed, you must modify some lines:

  • Add in the top of the file the following lines:
<#@ template language="C#" #>
<#@ assembly name="System.dll" #>
<#@ property processor="PropertyProcessor" name="ClassName" #>
<#@ property processor="PropertyProcessor" name="TargetNamespace" #>
  • Change the namespace definition to this:
namespace <#= TargetNamespace #>
  • Change the declaration of the class to this:
partial class <#= ClassName #>
  • Change the declaration of the presenter in the body of the class to this:
private <#= TargetNamespace #>.<#= ClassName #>Presenter _presenter = null;
If you are using VB.NET you must make the same steps but in the View.Designer.vb.t4 file of the Templates\Items\View.VB folder of SmartClientFactoryPackage proyect.

I recommend to you to read the Architects Hands on Lab of SCSF. This Labs are for the previous version of SCSF but you can use it also in the new version.

Please let me know if this helps.

Mariano Converti
http://staff.southworks.net/blogs/mconverti/
Oct 20, 2007 at 4:21 PM
Thnx a lot for the info.....

I'll read the hands on asap

greetz

Geert