2011-09-21 62 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}」 不工作。

還有其他想法嗎?非常感謝。

回答