You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
65 lines
3.8 KiB
65 lines
3.8 KiB
<!--*********************************************************************
|
|
|
|
Extended WPF Toolkit
|
|
|
|
Copyright (C) 2010-2012 Xceed Software Inc.
|
|
|
|
This program is provided to you under the terms of the Microsoft Public
|
|
License (Ms-PL) as published at http://wpftoolkit.codeplex.com/license
|
|
|
|
This program can be provided to you by Xceed Software Inc. under a
|
|
proprietary commercial license agreement for use in non-Open Source
|
|
projects. The commercial version of Extended WPF Toolkit also includes
|
|
priority technical support, commercial updates, and many additional
|
|
useful WPF controls if you license Xceed Business Suite for WPF.
|
|
|
|
Visit http://xceed.com and follow @datagrid on Twitter.
|
|
|
|
********************************************************************-->
|
|
|
|
<sample:DemoView x:Class="Samples.Modules.Text.Views.RichTextBoxView"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:sys="clr-namespace:System;assembly=mscorlib"
|
|
xmlns:sample="clr-namespace:Samples.Infrastructure.Controls;assembly=Samples.Infrastructure"
|
|
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
|
|
xmlns:local="clr-namespace:Samples.Modules.Text.Views"
|
|
Title="RichTextBox"
|
|
Description="The RichTextBox is a TextBox that allows you to edit formatted text based on TextFormatters. The RichTextBoxFormatBar is a contextual formatting toolbar that mimics the behavior of the Microsoft Office 2010 formatting bar on selection.">
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="*" />
|
|
</Grid.RowDefinitions>
|
|
|
|
<GroupBox Header="Features" Grid.Row="0" Margin="5">
|
|
<Grid Margin="5" HorizontalAlignment="Left">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="Auto" />
|
|
</Grid.RowDefinitions>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="Auto" />
|
|
<ColumnDefinition Width="*" />
|
|
</Grid.ColumnDefinitions>
|
|
<TextBlock Text="TextFormatter:" VerticalAlignment="Center" />
|
|
<ComboBox x:Name="_textFormatter" SelectedIndex="0" SelectionChanged="OnTextFormatterChanged" Grid.Column="1" Width="150" Margin="5" HorizontalAlignment="Left">
|
|
<ComboBoxItem Tag="{x:Static local:TextFormatterEnum.PlainText}">Plain Text</ComboBoxItem>
|
|
<ComboBoxItem Tag="{x:Static local:TextFormatterEnum.Rtf}">RTF</ComboBoxItem>
|
|
<ComboBoxItem Tag="{x:Static local:TextFormatterEnum.Xaml}">Xaml</ComboBoxItem>
|
|
</ComboBox>
|
|
<TextBlock Text="Text:" Grid.Row="1" VerticalAlignment="Center"/>
|
|
<TextBox x:Name="_text" Grid.Row="1" Grid.Column="1" TextWrapping="Wrap" IsReadOnly="True" Width="500" Height="70" Margin="5" ScrollViewer.VerticalScrollBarVisibility="Auto"/>
|
|
</Grid>
|
|
</GroupBox>
|
|
|
|
<StackPanel Grid.Row="1" Margin="10">
|
|
<TextBlock Text="Usage:" Style="{StaticResource Header}" />
|
|
<xctk:RichTextBox x:Name="_richTextBox" Grid.Column="1" Margin="5" BorderBrush="Gray" Padding="10" Width="350" Text="{Binding ElementName=_text, Path=Text, UpdateSourceTrigger=PropertyChanged}">
|
|
<xctk:RichTextBoxFormatBarManager.FormatBar>
|
|
<xctk:RichTextBoxFormatBar />
|
|
</xctk:RichTextBoxFormatBarManager.FormatBar>
|
|
</xctk:RichTextBox>
|
|
</StackPanel>
|
|
</Grid>
|
|
</sample:DemoView>
|
|
|