开发者

DataTemplate equivalent in Silverlight

Looking for the WPF equivalent of the following:

<controls:TabItem
    Foreground="Black"
    Header="{Bi开发者_如何学Cnding Path=Home.Header}"
    Content="{Binding **Path=Home**, Mode=OneWay}" />

Home is:

public ViewModelBase Home
{
    get
    {
        return this._homeViewModel;
    }
}

Inside my ViewModel, I am unable to bind the XAML to the _homeViewModel in Silverlight.

Any ideas ?


Silverlight still doesn't support implicit DataTemplates :-(

The best you can do is to use an attached behaviour to set the DataTemplate yourself (and have the behaviour get a DataTemplate with a key that is defined by convention).

Google "Attached Behaviour" if that was gobbledygook.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜