jeudi 30 novembre 2017

Get Markupextension expression in wpf via reflection

I try to parse xaml file (WPF) with LogicalTreeHelper. The LogicalTreeHelper gives me each control as DependancyObject. And I need to investigate which static resources be used with a control.

The Example of an xaml:

<Label Grid.Row="0" Grid.Column="0" Margin="{StaticResource MarginExtraSmall}"
       VerticalAlignment="Center" Content="{x:Static p:Resources.Type}" ></Lable>

The problem is, when I try to get a value of the "Content" property of the Control "Label", I recieve a string, but I need a markupextension expression insteed, in this case "{x:Static p:Resources.Type}"

Have anybody an idea how to solve the problem?

Thank you! Leonid





Aucun commentaire:

Enregistrer un commentaire