✅ How to use a UserControl inside of a Window?
So I've moved part of the menu bar at the top of the screen to another UserControl file as my menu bar has a lot of options so I'm breaking it up. As the code above currently sits, I have a blank screen with an arrow in the top-right corner, but nothing else. I used the reference from this stack overflow comment to put in the
xmlns:uc=""
and the <uc:FileMenu />
. Here is the full code for the <uc:FileMenu />
page that is in Views/MenuBar. I'm just not sure what I'm doing wrong. Thanks4 Replies
ContentControl if you want dynamic controls
Or simply define it like normal
<yourname:YourCustomControl></yourname:YourCustomControl>
so I can remove the
xmlns:un
line and replace the other with what you just put?I screwed up the project. hold on. I'll brb
ok I got it working both ways like this using both
cc
and uc
but now I have the issue of instead of it looking like a regeular menu bar, there's an arrow and the dropdown pops out to the side instead of down like normal
becuase of how they're presenting themselves using the uc:
or the cc:
, its causing them to not have enough room on the menu bar, but if I put all of them back inside of the parent <Menu></Menu>
then they'll go back to looking normal. I guess I could just bind the menu to a list in the view model for the main window and have it display that way. idk
i'll be back later. I have to go to work. Thanks for your help so far