Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
625
xamFormulaEditorDialog - Object reference not set to an instance of an object
posted

I have followed the sample XAML code but am getting 'Object reference not set to an instance of an object' errors with the XamFormulaEditor. The XAML code is:

<Grid> <Grid.Resources> <ig:XamCalculationManager x:Key="CalculationManager" x:Name="CalcManager" FormulaCalculationError="CalcManager_FormulaCalculationError"></ig:XamCalculationManager> </Grid.Resources> <Grid.RowDefinitions> <RowDefinition Height="Auto"></RowDefinition> </Grid.RowDefinitions> <StackPanel> <TextBox x:Name="a" ig:XamCalculationManager.CalculationManager="{StaticResource CalculationManager}" Width="40"/> <TextBox x:Name="b" ig:XamCalculationManager.CalculationManager="{StaticResource CalculationManager}" Width="40"/> <TextBlock x:Name="FormulaString" ig:XamCalculationManager.CalculationManager="{StaticResource CalculationManager}"> <ig:XamCalculationManager.ControlSettings> <ig:ControlCalculationSettings Formula=""/> </ig:XamCalculationManager.ControlSettings> </TextBlock> <ig:XamFormulaEditor Target="{Binding ElementName=FormulaString}"/> </StackPanel> </Grid>

The error occurs when having clicked the Fx button to open the editor I double-click one of the nodes under controls so the formula becomes [//a] + [//b] and click OK. At that point the exception is thrown. The odd thing is that the exception is not thrown all the time. Sometimes the formula [//a] + [//b] will work correctly.