I am designing a WPF-panel inside a Rhino-application.
In some cases I think it would be very convenient to create a Rhino-command to keep my app a bit more tidy.
So what if my command needs to read data from let’s say a DataGrid in the WPF-panel?
Is it possible to access the panel and the DataGrids data?
Am I correct that I can access it via Rhino.UI.Panels? If so, does anyone have a hint how to achieve this?
Typically, if you’re creating a panel, there is only one instance of the panel. If you use the best-practice MVVM pattern to create the WPF panel, you could make a singleton pattern Model or ViewModel, with a WPF view to show the values to the user.
The same Model or ViewModel instance can than serve as data model for your command. If you’re consistently implementing the INotifyPropertyChanged interface on your view model, you can set the changed values in the command, and see their values updating in the panel.
(If anything sounds unfamiliar, start by searching for the terms in italics)