public Grid CreateContainer(IFormulaToken token)
        {
            // DataContext is misused to hold the template
            var container = new Grid {
                HorizontalAlignment = HorizontalAlignment.Left, DataContext = this
            };

            container.Children.Add(new TextBlock {
                Text = FormulaSerializer.Serialize(token)
            });
            container.SizeChanged += (sender, e) => UpdateMargin(container);
            return(container);
        }
 public object Convert(object value, Type targetType, object parameter, string language)
 {
     return(FormulaSerializer.Serialize((FormulaTree)value));
 }