Remember A Single Set of State Across Page Instances

This sample illustrates how to remember multiple items of page state across page instances by using IProvideCustomContentState and CustomContentState. Building the Sample Install the Windows Software Development Kit (SDK) and open its build environment command window.

 
 
 
 
 
(0)
6,756 times
Add to favorites
2/1/2011
E-mail Twitter del.icio.us Digg Facebook
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProjectGuid>{9487F8D1-D7B6-4A42-99E4-2D65624CAF89}</ProjectGuid>
    <RootNamespace>IPCCSSampleCSharp</RootNamespace>
    <AssemblyName>IPCCSSampleCSharp</AssemblyName>
    <WarningLevel>4</WarningLevel>
    <OutputType>winexe</OutputType>
    <EnableSecurityDebugging>false</EnableSecurityDebugging>
    <Install>False</Install>
    <TargetZone>Internet</TargetZone>
    <StartAction>Program</StartAction>
    <StartProgram>$(WINDIR)\System32\PresentationHost.exe</StartProgram>
    <ApplicationExtension>.xbap</ApplicationExtension>
    <StartArguments>-debug "$(MSBuildProjectDirectory)\bin\$(Configuration)\$(AssemblyName)$(ApplicationExtension)"</StartArguments>
    <SignManifests>True</SignManifests>
    <MinFrameworkVersionRequired>3.0</MinFrameworkVersionRequired>
    <HostInBrowser>true</HostInBrowser>
    <InstallFrom>Web</InstallFrom>
    <MapFileExtensions>false</MapFileExtensions>
    <ApplicationVersion>1.0.0.*</ApplicationVersion>
    <IsWebBootstrapper>true</IsWebBootstrapper>
    <BootstrapperEnabled>true</BootstrapperEnabled>
    <PublishUrl>Publish\</PublishUrl>
    <ManifestKeyFile>IPCCSSampleCSharp_TemporaryKey.pfx</ManifestKeyFile>
    <ManifestCertificateThumbprint>42F999C85466F6B7B0BEC01E7749C34E61D4E8CE</ManifestCertificateThumbprint>
    <TargetFrameworkVersion>v3.0</TargetFrameworkVersion>
    <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
    <FileUpgradeFlags>
    </FileUpgradeFlags>
    <UpgradeBackupLocation>
    </UpgradeBackupLocation>
    <OldToolsVersion>3.5</OldToolsVersion>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>.\bin\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <DebugSymbols>false</DebugSymbols>
    <Optimize>true</Optimize>
    <OutputPath>.\bin\Release\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="mscorlib" />
    <Reference Include="System" />
    <Reference Include="System.Data" />
    <Reference Include="System.Xml" />
    <Reference Include="WindowsBase" />
    <Reference Include="PresentationCore" />
    <Reference Include="PresentationFramework" />
    <Reference Include="UIAutomationProvider" />
    <Reference Include="UIAutomationTypes" />
    <Reference Include="System.Printing" />
  </ItemGroup>
  <ItemGroup>
    <ApplicationDefinition Include="App.xaml">
      <Generator>MSBuild:Compile</Generator>
      <SubType>Designer</SubType>
      <Generator>MSBuild:Compile</Generator>
      <SubType>Designer</SubType>
    </ApplicationDefinition>
  </ItemGroup>
  <ItemGroup>
    <Compile Include="CustomContentState.cs" />
    <Compile Include="HomePage.xaml.cs">
      <SubType>Code</SubType>
      <DependentUpon>HomePage.xaml</DependentUpon>
    </Compile>
    <Page Include="AnotherPage.xaml">
      <Generator>MSBuild:Compile</Generator>
      <SubType>Designer</SubType>
      <Generator>MSBuild:Compile</Generator>
      <SubType>Designer</SubType>
    </Page>
    <None Include="IPCCSSampleCSharp_TemporaryKey.pfx" />
    <None Include="Properties\app.manifest" />
    <AppDesigner Include="Properties\" />
  </ItemGroup>
  <ItemGroup>
    <Page Include="HomePage.xaml">
      <Generator>MSBuild:Compile</Generator>
      <SubType>Designer</SubType>
      <Generator>MSBuild:Compile</Generator>
      <SubType>Designer</SubType>
    </Page>
  </ItemGroup>
  <ItemGroup>
    <None Include="simple.html">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </None>
  </ItemGroup>
  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
</Project>