0
我有Binding
一个有趣的问题,我有一个DataTemplate
包含一个Button
和DataTemplate
已被放置在一个窗口(specView),我需要的Button.Command
到Commnad
绑定窗口的视图模型里面,所以我这样做:如何将DataTemplate中的按钮绑定到Window的Viewmodel命令?
Command="{Binding DataContext.NewOfferNoCommand,ElementName=specView}"/>
,但它并不会约束,直到我作出这样的返回值转换器:
public class ReturnValueConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
return value;
}
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
return value;
}
}
我实在无法理解的问题是什么任何IDIA?