我試圖強調一個標籤,如解釋here但它不起作用。出現一個錯誤說:強調標籤
Mode must be specified for RelativeSource
但我已經指出的那樣:
<Label Grid.Row="0" Grid.Column="0" Tag="ID" FontWeight="Bold" Margin="10,5" HorizontalAlignment="Left">
<TextBlock TextDecorations="Underline" Text="{Binding Path=Tag, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Label}}}" />
</Label>
有什麼不對嗎?
這對我的作品。嘗試重建所有。爲什麼不直接使用TextBlock?似乎不需要標籤。 – Clemens