C# Xaml如何在属性中使用操作数
您知道如何在xaml中使用数学操作数吗?例如,我有:C# Xaml如何在属性中使用操作数,c#,wpf,xaml,C#,Wpf,Xaml,您知道如何在xaml中使用数学操作数吗?例如,我有: <TextBlock Foreground="Red" Text="Example 01" FontSize="{Binding ElementName=SizeTextBox, Path=Text.Length}" Background="Azure"/> 提前感谢您您不能使用数学操作数,您必须使用ValueConverter。在XAML中不能这样做,您必须使用IValueConverter来实现这一点。 Font
<TextBlock Foreground="Red" Text="Example 01" FontSize="{Binding ElementName=SizeTextBox, Path=Text.Length}" Background="Azure"/>
提前感谢您您不能使用数学操作数,您必须使用ValueConverter。在XAML中不能这样做,您必须使用
IValueConverter
来实现这一点。
FontSize="{Binding ElementName=SizeTextBox, Path=Text.Length*4}"