Archive for the 'CWPF' Category

PRISM @ CodeCamp Buenos Aires 2009

This post announces an event being held at Buenos Aires, Argentina.

CodeCamp Buenos Aires 2009

 

On September 26th, a new CodeCamp will take place at Buenos Aires. This year, I will join my teammate Diego Poza and together we will talk about how to develop composite applications for WPF & Silverlight using PRISM. Our presentation starts at 4:15 PM and will last 1 hour.

 

During the presentation we will go over PRISM Core Concepts and show a real-world implementation. Don’t miss the surprises at the end of the session.

Desarrollando aplicaciones modulares en WPF y Silverlight con Prism

On a related topic, Southworks is one of the sponsors of the event and several other southies will be presenting as well:

  • Matias and Johnny will be presenting about Mega Datacenters with Windows Azure. Johnny will also join Zaiden and together they will present about VS 2010 and C# 4.0
  • Martin Salias will be in functional mode explaining the main advantages of F#.
  • Nico Paez will be talking about open source tools for .NET
  • Beto, our IT Pro, will be off the charts. He will present in four sessions talking about Hyper-V, Windows Server 2008 R2 and SSME (SCOM, SCVMM, SCDPM).

Are you going to miss this amazing event? Register Now!

Where: Universidad de Palermo, Mario Bravo 1050, Buenos Aires

Time: From 9:30 AM to 19:00 PM

See you in the event and in the Southworks booth.

Prism v2: Migrating from Drop 9 to Drop 10

As you may know, last Friday a new drop of the Composite Application Guidance for WPF & Silverlight was released.

As Erwin said in this post, one of the breaking changes of this new drop is that they removed the .Silverlight and .Desktop extensions from the Assembly names. If you are like me and have more than one solution using Prism v2 with a bunch of projects, you will probably find really annoying going over each project to update the references and the xaml files.

So, in order to accomplish this, I created a Powershell script that will look for all the .csproj and .xaml that contain references to the old prism assemblies and will update it to the new version of them.

Note: If you have your code in TFS, make sure to go offline before running the script, so when you go back online it will detect the changes.

Disclaimer

This code is provided “AS IS” with no warranties, and confers no rights.

Download

You can find the script here.

 

Hope you find it useful.

CompositeWPF (Prism) Contrib Latest Additions (2008-10-26)

These are the latest extensions added to the CompositeWPF Contrib community project:

Download

You can get these extensions, among others, by downloading latest change set of the CompositeWPF Contrib source control.

Where I can find the documentation of the extensions added to the project?

To check the documentation of the extensions added so far, please visit the Documentation page in the community site.

 

Enjoy!

New Samples in CompositeWPF (Prism) Contrib (2008-09-13)

Four new samples has been added to the CompositeWPF Contrib community project:

Download

You can get these samples, among others extensions, by downloading latest change set of the CompositeWPF Contrib source control.

Coming soon

Some people has been asking for an OutlookBar sample. The good news is that Damian Schenkelman and me are working on it, so stay tuned, we will publish it soon.

Interested in migrating from Composite Application Block (CAB) to CompositeWPF (Prism)? Check our new guidance

As Diego Poza announced in his post, we have just published a new guidance to help CAB developers familiarize themselves with the Composite Application Guidance by comparing the main components of both libraries.

Let’s take a look at the guidance content index:

image

Because the Composite UI Application Block and the Composite Application Guidance are targeted to build composite applications, they have similar core concepts. These core concepts have different implementations. The following figure compares the implementation of the core concepts.
 image

Want more?

Download the Composite Application Guidance for Composite UI Application Block Developers from Codeplex.

Feedback

We really want your feedback on this guidance, so feel free to give us your feedback on the discussion board.

Enjoy!

Silverlight & Composite Application Guidance (Prism): Spike published

Weeks ago we shipped the Composite Application Guidance for WPF and with the Prism team we started to spike around the migration of the Composite Application Library to Silverlight 2 Beta 2. The good news is that yesterday we published that spike. (A ’spike’ is a small and quickly developed sample application in order to mitigate some risks).

After downloading and decompressing the latest change set of the source control, you will find a new folder named spikes that contains the Composite Application Library migrated to Silverlight. As you may imagine, there were many challenges that we had to address in order to make it “work”  (Rob Eisenberg wrote two articles describing differences between WPF and Silverlight that you might want to check: There’s some darkness in your silver light and Silverlight Problems That Affect Me).

Note: The migration is not complete, we used the spike to have a perspective of the challenges.

 

Modularity

Module loading in Silverlight is very different from WPF, so this was a challenge. We continued spiking on different approaches, but those spikes are not uploaded to Codeplex yet.

Regarding the module enumerators, System.Configuration is not supported by Silverlight current version, so we are using a new XML file module enumerator (not published either).

Regions

In WPF, the RegionManager attached property value gets inherited by the elements in the visual tree. This cannot be done in Silverlight due to the lack of the FrameworkPropertyMetadataOptions.Inherits option. However, we have found a workaround for this issue.

If you want to declare regions in XAML, you have to create an application resource to store the RegionManager instance, so it can be used by the views. This can be done in the Bootstrapper, as shown in the code below:

protected override void ConfigureContainer()
{
   base.ConfigureContainer(); IRegionManager regionManager = Container.Resolve<IRegionManager>();
   Application.Current.Resources.Add(“RegionManager”, regionManager);
}

And the view has to explicitly set the RegionManager attached property to the resource created previously.

<ItemsControl x:Name=”MainRegionControl” cal:RegionManager.RegionName=”MainRegion” cal:RegionManager.RegionManager=”{StaticResource RegionManager}” />

Events

Events has been migrated successfully, however, the unit tests are still a challenge because of the differences in threading between Silverlight and WPF. One difference we found, is that if you are subscribing to an event using weak references, for this reason you can only use public methods as delegates (lambdas, anonymous delegates or private methods won’t work) because of security restrictions enforced by Silverlight.

Commands

As you might know, the support for commands is missing in Silverlight. This is really bad news, considering that big part of our guidance talk about using Commands for communication between the modules and from the view.

I’m not going into deep details on this because Julian Dominguez published a great post explaining how to use commands in Silverlight.

Download

You can get the spike by downloading the latest change set of the CompositeWPF source control.

Notes

  • We didn’t ship the Unity Application Block, so I recommend you to see Michael Sync’s post in order to have Unity working on Silverlight.
  • In order to run the Unit tests, check Jeff Wilcox’post.

Feedback  / Contributions

Feel free to give us your feedback on the discussion board. If you want to contribute with the CompositeWPF project, check the CompositeWPF contrib. community site.

Enjoy!

CompositeWPF (Prism) Contrib Latest Additions (2008-07-26)

These are the latest extensions added to the CompositeWPF Contrib community project:

  • Extended Module Loader Service (contributed by Willem Meints). The extended module loader service can be used to load modules on demand. When the module loader service loads a module it will check if the module being loaded is actually installed and install it from the original installation source.
  • Module Status Service (contributed by Willem Meints). The module status service can be used to retrieve a list of modules and their status (loaded or unloaded). This is particular useful when you want to show the user of your CompositeWPF application what modules are available to the application and which modules are actually active at this moment. image
    For more information about this service, see Module status service for CompositeWPF.
  • OutlookBar control and region adapter.
     
    For more information about this control, see Use the OutlookBar in your CompositeWPF (Prism) Applications.
Where I can find the documentation of the extensions added to the project?

To check the documentation of the extensions added so far, please visit the Documentation page in the community site.

To learn more about other additions to the project, see this post.

Enjoy!

Use the OutlookBar in your CompositeWPF (Prism) Applications

Two years ago, together with Matias Woloski we wrote the Outlook Bar for the Composite Application Block (CAB). I can say that it was a popular workspace, with more than 19,000 downloads!. Now that we shipped CompositeWPF (Prism), some people at the CompositeWPF community started asking for the OutlookBar for CompositeWPF, so Julian Dominguez, Matias Woloski and me decided to spend some time and create the Composite WPF version.

clip_image001

 

Usage

First of all, you have to register the region adapter mapping in the Bootstrapper as shown in the code below:

protected override RegionAdapterMappings ConfigureRegionAdapterMappings()
{
    IEventAggregator eventAggregator = Container.Resolve<IEventAggregator>();

    RegionAdapterMappings mappings = base.ConfigureRegionAdapterMappings();

    mappings.RegisterMapping(typeof(OutlookBarControl), new OutlookBarControlRegionAdapter(eventAggregator));

    return mappings;
}

Now you can add the OutlookBarControl to your Shell/View XAML (you have to declare the namespace on the top of the file):

<Controls:OutlookBarControl 
       cal:RegionManager.RegionName="{x:Static infrastructure:RegionNames.OutlookBarRegion}"/>
                
To add views, just obtain the region and call the Add method as you do with other regions: 

IRegionManager regionManager = Container.Resolve<IRegionManager>();
MyView view = new MyView();
OutlookBarControl.SetOutlookBarMetadata(view, new OutlookBarMetadata
    {
        Title = "Mail",
        Payload = "MyPayload"
    });

regionManager.Regions[RegionNames.OutlookBarRegion].Add(view);
regionManager.Regions[RegionNames.OutlookBarRegion].Activate(view);

As you may noticed, in the preceding code we are also setting the OutlookBarMetadata attached property to the view. This attached property is used by the control template and by the OutlookBarControlRegionAdapter.

  • In the control template we are using the Title property in the OutlookBarControl header and in the buttons.
  • In the region adapter we are using the payload to publish the OutlookBarEvent. This event is published every time you select a view.

The OutlookBarMetadata serves a similar purpose the OutlookBarSmartPartInfo served in the CAB version.

Disclaimer

This code is provided "AS IS" with no warranties, and confers no rights.

Acknowledgments

The control template is based on this article on CodeProject.

Download

You can get the OutlookBar by downloading the latest change set of the CompositeWPF Contrib source control.

 

Stay tuned, we are working on v1.1 of the OutlookBar.

Composite Application Guidance for WPF Visual Studio Templates

As you may know, in the June 2008 release of the Composite Application Guidance for WPF we are not shipping a guidance package. So, I created two Visual Studio Templates to help you to start with the creation of a solution using the Composite Application Guidance for WPF.

clip_image002[4]

You will get two kind of solution/project templates

image

After creating a solution using the templates, you must create in the folder where solution its located a folder named Library and copy to it the following assemblies (otherwise the solution created is not going to compile):

  • Microsoft.Practices.Composite.dll
  • Microsoft.Practices.Composite.Wpf.dll
  • Microsoft.Practices.Composite.UnityExtensions.dll
  • Microsoft.Practices.Unity.dll
  • Microsoft.Practices.ObjectBuilder2.dll

Download the Composite Application Guidance for WPF templates (zip file with a VSI inside)

Any feedback is welcome. Enjoy!

Composite Application Guidance for WPF (Prism) June 2008 Released

I’m proud to announce that we have just released the Composite Application Guidance for WPF. I want to thank to the Composite WPF Team. It was really great being part of this release.

Let’s see what this release is about.

 

What is Composite Application Guidance for WPF?

The Composite Application Guidance for WPF is a set of guidance designed to help you more easily manage the complexities you may face when building enterprise-level Windows Presentation Foundation (WPF) client applications. This guidance will help you design and build flexible WPF client applications using loosely coupled, independently evolvable pieces that work together and are integrated into the overall application.

For more information, see Composite Application Guidance - What is it?.

 

What is in this release?
Downloads
Documentation
Getting Started / Installation Instructions
Community Site

To give feedback, get assistance or download additional content please visit our community site.

Contributions

If you want to contribute with this project, please visit our contrib community site.

Knowledge Base

We have created a Knowledge Base to categorize and organize blogs posts, CodePlex pages, CodePlex posts, etc that can be valuable for the community.

Known Issues

In this page you will find the list of known issues of the Composite Application Guidance for WPF.

Feedback

Feel free to give us your feedback on the discussion board. If you see issues, please post them to the Issue Tracker.

 

For more information of this new release, see Composite Application Guidance is Live.

Enjoy this new release.

Next Page »