I'm using a Dock Manager in my Main.xaml file with a Document Content Host. The Document Content host has 4 tabs of different images. I have a user control outside of my Main.xaml that has a button that exposes the 4th tab in the Document Content Host of my Dock Manager.
I can get the 4th tab to be expsed, but I cannot get the SelectedIndex of the Document Content Host to allow for the 4th tab to be the focused tab.
How would I do this?
Hello Mike,
Thank you for your post. I have been looking into it and if I understood your requirements correctly what I can suggest is activating the content pane the selected tab holds. This can be achieved by using the ContentPane’s Activate() method and will result into focusing the first focusable element in your content pane, i.e. the image. I have implemented the described approach in the sample application I am attaching for your reference.
If you have any further questions on this matter, please do not hesitate to let us know.
Thanks. I'm testing it out and will ask you if I have any questions.
I get the error "Object reference not set to an instance of an object."
Could you, please, provide me with some more information about this error so I can investigate it for you? First, I need to know which portion of the code throws the error. Are you running the sample application I sent or are you using a code snippet in an application of your own? If this is the case, could you, please, send your sample application where the issue is reproduced so I can investigate it further?
Looking forward to hearing from you.
wnd = Window.GetWindow(this) as Screen_1; (This line here solved my issue. I had to just reference the window)
wnd.DocTabGroup.SelectedIndex = 3;
(wnd.DocTabGroup.SelectedContent as ContentPane).Activate();
Thanks.
Thank you for the information. I am glad you have resolved your issue.
If you have further questions on the matter, please do not hesitate to contact us.