Reputation: 503
I am fairly new to XAML / WPF programming. I would like to ask how to do a particular line of code from XAML into C#?
XAML:
<GridView>
<ItemsPanelTemplate>
<WrapGrid Orientation="Horizontal"/>
</ItemsPanelTemplate>
</GridView>
How can I do this in C#?
Upvotes: 0
Views: 1408
Reputation: 4205
If you give the control a name, like this:
<GridView>
<ItemsPanelTemplate>
<WrapGrid Name="MyWrapGrid" Orientation="Horizontal"/>
</ItemsPanelTemplate>
</GridView>
You can do this in code behind (C#) to change the orientation:
MyWrapGrid.Orientation = Orientation.Horizontal;
Upvotes: 3