Click here to Skip to main content
15,885,895 members
Articles / Programming Languages / C#

Creating Actionlinks in a Silverlight RichTextBox

Rate me:
Please Sign up or sign in to vote.
4.92/5 (5 votes)
28 Mar 2010CPOL6 min read 51.4K   914   18  
Extending the Silverlight RichTextBox so that it supports interactive text
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProductVersion>8.0.50727</ProductVersion>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>{52F76969-E7CD-414F-8E98-4FF90EE48B05}</ProjectGuid>
    <ProjectTypeGuids>{A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
    <OutputType>Library</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>RichNotepad</RootNamespace>
    <AssemblyName>RichNotepad</AssemblyName>
    <TargetFrameworkIdentifier>Silverlight</TargetFrameworkIdentifier>
    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
    <SilverlightVersion>$(TargetFrameworkVersion)</SilverlightVersion>
    <SilverlightApplication>true</SilverlightApplication>
    <SupportedCultures>
    </SupportedCultures>
    <XapOutputs>true</XapOutputs>
    <GenerateSilverlightManifest>true</GenerateSilverlightManifest>
    <XapFilename>RichNotepad.xap</XapFilename>
    <SilverlightManifestTemplate>Properties\AppManifest.xml</SilverlightManifestTemplate>
    <SilverlightAppEntry>RichNotepad.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>
    <SccProjectName>
    </SccProjectName>
    <SccLocalPath>
    </SccLocalPath>
    <SccAuxPath>
    </SccAuxPath>
    <SccProvider>
    </SccProvider>
    <Utf8Output>true</Utf8Output>
    <ExpressionBlendVersion>3.1.11022.0</ExpressionBlendVersion>
  </PropertyGroup>
  <!-- This property group is only here to support building this project using the 
       MSBuild 3.5 toolset. In order to work correctly with this older toolset, it needs 
       to set the TargetFrameworkVersion to v3.5 -->
  <PropertyGroup Condition="'$(MSBuildToolsVersion)' == '3.5'">
    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
  </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="mscorlib" />
    <Reference Include="System.Windows" />
    <Reference Include="system" />
    <Reference Include="System.Core" />
    <Reference Include="System.Net" />
    <Reference Include="System.Windows.Controls, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
    <Reference Include="System.Windows.Controls.Data, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
    <Reference Include="System.Windows.Controls.Data.Input, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
    <Reference Include="System.Xml" />
    <Reference Include="System.Windows.Browser" />
    <Reference Include="System.Xml.Linq, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="App.xaml.cs">
      <DependentUpon>App.xaml</DependentUpon>
    </Compile>
    <Compile Include="BoolToFlowDirectionConverter.cs" />
    <Compile Include="Customer.cs" />
    <Compile Include="Dialog.cs" />
    <Compile Include="InsertURL.xaml.cs">
      <DependentUpon>InsertURL.xaml</DependentUpon>
    </Compile>
    <Compile Include="MainPage.xaml.cs">
      <DependentUpon>MainPage.xaml</DependentUpon>
    </Compile>
    <Compile Include="MPContextMenu.cs" />
    <Compile Include="PrintPreview.xaml.cs">
      <DependentUpon>PrintPreview.xaml</DependentUpon>
    </Compile>
    <Compile Include="Properties\AssemblyInfo.cs" />
    <Compile Include="RTBContextMenu.cs" />
    <Compile Include="Strings.Designer.cs">
      <AutoGen>True</AutoGen>
      <DesignTime>True</DesignTime>
      <DependentUpon>Strings.resx</DependentUpon>
    </Compile>
  </ItemGroup>
  <ItemGroup>
    <ApplicationDefinition Include="App.xaml">
      <SubType>Designer</SubType>
      <Generator>MSBuild:Compile</Generator>
    </ApplicationDefinition>
    <Page Include="InsertURL.xaml">
      <Generator>MSBuild:Compile</Generator>
      <SubType>Designer</SubType>
    </Page>
    <Page Include="MainPage.xaml">
      <SubType>Designer</SubType>
      <Generator>MSBuild:Compile</Generator>
    </Page>
    <Page Include="PrintPreview.xaml">
      <Generator>MSBuild:Compile</Generator>
      <SubType>Designer</SubType>
    </Page>
  </ItemGroup>
  <ItemGroup>
    <None Include="Properties\AppManifest.xml" />
    <Resource Include="sampleNew.sav" />
  </ItemGroup>
  <ItemGroup>
    <Resource Include="Images\Bold.png" />
    <Resource Include="Images\Copy.png" />
    <Resource Include="Images\Cut.png" />
    <Resource Include="Images\Hyperlink.png" />
    <Resource Include="Images\Image.png" />
    <Resource Include="Images\Italic.png" />
    <Resource Include="Images\New.png" />
    <Resource Include="Images\Open.png" />
    <Resource Include="Images\Paste.png" />
    <Resource Include="Images\Print.png" />
    <Resource Include="Images\Save.png" />
    <Resource Include="Images\Underline.png" />
  </ItemGroup>
  <ItemGroup>
    <Resource Include="Images\Paste_big.png" />
  </ItemGroup>
  <ItemGroup>
    <Resource Include="Images\datagrid.png" />
  </ItemGroup>
  <ItemGroup>
    <Resource Include="Images\Hyperlink_big.png" />
  </ItemGroup>
  <ItemGroup>
    <Resource Include="Images\Print_big.png" />
  </ItemGroup>
  <ItemGroup>
    <Resource Include="Images\ltr.png" />
    <Resource Include="Images\rtl.png" />
  </ItemGroup>
  <ItemGroup>
    <Resource Include="Images\edit.png" />
    <Resource Include="Images\view.png" />
  </ItemGroup>
  <ItemGroup>
    <Resource Include="Images\edit_16.png" />
  </ItemGroup>
  <ItemGroup>
    <EmbeddedResource Include="Strings.ar.resx" />
    <EmbeddedResource Include="Strings.he.resx" />
    <EmbeddedResource Include="Strings.resx">
      <Generator>PublicResXFileCodeGenerator</Generator>
      <LastGenOutput>Strings.Designer.cs</LastGenOutput>
    </EmbeddedResource>
  </ItemGroup>
  <ItemGroup>
    <Resource Include="Images\logo.png" />
  </ItemGroup>
  <ItemGroup>
    <Resource Include="Images\calendar.png" />
  </ItemGroup>
  <ItemGroup>
    <Resource Include="Images\Annotation_New.png" />
    <Resource Include="Images\hand.png" />
  </ItemGroup>
  <ItemGroup>
    <ProjectReference Include="..\ActionLink.Contracts\ActionLink.Contracts.csproj">
      <Project>{BDC72B84-A52E-4541-98B1-9E254F983603}</Project>
      <Name>ActionLink.Contracts</Name>
    </ProjectReference>
    <ProjectReference Include="..\ActionLink.Implementation\ActionLink.Implementation.csproj">
      <Project>{6E50C4E1-39F9-4E32-ABAF-68984C2CD718}</Project>
      <Name>ActionLink.Implementation</Name>
    </ProjectReference>
    <ProjectReference Include="..\InteractiveText\InteractiveText.csproj">
      <Project>{F851C3EF-17DB-49E1-9AF7-049E3B9B8D7C}</Project>
      <Name>InteractiveText</Name>
    </ProjectReference>
  </ItemGroup>
  <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Silverlight\$(SilverlightVersion)\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
United States United States
Marc Schluper studied Applied Mathematics at Technical University Eindhoven, The Netherlands.
His employer is Kronos Hiring Solutions in Beaverton, OR.
He is married and has two children.

Comments and Discussions