I have a screen with some data. Inside the screen I have two custom controls (on the left and right side).
What I need to do is the following:
Bind some data from a database to some Controls in the first Custom control. (fill a list, combobox etc, not so much the problem)
The user then can select an entry in the list, press a button -> the second CustomControl should now be made visible; request some data from the DB, based on the selection and dynamicly create and show a Chart.
So I know how to build the chart and build the Controls. But how can I access the Data from the screen through code and access another CustomControl from within the first CustomControl?
Edit:
Things I found out.
Access control from screen
this.FindControl("yourControl");
Do something with the control:
this.FindControl("yourControl").ControlAvailable += ( (o,e) => { YourControlType myControl = e.Control as YourControlType; });
Access screen data
IContentItem dataContext = this.DataContext as IContentItem; IScreenObject screen = dataContext.Screen; IScreenProperty prop = screen.Details.Properties["yourProperty"]; VisualCollection<yourProperty> items = prop.Value as VisualCollection<yourProperty>;
Show new screen
Application.Current.Details.Dispatcher.BeginInvoke(() => Application.Current.ShowGraphScreen(reportItem.BlockID));
Maybe this will help someone.
Application.common
of the client app, combined with your examples, was a great help. – Hogtie