Dear Community,
I am struggling to find a way to update an UI element from other class than <*>ViewModel.cs.
I have a docpane with a WaitingCursorControl. Its visibility is cotrolled via data binding in the ViewModel class. However, I do have another MapTool class where I would like to set the visibility of the WaitingCursorControl in the dockpane.
How can access the data binding property from a different class than ViewModel? Any hints?
Thanks!
Adam
Solved! Go to Solution.
Hi,
1. Find your dockpane:
DockPane pane = FrameworkApplication.DockPaneManager.Find(_dockPaneID);
if (pane == null)
return;
2. Cast pane to you ViewModel class and access public property:
(pane as YourDockpaneViewModel).YourPropertyName = value;
Hi,
1. Find your dockpane:
DockPane pane = FrameworkApplication.DockPaneManager.Find(_dockPaneID);
if (pane == null)
return;
2. Cast pane to you ViewModel class and access public property:
(pane as YourDockpaneViewModel).YourPropertyName = value;
Hi,
Thank you for the snippet. I was somehow close to your solution, did not do casting!
have a nice day,
Adam