Click here to Skip to main content
15,893,508 members
Articles / Desktop Programming / WPF

WPF.JoshSmith

Rate me:
Please Sign up or sign in to vote.
4.99/5 (51 votes)
13 Jul 2008CPOL5 min read 391K   4.8K   263  
A free library of controls and utility classes for use in WPF applications.
<Window x:Class="Test.SmartTextBox.Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:jas="clr-namespace:WPF.JoshSmith.Controls;assembly=WPF.JoshSmith" 
    Title="SmartTextBox Demo" Height="500" Width="500"
    FontSize="15"    
    >
  <Window.Resources>
    <Style x:Key="SuggestionListBoxStyle" TargetType="ListBox">
      <Setter Property="BitmapEffect">
        <Setter.Value>
          <DropShadowBitmapEffect ShadowDepth="1" Softness="0.5" />
        </Setter.Value>
      </Setter>
      <Setter Property="BorderBrush" Value="Gray" />
      <Setter Property="ItemContainerStyle">
        <Setter.Value>
          <Style TargetType="ListBoxItem">
            <Setter Property="Border.BorderBrush" Value="LightGray" />
            <Setter Property="Border.BorderThickness" Value="0,0,0,0.5" />
            <Setter Property="FontSize" Value="12" />
            <Setter Property="FontWeight" Value="Bold" />
            <Setter Property="Margin" Value="2,4" />
            <Setter Property="FocusVisualStyle" Value="{x:Null}" />
          </Style>
        </Setter.Value>
      </Setter>
    </Style>

    <Style TargetType="jas:SmartTextBox">
      <Setter Property="AcceptsReturn" Value="True" />
      <Setter Property="BorderBrush" Value="Gray" />
      <Setter Property="Margin" Value="4" />
      <Setter Property="SuggestionListBoxStyle" Value="{StaticResource SuggestionListBoxStyle}" />
      <Setter Property="TextWrapping" Value="Wrap" />
    </Style>
  </Window.Resources>
  <Grid>
    <Grid.RowDefinitions>
      <RowDefinition Height="Auto" />
      <RowDefinition />
      <RowDefinition Height="Auto" />
    </Grid.RowDefinitions>
    <Grid.Background>
      <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
        <GradientStop Color="#200000FF" Offset="0" />
        <GradientStop Color="#080000FF" Offset="0.5" />
        <GradientStop Color="#120000FF" Offset="1" />
      </LinearGradientBrush>
    </Grid.Background>
    <TextBlock FontSize="16" FontWeight="SemiBold" Margin="2,4">Type your thoughts here:</TextBlock>
    <jas:SmartTextBox 
      x:Name="smartTextBox" 
      Grid.Row="1" xml:space="preserve">Johann Sebastian Bach was born in Eisenach, Germany to an extraordinarily muscal family — for more than 200 years, the Bach family had produced dozens of worthy performers and compsers during a period in which the church, local government and the aristocracy provided significant support for profesional music making in the German-speaking world, particularly in the eastern electorates of Thuringia and Saxony. Bach's father, Johann Ambrosius Bach, was a talented violnist and trumpeter in Eisenach, a town of some 6,000 residents in Thuringia, and held a post involving the organisation of secular music and participation in church music. His uncles were all professional musicians, ranging from church organists and court chamber musicians to composers. Contemporary documents indicate tht, in some circles, the name Bach had come to be used as a synonim for "musician".</jas:SmartTextBox>
    <DockPanel Grid.Row="2">
      <TextBlock DockPanel.Dock="Left"  Margin="8,4">(Press F1 to view suggested spellings for a typo)</TextBlock>
      <Button Name="btnFixNextTypo"  DockPanel.Dock="Right" HorizontalAlignment="Right" Margin="8,4">Fix Next Typo</Button>
    </DockPanel>
  </Grid>
</Window>

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
Software Developer (Senior)
United States United States
Josh creates software, for iOS and Windows.

He works at Black Pixel as a Senior Developer.

Read his iOS Programming for .NET Developers[^] book to learn how to write iPhone and iPad apps by leveraging your existing .NET skills.

Use his Master WPF[^] app on your iPhone to sharpen your WPF skills on the go.

Check out his Advanced MVVM[^] book.

Visit his WPF blog[^] or stop by his iOS blog[^].

See his website Josh Smith Digital[^].

Comments and Discussions