开发者

Label Target="{Binding ElementName=UIName}" bug, or is it just me?

I've开发者_JAVA技巧 been tring to get this example to work, but there seems to be a bug in the code Label Target code, in that when you click on the second label the focus is set to the DatePicker rather than the TextBox, regardless which label you click first, also when you have entered the date the second label still sets it focus to DatePicker.

<!-- Unbound Date of Birth field -->
<sdk:Label Content="Date of Birth" IsRequired="True" Margin="5" />
<StackPanel Orientation="Horizontal" Grid.Column="1">
    <sdk:DatePicker Height="23" />
    <sdk:DescriptionViewer Description="Please enter your date of birth."/>
</StackPanel>

<!-- ID Number field -->
<sdk:Label Grid.Row="1" Margin="5" Target="{Binding ElementName=tbIdNumber}" />
<StackPanel Orientation="Horizontal" Grid.Column="1" Grid.Row="1">
    <TextBox x:Name="tbIdNumber" Height="23" Width="100"
             Text="{Binding IdNumber, Mode=TwoWay, 
                    ValidatesOnExceptions=True, NotifyOnValidationError=True}" />
    <sdk:DescriptionViewer Target="{Binding ElementName=tbIdNumber}"/>
</StackPanel>

I found this example here on the MSDN link text. To me this seems to be a bug, or am I just losing it?

Apologies if this is a duplicate question... I have googled this and all the examples seem to be the same, in that the target element is not being focused to.


It seems a reasonable assumption that clicking the label ought to move the focus to the associated control. However the Label does not actually provide that function.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜