いくつかのラベルを持つデータ テンプレートがあります。構成設定に応じて、実行時にいくつかのラベルを非表示にしたいと考えています。
ラベルの可視性をプロパティにバインドしましたが、プロパティが False であってもラベルが非表示になりません。
以下は私のxamlです
<Label x:Name="lblWashingMachineName" Content="{x:Static Resources:Translations.MainWindow_WashingMachineName}"
Grid.Row="6" Grid.Column="2" Style="{StaticResource styleLabelBig}" Visibility="{Binding Path=ShowLabels}"></Label>
財産
public bool ShowLabels
{
get
{
return _showLabels;
}
private set
{
_showLabels = value;
OnPropertyChanged("ShowLabels");
}
}
コンストラクターでのプロパティの設定
public DisplayScopeRecord()
{
ShowLabels = !(AppContext.Instance.DicomizerEnabled);
}