-
Notifications
You must be signed in to change notification settings - Fork 11
Embedding UI controls in third party apps
Zev Spitz edited this page Jul 19, 2021
·
3 revisions
(This is overcomplicated; I hope to add some dependency properties on both controls to make this easier.)
You can embed the visualizer UI in your own applications:
- Install the ParseTreeVisualizer.UI.Standard NuGet package if you're using Antlr.Runtime.Standard; or the ParseTreeVisualizer.UI.Legacy if you're using the older Antlr.Runtime.
- Add the
ParseTreeVisualizer.VisualizerControl
to your XAML. - Create an instance of
ParseTreeVisualizer.Serialization.VisualizerData
; pass astring
,Antlr.Runtime.BufferedTokenStream
, orAntlr.Runtime.RuleContext
, or a derived instance, into the constructor. - Create an instance of
ParseTreeVisualizer.Serialization.Config
; set the options on this instance. - Create an instance of
ParseTreeVisualizer.VisualizerDataViewModel
using the aboveVisualizerData
andConfig
. - Set the
VisualizerDataViewModel
instance as theDataContext
of the control.
You can also similarly embed the settings control:
- Add the
ParseTreeVisualizer.SettingsControl
to your XAML. - Get an instance of
ParseTreeVisualizer.Serialization.Config
. - Create an instance of
ParseTreeVisualizer.ConfigViewModel
from theConfig
andVisualizerData
. - Set the
ConfigViewModel
as theDataContext
of the settings control.