Skip to content

NumericUpDown的Title用绑定无效 #1203

@nnn149

Description

@nnn149

Describe the bug

我在使用hc:InfoElement.Title="{Binding Key,Mode=OneWay}" 绑定到Key,一个String类型,界面上不会显示Titile,
但是用hc:TextBox绑定title是可以显示的。
调整hc:InfoElement.TitlePlacement="Left"也不会显示。

Steps to reproduce the bug

<ListBox Style="{StaticResource ListBoxWrapStyle}"
            ItemsSource="{Binding AimTypes}"
                ItemContainerStyle="{StaticResource ItemContainerStyle1}" 
                ScrollViewer.HorizontalScrollBarVisibility="Disabled" SelectionMode="Single">
    <ListBox.ItemTemplate>
        <DataTemplate>
            <DockPanel>
                <TextBlock HorizontalAlignment="Center"  Text="{Binding Key,Mode=OneWay}" Style="{StaticResource TextBlockDefault}"/>
                <hc:NumericUpDown hc:InfoElement.Title="{Binding Key,Mode=OneWay}"  DecimalPlaces="2" Value="{Binding Value}" Increment="0.01" Maximum="2" Minimum="0.01"/>
            </DockPanel>
        </DataTemplate>
    </ListBox.ItemTemplate>
</ListBox>

Expected behavior

绑定后title正常显示。

Screenshots

image

NuGet package version

HandyControl 3.3.0

IDE

Visual Studio 2022

Framework type

.Net 6.0

Windows version

Windows 11 (22000)

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions