public override StackPanel InsertInUIParent(StackPanel parent) { parent.Children.Add( new Label() { Content = questionNode.Label.ToString() } ); Value widgetValue; try { widgetValue = this.Evaluate(); } catch (DivideByZeroException divByZero) //constructivist: rollback { widgetValue = symbolTable.GetValue(questionNode.Identifier); } ValueToUIElement valueToUIElement = new ValueToUIElement(questionNode.Identifier.Name, questionNode.Computation != null); valueToUIElement.EventUpdateValue += base.EventUpdateValue; parent.Children.Add(widgetValue.Accept(valueToUIElement)); return(parent); }
public override StackPanel InsertInUIParent(StackPanel parent) { parent.Children.Add( new Label() { Content = questionNode.Label.ToString() } ); Value widgetValue; try { widgetValue = this.Evaluate(); } catch (DivideByZeroException divByZero) //constructivist: rollback { widgetValue = symbolTable.GetValue(questionNode.Identifier); } ValueToUIElement valueToUIElement = new ValueToUIElement(questionNode.Identifier.Name, questionNode.Computation != null); valueToUIElement.EventUpdateValue += base.EventUpdateValue; parent.Children.Add(widgetValue.Accept(valueToUIElement)); return parent; }