2011-09-21 65 views
0

我搜索正确的方式来绑定sdk中的TextBlock:DataGridCell模板;像WPF中的方式 - 文本= {绑定}不起作用。Silverlight sdk:带TextBox的DataGridCell模板 - 绑定?

<Style TargetType="sdk:DataGridCell"> 
<Setter Property="Template"> 
<Setter.Value> 
    <ControlTemplate TargetType="ContentControl"> 
     <Grid> 
      <VisualStateManager.VisualStateGroups> 
      <VisualStateGroup x:Name="MouseOver"> 
      </VisualStateGroup> 
      </VisualStateManager.VisualStateGroups> 
     <Border Background="{x:Null}"> 
      <TextBlock Text="{Binding}" Foreground="Black"/> 
     </Border> 
     </Grid> 
    </ControlTemplate> 
    </Setter.Value> 
</Setter> 

文字= “{绑定的RelativeSource = {的RelativeSource TemplatedParent},路径= Content.Text}” 不工作。

还有其他想法吗?非常感谢。

回答