Spell Check a TextBox or RichTextBox Control in Real Time


   
     

<Window x:Class="WpfApplication1.Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="WPF" Height="100" Width="300">
    <StackPanel>
        <TextBlock FontSize="14" FontWeight="Bold" 
                   Text="A spell-checking TextBox:"/>
        <TextBox AcceptsReturn="True" AcceptsTab="True" FontSize="14" 
                 Margin="5" SpellCheck.IsEnabled="True" TextWrapping="Wrap">
            The qick red focks jumped over the lasy brown dog.
        </TextBox>
    </StackPanel>
</Window>

   
    
    
    
    
     


Adding Hyperlink to TextBlock


   
     
<Page x:Class="NavigationApplication.LinkToAssemblyPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="LinkToAssemblyPage">
  <StackPanel Margin="3">
    <TextBlock Margin="3" TextWrapping="Wrap">
      This is a simple page.
      Click <Hyperlink NavigateUri="/PageLibrary;component/SharedPage.xaml">here</Hyperlink>.
    </TextBlock>


  </StackPanel>
</Page>

   
    
    
    
    
     


TextBlock Opacity Animation


   
     

<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <TextBlock x:Name="txtblk" Text="XAML" 
               FontSize="144pt" FontFamily="Arial Black"
               HorizontalAlignment="Center" VerticalAlignment="Center">

        <TextBlock.Triggers>
            <EventTrigger RoutedEvent="TextBlock.Loaded">
                <BeginStoryboard>
                    <Storyboard TargetName="txtblk" 
                                TargetProperty="Opacity"
                                RepeatBehavior="Forever">
                        <DoubleAnimationUsingPath Duration="0:0:4" 
                                                  Source="Y">
                            <DoubleAnimationUsingPath.PathGeometry>
                                <PathGeometry>
                                    <PathGeometry.Figures>
                                        <PathFigure StartPoint="0 0">
                                            <LineSegment Point="0 1" />
                                            <LineSegment Point="2 1" />
                                            <LineSegment Point="2 0" />
                                        </PathFigure>
                                    </PathGeometry.Figures>
                                </PathGeometry>
                            </DoubleAnimationUsingPath.PathGeometry>
                        </DoubleAnimationUsingPath>
                    </Storyboard>
                </BeginStoryboard>
            </EventTrigger>
        </TextBlock.Triggers>
    </TextBlock>
</Page>

   
    
    
    
    
     


Text Drop Shadow


   
     

<Grid xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <Grid.Resources>
        <Style TargetType="{x:Type TextBlock}">
            <Setter Property="Text" Value="Drop-Shadow" />
            <Setter Property="FontFamily" Value="Times New Roman Bold" />
            <Setter Property="FontSize" Value="96" />
            <Setter Property="HorizontalAlignment" Value="Center" />
            <Setter Property="VerticalAlignment" Value="Center" />
        </Style>
    </Grid.Resources>
    <TextBlock Opacity="0.5" RenderTransform="1 0 0 1 5 5" />
    <TextBlock />
</Grid>

   
    
    
    
    
     


TextBlock ScaleTransform ScaleY and TransformGroup


   
     

<Canvas xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:s="clr-namespace:System;assembly=mscorlib">
    <Canvas.Resources>
        <FontFamily x:Key="fntfam">Times New Roman</FontFamily>
        <s:Double x:Key="fntsize">96</s:Double>

        <TransformGroup x:Key="xform">
            <ScaleTransform ScaleX="{Binding Source={StaticResource fntfam}, Path=Baseline}" />
            <ScaleTransform ScaleX="{StaticResource fntsize}" />
        </TransformGroup>

        <Style TargetType="{x:Type TextBlock}">
            <Setter Property="FontFamily" Value="{StaticResource fntfam}" />
            <Setter Property="FontSize" Value="{StaticResource fntsize}" />
            <Setter Property="Text" Value="Reflect" />
            <Setter Property="Canvas.Left" Value="400" />
            <Setter Property="Canvas.Top" Value="48" />
        </Style>
    </Canvas.Resources>

    <TextBlock>asdf</TextBlock>
    <TextBlock>
        <TextBlock.RenderTransform>
            <ScaleTransform ScaleY="-1" 
                CenterY="{Binding Source={StaticResource xform},Path=Value.M11}" />
        </TextBlock.RenderTransform>
    </TextBlock>

</Canvas>

   
    
    
    
    
     


TextBlock ScaleTransform ScaleX


   
     

<Canvas xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:s="clr-namespace:System;assembly=mscorlib">
    <Canvas.Resources>
        <FontFamily x:Key="fntfam">Times New Roman</FontFamily>
        <s:Double x:Key="fntsize">96</s:Double>

        <TransformGroup x:Key="xform">
            <ScaleTransform ScaleX="{Binding Source={StaticResource fntfam}, Path=Baseline}" />
            <ScaleTransform ScaleX="{StaticResource fntsize}" />
        </TransformGroup>

        <Style TargetType="{x:Type TextBlock}">
            <Setter Property="FontFamily" Value="{StaticResource fntfam}" />
            <Setter Property="FontSize" Value="{StaticResource fntsize}" />
            <Setter Property="Text" Value="Reflect" />
            <Setter Property="Canvas.Left" Value="400" />
            <Setter Property="Canvas.Top" Value="48" />
        </Style>
    </Canvas.Resources>

    <TextBlock>asdf</TextBlock>
    <TextBlock>
        <TextBlock.RenderTransform>
            <ScaleTransform ScaleX="-1" />
        </TextBlock.RenderTransform>
    </TextBlock>


</Canvas>

   
    
    
    
    
     


Engrave Text


   
     



<Grid xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <Grid.Resources>
        <Style TargetType="{x:Type TextBlock}">
            <Setter Property="FontFamily" Value="Times New Roman" />
            <Setter Property="FontSize" Value="144" />
            <Setter Property="HorizontalAlignment" Value="Center" />
            <Setter Property="VerticalAlignment" Value="Center" />
        </Style>
    </Grid.Resources>

    <Grid.RowDefinitions>
        <RowDefinition />
        <RowDefinition />
    </Grid.RowDefinitions>


    <TextBlock Grid.Row="1" Foreground="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}">
        Engrave
        <TextBlock.RenderTransform>
            <TranslateTransform X="-2" Y="-2" />
        </TextBlock.RenderTransform>
    </TextBlock>


    <TextBlock Grid.Row="1" Foreground="{DynamicResource {x:Static SystemColors.WindowBrushKey}}">
        Engrave
    </TextBlock>


</Grid>