Как подключит ControlTheme

Имею:
<Window.Resources>
    <ControlTheme x:Key="int" TargetType="DataGridCell" BasedOn="{StaticResource {x:Type DataGridCell}}">
        <Setter Property="HorizontalAlignment" Value="Right" />
    </ControlTheme>
    <ControlTheme x:Key="str" TargetType="DataGridCell" BasedOn="{StaticResource {x:Type DataGridCell}}">
        <Setter Property="HorizontalAlignment" Value="Left" />
    </ControlTheme>
</Window.Resources>

Столбики в DataGrid создаем вручную

                var eng = new DataGridTextColumn();
                eng.Header = atrddd.DisplayName;
                eng.Width = DataGridLength.Auto;
                eng.IsVisible = false;
                eng.IsReadOnly = true;
                eng.Binding = new Binding(f.Name);
                this.list1.Columns.Add(eng);

И чего надо написать для подключения ? eng.CellTheme = ??? не похоже .


Ответы (0 шт):