ボーダーにラベルがあります。このマークアップでラベルのコンテンツに静的な値を使用すると:
<Border Background="#FFEEEEEE"
Grid.Column="4"
Grid.Row="3"
Margin="2 0">
<Label Content="0"
Name="ui_quantityFooter"
HorizontalAlignment="Center"
FontSize="20" />
</Border>
次のようになります。
ただし、このマークアップを使用して ViewModel の整数値にバインドすると、次のようになります。
<Border Background="#FFEEEEEE"
Grid.Column="4"
Grid.Row="3"
Margin="2 0">
<Label Content="{Binding ExpectedQuantity}"
Name="ui_quantityFooter"
HorizontalAlignment="Center"
FontSize="20" />
</Border>
次のようになります。
なぜ彼らは同じ外見を持っていないのですか?
編集:ExpectedQuantityは次のように定義されています:
public int ExpectedQuantity {
get { return _expectedQuantity; }
}