menuitem header set text help newb
Posted: 08 Apr 2015, 19:46
I'm a newb when it comes to xaml and wpf stuff, so any help would great.
I have a menu with a submenu and I have some items dynamically added to the submenu, manually. Not via any sort of data binding stuff.
But what I wanted to do was change the header of the menu when I selected a menu item, so that it changes to the menu item text, to show what was selected with the menu closed.
Basically, I think I want to change the header text, but I can't figure out how to do this.
It looked like maybe I need these guys to mess with the header...
#include <NsGui/HeaderedContentControl.h>
#include <NsGui/HeaderedItemsControl.h>
I have tried messing with "HeaderedContentControl" and "HeaderedItemControl" and I can't tell what the difference is. If I create a "HeaderedContentControl", I can set some text in it (using header->SetHeader("string_goes_here")), but I can't figure out how to fetch the string from it. I tried casting it, but nothing...
HeaderedItemControl doesn't seem to have this functionality to even set the string. But I think I need to use HeaderedItemControl... I think..
I tried messing with GetValue() and GetContent() but I'm not really sure what I'm doing. Any direction would be great.
Thanks,
-Todd
I have a menu with a submenu and I have some items dynamically added to the submenu, manually. Not via any sort of data binding stuff.
But what I wanted to do was change the header of the menu when I selected a menu item, so that it changes to the menu item text, to show what was selected with the menu closed.
Basically, I think I want to change the header text, but I can't figure out how to do this.
It looked like maybe I need these guys to mess with the header...
#include <NsGui/HeaderedContentControl.h>
#include <NsGui/HeaderedItemsControl.h>
I have tried messing with "HeaderedContentControl" and "HeaderedItemControl" and I can't tell what the difference is. If I create a "HeaderedContentControl", I can set some text in it (using header->SetHeader("string_goes_here")), but I can't figure out how to fetch the string from it. I tried casting it, but nothing...
HeaderedItemControl doesn't seem to have this functionality to even set the string. But I think I need to use HeaderedItemControl... I think..
I tried messing with GetValue() and GetContent() but I'm not really sure what I'm doing. Any direction would be great.
Thanks,
-Todd