Light Drake
Light Drake

Reputation: 121

Setting Content from Code-Behind using Resources

I am currently designing a UI for an UWP application. I have a Splitview set up that has a content I want to set from the code-behind depending on user interaction.

In the Resources, I have some Menus set up that I can set without a single problem from the content property itself:

<SplitView x:Name="NavPane" OpenPaneLength="250" CompactPaneLength="50" Content="{StaticResource Home}" DisplayMode="CompactOverlay" IsPaneOpen="False" PaneClosing="NavPane_PaneClosing">

What I would like to do now is use the content property to bind to a FrameworkElement variable in the Code-behind.

How can I do this while, if possible, keeping my menus set up in xaml? Or is there a method others use that i just haven't caught on to yet?

Any help is appreciated very much.

Upvotes: 0

Views: 80

Answers (1)

TJ Riceball
TJ Riceball

Reputation: 238

I watched the UWP series tutorial of Microsoft and I learned that there are different ways to Data Bind. To be more accurate, you may check this link of Microsoft showing you different examples. I hope it helps!

Upvotes: 0

Related Questions