Similar to another question, I would like to access the x:Name property of an object through code, tough in this case the object in question is not a FrameworkElement
and thus does not have a Name property. I do not have access to the member variable either.
In my situation, I have a ListView
with named columns and would like to extend the ListView class so that it persists the column layout. For this functionality I need named columns, and it would make sense to me to re-use the x:Name property I need to set anyway for other reasons, instead of adding an attached "ColumnName" property for example.
My current "solution":
<GridViewColumn Header="X" localControls:ExtendedListView.ColumnName="iconColumn" />
Desired:
<GridViewColumn Header="X" x:Name="iconColumn" />
So is it possible to get the "x:Name" value somehow?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…