Click here to Skip to main content
15,887,746 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
We have
<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>


What I have tried:

var controlTheme = this.Find<ControlTheme>("x:Key=int");
var controlTheme = this.Find<ControlTheme>("int");....

does not work
I need to do this
var eng = new DataGridTextColumn();
eng.CellTheme = this.Find<ControlTheme>("int");
Posted
Updated 13-Nov-23 5:01am
v2

1 solution

Your question would be better posted at Avalonia UI - Home[^].
 
Share this answer
 
Comments
Борис Васильев 13-Nov-23 11:25am    
I don’t think they will answer there, I hope someone dug up the answer.
Dave Kreskowiak 13-Nov-23 13:00pm    
Think again.

https://avaloniaui.net/Support
https://docs.avaloniaui.net/docs/community

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900