Click here to Skip to main content
15,895,142 members
Articles / Desktop Programming / XAML

Using Silverlight 3 Navigation with Prism and On-Demand Loading

Rate me:
Please Sign up or sign in to vote.
4.93/5 (20 votes)
8 Sep 2009CPOL9 min read 112.1K   1K   53  
An article demonstrating one way of integrating Silverlight 3 Navigation with Prism 2, including on-demand loading of modules.
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProductVersion>9.0.30729</ProductVersion>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>{B8BA80BF-DFBD-4F89-AE4A-633BF1835CF2}</ProjectGuid>
    <ProjectTypeGuids>{A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
    <OutputType>Library</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>Prism.Shell</RootNamespace>
    <AssemblyName>Prism.Shell</AssemblyName>
    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
    <SilverlightApplication>true</SilverlightApplication>
    <SupportedCultures>
    </SupportedCultures>
    <XapOutputs>true</XapOutputs>
    <GenerateSilverlightManifest>true</GenerateSilverlightManifest>
    <XapFilename>Prism.Shell.xap</XapFilename>
    <SilverlightManifestTemplate>Properties\AppManifest.xml</SilverlightManifestTemplate>
    <SilverlightAppEntry>Prism.Shell.App</SilverlightAppEntry>
    <TestPageFileName>TestPage.html</TestPageFileName>
    <CreateTestPage>true</CreateTestPage>
    <ValidateXaml>true</ValidateXaml>
    <EnableOutOfBrowser>false</EnableOutOfBrowser>
    <OutOfBrowserSettingsFile>Properties\OutOfBrowserSettings.xml</OutOfBrowserSettingsFile>
    <UsePlatformExtensions>false</UsePlatformExtensions>
    <ThrowErrorsInValidation>true</ThrowErrorsInValidation>
    <LinkedServerProject>
    </LinkedServerProject>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>Bin\Debug</OutputPath>
    <DefineConstants>DEBUG;TRACE;SILVERLIGHT</DefineConstants>
    <NoStdLib>true</NoStdLib>
    <NoConfig>true</NoConfig>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>Bin\Release</OutputPath>
    <DefineConstants>TRACE;SILVERLIGHT</DefineConstants>
    <NoStdLib>true</NoStdLib>
    <NoConfig>true</NoConfig>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="Microsoft.Practices.Composite, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>..\..\..\..\..\..\..\Prism Library\Microsoft.Practices.Composite.dll</HintPath>
    </Reference>
    <Reference Include="Microsoft.Practices.Composite.Presentation, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>..\..\..\..\..\..\..\Prism Library\Microsoft.Practices.Composite.Presentation.dll</HintPath>
    </Reference>
    <Reference Include="Microsoft.Practices.Composite.UnityExtensions, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>..\..\..\..\..\..\..\Prism Library\Microsoft.Practices.Composite.UnityExtensions.dll</HintPath>
    </Reference>
    <Reference Include="Microsoft.Practices.Unity, Version=1.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>..\..\..\..\..\..\..\Prism Library\Microsoft.Practices.Unity.dll</HintPath>
    </Reference>
    <Reference Include="System.Runtime.Serialization" />
    <Reference Include="System.Windows" />
    <Reference Include="mscorlib" />
    <Reference Include="system" />
    <Reference Include="System.Core" />
    <Reference Include="System.Net" />
    <Reference Include="System.Xml" />
    <Reference Include="System.Windows.Browser" />
    <Reference Include="System.Windows.Controls" />
    <Reference Include="System.Windows.Controls.Navigation" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="App.xaml.cs">
      <DependentUpon>App.xaml</DependentUpon>
    </Compile>
    <Compile Include="Bootstrapper.cs" />
    <Page Include="ModulesCatalog.xaml">
      <SubType>Designer</SubType>
      <Generator>MSBuild:Compile</Generator>
    </Page>
    <Compile Include="Navigation\ModuleMapper.cs" />
    <Compile Include="Views\Module2.xaml.cs">
      <DependentUpon>Module2.xaml</DependentUpon>
    </Compile>
    <Compile Include="Views\Module1.xaml.cs">
      <DependentUpon>Module1.xaml</DependentUpon>
    </Compile>
    <Compile Include="Views\ErrorWindow.xaml.cs">
      <DependentUpon>ErrorWindow.xaml</DependentUpon>
    </Compile>
    <Compile Include="Views\About.xaml.cs">
      <DependentUpon>About.xaml</DependentUpon>
    </Compile>
    <Compile Include="Views\Home.xaml.cs">
      <DependentUpon>Home.xaml</DependentUpon>
    </Compile>
    <Compile Include="Shell.xaml.cs">
      <DependentUpon>Shell.xaml</DependentUpon>
    </Compile>
    <Compile Include="Properties\AssemblyInfo.cs" />
  </ItemGroup>
  <ItemGroup>
    <ApplicationDefinition Include="App.xaml">
      <Generator>MSBuild:MarkupCompilePass1</Generator>
      <SubType>Designer</SubType>
    </ApplicationDefinition>
    <Resource Include="Assets\Styles.xaml">
      <Generator>MSBuild:MarkupCompilePass1</Generator>
      <SubType>Designer</SubType>
    </Resource>
    <Page Include="Views\Module2.xaml">
      <Generator>MSBuild:MarkupCompilePass1</Generator>
      <SubType>Designer</SubType>
    </Page>
    <Page Include="Views\Module1.xaml">
      <Generator>MSBuild:MarkupCompilePass1</Generator>
      <SubType>Designer</SubType>
    </Page>
    <Page Include="Views\ErrorWindow.xaml">
      <SubType>Designer</SubType>
      <Generator>MSBuild:MarkupCompilePass1</Generator>
    </Page>
    <Page Include="Views\About.xaml">
      <SubType>Designer</SubType>
      <Generator>MSBuild:MarkupCompilePass1</Generator>
    </Page>
    <Page Include="Views\Home.xaml">
      <SubType>Designer</SubType>
      <Generator>MSBuild:MarkupCompilePass1</Generator>
    </Page>
    <Page Include="Shell.xaml">
      <Generator>MSBuild:MarkupCompilePass1</Generator>
      <SubType>Designer</SubType>
    </Page>
  </ItemGroup>
  <ItemGroup>
    <None Include="Properties\AppManifest.xml" />
  </ItemGroup>
  <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Silverlight\v3.0\Microsoft.Silverlight.CSharp.targets" />
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
       Other similar extension points exist, see Microsoft.Common.targets.
  <Target Name="BeforeBuild">
  </Target>
  <Target Name="AfterBuild">
  </Target>
  -->
  <ProjectExtensions>
    <VisualStudio>
      <FlavorProperties GUID="{A1591282-1198-4647-A2B1-27E5FF5F6F3B}">
        <SilverlightProjectProperties />
      </FlavorProperties>
    </VisualStudio>
  </ProjectExtensions>
</Project>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Web Developer
New Zealand New Zealand
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions