DependencyProperty
을 내 맞춤 검색 버튼의 라벨에 바인딩하고 싶습니다. 여기 Label의 Text 속성에 DependencyProperty를 바인딩 하시겠습니까?
DependencyProperty
입니다 : 다른 경우지만 여러 번했다
<TextBlock x:Name="lblButtonText" Margin="16,45.2465" TextWrapping="Wrap" Text="{Binding RelativeSource={RelativeSource Mode=Self}, Path=ButtonText}" VerticalAlignment="Center" TextAlignment="Right" Foreground="White" FontSize="17.333" FontWeight="Bold" FontFamily="Segoe UI Semibold" Height="26.053"/>
내 DependencyProperties 바인딩의이 방법 : 여기
public static readonly DependencyProperty ButtonTextProperty = DependencyProperty.Register("ButtonText", typeof(string), typeof(MainMenuButton));
public string ButtonText
{
get { return (string)GetValue(ButtonTextProperty); }
set { SetValue(ButtonTextProperty, value); }
}
그리고 것은 라벨에 값을 바인딩하는 내 시도 이번엔 왜 작동하지 않는지 알 수 없습니까?
이 문제를 어떻게 해결할 수 있습니까?
RelativeSource 포인트 그것 자체 ... 그래서 ButtonText라는 TextBlock의 속성에 바인딩하려고합니다 – Johnny
Thanks Johnny :) – TorbenJ