|
<Window x:Class="FsRichTextBoxDemo.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:fsc="clr-namespace:FsWpfControls.FsRichTextBox;assembly=FsRichTextBox"
xmlns:local="clr-namespace:FsRichTextBoxDemo"
Title="FS RichTextBox Demo"
Background="PaleGoldenrod"
Height="400" Width="600" WindowStartupLocation="CenterScreen">
<Window.Resources>
<!-- Value Converters -->
<local:FlowDocumentToXamlConverter x:Key="flowDocumentConverter"/>
</Window.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="200" />
<RowDefinition Height="35" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<fsc:FsRichTextBox x:Name="EditBox" Document="{Binding Path=DocumentXaml, Converter={StaticResource flowDocumentConverter}, Mode=TwoWay}" Grid.Row="0" Margin="10,10,10,5" ToolbarBackground="#FFD2CB84" ToolbarBorderBrush="#FFC6BE75" ToolbarBorderThickness="1,1,1,0" />
<StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,5,10,5" >
<Button Content="Load Document" Margin="0,0,10,0" Command="{Binding LoadDocument}" Width="100" />
<Button Content="Force Update" Width="100" Margin="10,0,0,0" Click="OnForceUpdateClick" />
</StackPanel>
<TextBox Text="{Binding DocumentXaml}" Margin="10,5,10,10" Grid.Row="2" Background="Gainsboro" TextWrapping="Wrap">
</TextBox>
</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.
David Veeneman is a financial planner and software developer. He is the author of "The Fortune in Your Future" (McGraw-Hill 1998). His company, Foresight Systems, develops planning and financial software.