Prism and Navigation in SL

Topics: Prism v2 - Silverlight 2, Prism v2 - Silverlight 3
Nov 3, 2009 at 3:27 PM

Is there an article on using CompositeCommands in Prism? I noticed it is being used in one of the blog posts on integrating Prism with SL navigation. Also, is there a step by step explanation on how to integrate the SL 3 navigation with Prism?

 

Thanks

Nov 3, 2009 at 10:11 PM
Edited Nov 3, 2009 at 10:11 PM

Hi Bilal,

You can read about Composite Commands in the following articles from the Prism documentation:

Also the Commanding Quickstart uses a Composite Command.

As for using Prism with Silverlight 3 Navigation you should take into account that there are some limitations explained in this blog post.

Please let me know if this helps.

Damian Schenkelman
http://blogs.southworks.net/dschenkelman

Nov 4, 2009 at 10:18 AM
Edited Nov 4, 2009 at 10:39 AM

Hello Damian,

Thanks for replying back.

 

Regarding the Prism integration with Navigation in SL, I have few questions to the Mariano who wrote the blog post:

1. ItemsControlAdapter: Inside the ItemsControlRegionAdapter, there is a checking on the "regionTarget.ItemsSource != null to through an exception". Does setting the "Items" property has no effect on the "ItemsSource"? as I know, ItemsSource says where to bring the data while Datacontext says what is the data and Items has the list of data records.

<ItemsControl cal:RegionManager.RegionName="LinkRegion" HorizontalAlignment="Center" VerticalAlignment="Top">
                        <ItemsControl.ItemsPanel>
                            <ItemsPanelTemplate>
                                <StackPanel Orientation="Horizontal"/>
                            </ItemsPanelTemplate>
                        </ItemsControl.ItemsPanel>
                        <ItemsControl.Items>
                            <HyperlinkButton Content="Home" Tag="Home"
                                             cmd:Click.Command="{Binding NavigateCommand}"
                                             cmd:Click.CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Tag}" />
                        </ItemsControl.Items>
                    </ItemsControl>

2. In the Shell.xaml.cs, the following code didn;t know why we need it:

private void MainFrame_Navigated(object sender, NavigationEventArgs e)
        {
            // This logic is placed in code-behind instead of a presenter
            // for the ease of demonstrating module navigation.
            if (e.Content != null)
            {
                this.container.BuildUp(e.Content.GetType(), e.Content);
            }
        }

3. LoadModule("modulename") method loads a module only once. So, if the module is already loaded, Prism doesn't load it again. However, when "ModuleLoad" is called and no module is initialized, how is the Prism calling the Initialize method of the already loaded module? I tried to follow the code and couldnt find it.

Thank  you,
Regards

Nov 9, 2009 at 8:47 AM

Any help on my questions?

 

Thanks

Nov 19, 2009 at 6:30 PM

Here is a post where I cover using Prism and SL Navigation. It supports dynamic loading of modules and doesn't require more than one page to process the navigation requests.

http://csharperimage.jeremylikness.com/2009/11/dynamic-module-loading-with-silverlight.html

Jeremy