<Button Margin="2" Width="10" >
<Button.Background>
<SolidColorBrush Color="{Binding Path=MarkColor}"></SolidColorBrush>
</Button.Background>
</Button>
这样即可绑定
但是需要注意的是这里的Color是System.Windows.Media.Color不是Drawing.Color
也可以直接Background绑定,但是需要进行一个convert
public class Matrix2Len : IValueConverter
{
object IValueConverter.Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value == null)
return 0;
else
{
List<List<double>> data = (List<List<double>>)value;
return data[0].Count/1000;
}
}
object IValueConverter.ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
本文地址:https://blog.csdn.net/gunjiu4462/article/details/107388362
如对本文有疑问, 点击进行留言回复!!
【程序】Marvell 88W8686 WiFi模块(WM-G-MR-09)创建或连接热点,并使用lwip2.0.2建立http服务器(20171030版)
网友评论