xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:MyNamespace="clr-namespace:FooEditEngine.WPF;assembly=FooEditEngine.WPF"
+ xmlns:local="clr-namespace:Test"
Title="MainWindow" Height="350" Width="525">
+ <Window.Resources>
+ <local:TextRangeConveter x:Key="TextRangeConverter"/>
+ </Window.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="24"/>
</Menu>
<MyNamespace:FooTextBox x:Name="fooTextBox" Grid.Row="1"/>
<StackPanel Grid.Row="2" Orientation="Horizontal">
- <TextBlock Text="{Binding Selection.Index,ElementName=fooTextBox}"/>
- <TextBlock Text="{Binding Selection.Length,ElementName=fooTextBox}" Margin="10,0,0,0"/>
+ <TextBlock Text="{Binding Selection,ElementName=fooTextBox,Converter={StaticResource TextRangeConverter}}" Margin="10,0,0,0"/>
<TextBlock Text="FindPattern" Margin="10,0,0,0"/>
<TextBox Name="FindPattern" Width="100"/>
<TextBlock Text="ReplaceAll" Margin="10,0,0,0"/>