OSDN Git Service

正常に選択できないバグを修正した
[fooeditengine/FooEditEngine.git] / WPF / Test / MainWindow.xaml
index 6a00578..24d52e3 100644 (file)
@@ -2,7 +2,11 @@
         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"/>
@@ -28,8 +32,7 @@
         </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"/>