http://www.techshinobi.com/source/FontViewer.zip
Code: Select all
<Window x:Class="FontViewer.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Font Viewer" Height="400" Width="600">
<DockPanel>
<Border DockPanel.Dock="Top" CornerRadius="6"
BorderThickness="1" BorderBrush="Gray"
Background="LightGray" Padding="8"
Margin="0 0 0 8">
<TextBlock FontSize="14"
TextWrapping="Wrap">
Select a font to view from the list below.
You can change the text by typing in the region at the bottom.
</TextBlock>
</Border>
<ListBox x:Name="FontList" DockPanel.Dock="Left"
ItemsSource="{x:Static Fonts.SystemFontFamilies}"
Width="160" />
<TextBox x:Name="SampleText"
DockPanel.Dock="Bottom"
MinLines="4"
Margin="8 0"
TextWrapping="Wrap"
ToolTip="Type Here to change the preview text.">
The quick brown Fox jumped over the lazy dog.
</TextBox>
<TextBlock Text="{Binding ElementName=SampleText, Path=Text}"
FontFamily="{Binding ElementName=FontList, Path=SelectedItem}"
TextWrapping="Wrap"
Margin="0 0 0 4" />
</DockPanel>
</Window>