private static DataTemplate GetDataTemplateCheckBoxColumn()
{
MemoryStream sr = null;
ParserContext pc = null;
string xaml = string.Empty;
xaml = @"<DataTemplate >
<CheckBox IsChecked=""{Binding Path=Tag,Mode=TwoWay, RelativeSource={RelativeSource FindAncestor
, AncestorType={x:Type ListViewItem}}}"" x:Name=""checkBoxDataTemplateColumn"">
</CheckBox>
</DataTemplate>";
sr = new MemoryStream(Encoding.ASCII.GetBytes(xaml));
pc = new ParserContext();
pc.XmlnsDictionary.Add("", "http://schemas.microsoft.com/winfx/2006/xaml/presentation");
pc.XmlnsDictionary.Add("x", "http://schemas.microsoft.com/winfx/2006/xaml");
DataTemplate datatemplate = (DataTemplate)XamlReader.Load(sr, pc);
return datatemplate;
}
No comments:
Post a Comment