Double.Nan
をnull
に変換するコンバータがあります。 私はresourcedictionaryでこれを参照する必要があります。 私はこのconvereterがトリガされ、ここでコンバーターをスタイルwpfのセッターで使用する
<Style x:Key="LabelStyle" TargetType="{x:Type Label}" >
<Setter Property="Content">
<Setter.Value>
<Binding Path="Content" RelativeSource="{RelativeSource Self}">
<Binding.Converter>
<local:NanToNullConverter/>
</Binding.Converter>
</Binding>
</Setter.Value>
</Setter>
</Style>
私のコードが含まれます。しかし、値はUIでは更新されません。バインディング がここにRelativeSourceを使用して、この
<Label Style="{DynamicResource LabelStyle}" Content="{Binding Filters_TanksModelObject.RunDown_HeaderPressureDischargeStart ,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" ContentStringFormat="#.##" ></Label>
@downvoter任意のコメント? – WPFUser
私はdownvoterではありませんが、 'ControlTemplate'の兆候はないので、' TemplatedParent'相対ソースを使って実際に間違っています。 – grek40
@ grek40ありがとう、理解した.. – WPFUser