I am working on a UserControl
, which is composed of a Chart
panel and another area which manipulates some of the chart data i.e. the chart controls (change color of graph, enable or disable stuff on the chart, etc.).
I use a ViewModel
to manage the chart and its data, but was thinking maybe it would be nice to make a separate usercontrol out of the chart control area to keep my xaml from getting to big and to separate out the components.
If I do this though, since the controls would need to manipulate the data from the Chart
ViewModel
, how should I approach it? Can I bind the DataContext
of the Chart
controls to the DataContext
of the Chart
, so I just have one ViewModel
? Should I give my chart control its own viewmodel and then have the chart panel and chart controls viewmodels talk somehow?
Or just forget about a separate usercontrol and stuff everything into one big viewmodel/xaml control?
What would people recommend in this case?