0

私の wpf アプリケーションでは、テキストブロックのテキスト プロパティがオブジェクトの文字列プロパティにバインドされています。文字列プロパティ値は「ABC-XYZ2014-HHH」です。

しかし、テキストブロックもテキストボックスも値を正しく表示しません。値はテキストブロックとテキストボックスに「ABC-XYZ2014-」として表示されます

Label が "_" または "-" をアクセラレータ キーとして解釈することがわかりましたが、textblock と textbox を使用しています。ただし、2 番目の「-」の後の値は、テキストブロックとテキスト ボックスに表示されません。MessageBox で正しい値を確認できます。

<UserControl x:Class="KaliteKontrol.PresentationLayer.Denetim"
         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
         xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
         xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
         xmlns:igEditors="http://infragistics.com/Editors"
         xmlns:ig="http://schemas.infragistics.com/xaml"
         xmlns:GridControlLib="clr-namespace:CommonLib.Utils;assembly=CommonLib"
         xmlns:commonLibUtils="clr-namespace:CommonLib.Utils;assembly=CommonLib"
         xmlns:igDP="http://infragistics.com/DataPresenter"
         xmlns:sys="clr-namespace:System;assembly=mscorlib"
         xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
         mc:Ignorable="d" 
         d:DesignHeight="300" d:DesignWidth="300">
<UserControl.Resources>
    <BooleanToVisibilityConverter x:Key="BoolVisibilityConverter" />
    <Style TargetType="ContentPresenter">
        <Setter Property="RecognizesAccessKey" Value="False" />
    </Style>
</UserControl.Resources>
<ScrollViewer VerticalScrollBarVisibility="Visible">
    <StackPanel  x:Name="mainPanel" Style="{StaticResource ResourceKey=MainWindowsStyle}" >
        <Button>
            <TextBlock Text="{Binding Path=Denetim.DRef}" />
        </Button>
        <Button IsCancel="True"  >

                    <AccessText Margin="10,0,10,0" Text="{Binding Path=Denetim.DRef}"/>
        </Button>
        <TextBox Text="{Binding Path=Denetim.DRef}" Width="500"    />
        <TextBlock Text="{Binding Path=Denetim.DRef}" Width="800"    />
        <Label Content="{Binding Path=Denetim.DRef}"   />
  </StackPanel>
</ScrollViewer>
</UserControl>

ありがとうオヌール

4

1 に答える 1