开发者

DataTemplate equivalent in Silverlight

开发者 https://www.devze.com 2022-12-20 21:37 出处:网络
Looking for the WPF equivalent of the following: <controls:TabItem Foreground=\"Black\" Header=\"{Bi开发者_如何学Cnding Path=Home.Header}\"

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

精彩评论

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

关注公众号