Currently, the NuGet package consists of two controls:
VisualizerControl -- displays the parse tree nodes, token list, and source
SettingsControl -- UI for choosing the options in the Config
The current steps for using these controls involve:
- creating an instance of both
VisualizerData and Config from the ParseTreeVisualizer.Serialization namespace
- creating one viewmodel (
VisualizerDataViewModel or ConfigViewModel) for the corresponding control, using the previous instances. Note that both viewmodels require both instances.
- setting the
DataContext of the control to the viewmodel
Consider the native WPF DataGrid. There's a single dependency property which can be set either in code or by databinding; internal viewmodels are created by the DataGrid, and are recreated when the property value changes.
For VisualizerControl, we could expose two dependency properties: VisualizerData and Config. When either property is changed, create a new VisualizerDataViewModel off the new values, and set the control's DataContext to the new viewmodel.
Same for the SettingsControl.
How does the interaction between the two controls work? Presumably, changes to the SettingsControl properties would flow to the VisualizerControl.
Why can't we make use of the dependency properties in the debugging context as well?
Plan:
Usage:
- Bind SettingsControl.Config to VisualizerControl.Config
- Bind SettingsControl.VisualizerData VisualizerCotnrol.VisualizerData
- VisualizerControl.Source and VisualizerControl.Config can be set directly or bound from somewhere else.
Why in debugging visualizer is different?
- We don't have access to the Source.
- Related, but VisualizerData is only generated on the debuggee side.
Currently, the NuGet package consists of two controls:
VisualizerControl-- displays the parse tree nodes, token list, and sourceSettingsControl-- UI for choosing the options in the ConfigThe current steps for using these controls involve:
VisualizerDataandConfigfrom theParseTreeVisualizer.SerializationnamespaceVisualizerDataViewModelorConfigViewModel) for the corresponding control, using the previous instances. Note that both viewmodels require both instances.DataContextof the control to the viewmodelConsider the native WPF DataGrid. There's a single dependency property which can be set either in code or by databinding; internal viewmodels are created by the DataGrid, and are recreated when the property value changes.
For
VisualizerControl, we could expose two dependency properties:VisualizerDataandConfig. When either property is changed, create a newVisualizerDataViewModeloff the new values, and set the control's DataContext to the new viewmodel.Same for the
SettingsControl.How does the interaction between the two controls work? Presumably, changes to the SettingsControl properties would flow to the VisualizerControl.
Why can't we make use of the dependency properties in the debugging context as well?
Plan:
Diffmethod.Usage:
Why in debugging visualizer is different?