0
다음 xaml 코드가 있습니다.반복 스타일을 리소스 섹션으로 이동하는 방법은 무엇입니까?
<tk:DataGrid
ItemsSource="{Binding Path=Products}"
AutoGenerateColumns="False">
<tk:DataGrid.Columns>
<tk:DataGridTextColumn
Header="Id">
<tk:DataGridTextColumn.CellStyle>
<Style TargetType="{x:Type tk:DataGridCell}">
<Setter Property="ContentTemplate">
<Setter.Value>
<DataTemplate>
<TextBlock Margin="0,10" Text="{Binding Path=Id}" />
</DataTemplate>
</Setter.Value>
</Setter>
</Style>
</tk:DataGridTextColumn.CellStyle>
</tk:DataGridTextColumn>
<tk:DataGridTextColumn
Header="Product">
<tk:DataGridTextColumn.CellStyle>
<Style TargetType="{x:Type tk:DataGridCell}">
<Setter Property="ContentTemplate">
<Setter.Value>
<DataTemplate>
<TextBlock Margin="0,10" Text="{Binding Path=Name}" />
</DataTemplate>
</Setter.Value>
</Setter>
</Style>
</tk:DataGridTextColumn.CellStyle>
</tk:DataGridTextColumn>
</tk:DataGrid.Columns>
</tk:DataGrid>
복사 붙여 넣기를 제거하려면 어떻게해야합니까? Text = "{Binding Path = XYZ}"가 작동하지 않기 때문에 리소스로 이동하는 직접적인 방법은 실패합니다.
대단히 고마워요! – vkrzv