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>
    <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{F184B08F-C81C-45F6-A57F-5ABD9991F28F}</ProjectTypeGuids>
    <RootNamespace>IPCCSSampleVB</RootNamespace>
    <AssemblyName>IPCCSSampleVB</AssemblyName>
    <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>IPCCSSampleVB_TemporaryKey.pfx</ManifestKeyFile>
    <ManifestCertificateThumbprint>B1CBC5412E4D7E84D7BB8A8AD9AC97C15BA23D54</ManifestCertificateThumbprint>
    <ProjectGuid>{27202613-18DF-469F-9B2C-7A015DF4E1D1}</ProjectGuid>
    <TargetFrameworkVersion>v3.0</TargetFrameworkVersion>
    <FileUpgradeFlags>
    </FileUpgradeFlags>
    <UpgradeBackupLocation>
    </UpgradeBackupLocation>
    <OldToolsVersion>3.5</OldToolsVersion>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <DefineDebug>true</DefineDebug>
    <DefineTrace>true</DefineTrace>
    <IncrementalBuild>true</IncrementalBuild>
    <OutputPath>.\bin\Debug\</OutputPath>
    <DocumentationFile>IPCCSSampleVB.xml</DocumentationFile>
    <NoWarn>42016,42017,42018,42019,42032,42314,42353,42354,42355</NoWarn>
    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <DebugSymbols>false</DebugSymbols>
    <DefineDebug>false</DefineDebug>
    <DefineTrace>true</DefineTrace>
    <IncrementalBuild>false</IncrementalBuild>
    <Optimize>true</Optimize>
    <OutputPath>.\bin\Release\</OutputPath>
    <DocumentationFile>IPCCSSampleVB.xml</DocumentationFile>
    <NoWarn>42016,42017,42018,42019,42032,42314,42353,42354,42355</NoWarn>
    <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>
    <None Include="Readme.txt" />
  </ItemGroup>
  <ItemGroup>
    <Import Include="Microsoft.VisualBasic" />
    <Import Include="System" />
    <Import Include="System.Collections" />
    <Import Include="System.Collections.Generic" />
    <Import Include="System.Diagnostics" />
    <Import Include="System.Windows" />
    <Import Include="System.Windows.Controls" />
    <Import Include="System.Windows.Data" />
    <Import Include="System.Windows.Documents" />
    <Import Include="System.Windows.Input" />
    <Import Include="System.Windows.Shapes" />
    <Import Include="System.Windows.Media" />
    <Import Include="System.Windows.Media.Imaging" />
    <Import Include="System.Windows.Navigation" />
    <Import Include="System.Windows.Shapes" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="HomePage.xaml.vb">
      <SubType>Code</SubType>
      <DependentUpon>HomePage.xaml</DependentUpon>
    </Compile>
    <Compile Include="CustomContentState.vb" />
    <None Include="IPCCSSampleVB_TemporaryKey.pfx" />
    <None Include="My Project\app.manifest" />
    <AppDesigner Include="My Project\" />
  </ItemGroup>
  <ItemGroup>
    <Page Include="AnotherPage.xaml">
      <Generator>MSBuild:Compile</Generator>
      <SubType>Designer</SubType>
      <Generator>MSBuild:Compile</Generator>
      <SubType>Designer</SubType>
    </Page>
    <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.VisualBasic.targets" />
</Project>