Current filter:
                                You should refresh the page.
                                0
                                  • Hi,

                                    I've added a NavBar to my application (in MainPage), and within the navbar content have added a listbox, but when I try to add elements to the listbox I get exception 'Object reference not set to an instance of an object.'. a section of the xaml, containing the listbox is:

                                                    <dxn:NavBarGroup IsExpanded="True" Header="Workspaces" DisplaySource="Content" ImageSource="/DemoApp;component/Images/layout_32x32.png" >
                                                            <dxn:NavBarGroup.Content>
                                                               <Grid>
                                                                    <Grid.Resources>
                                                                        <my:WorkSpaces x:Key="workspaces"/>
                                                                    </Grid.Resources>
                                                                    <StackPanel Orientation="Vertical">
                                                                        <StackPanel Orientation="Horizontal" Margin="5,15,0,0">
                                                                            <Button Click="captureWorkspace_Click">
                                                                                <Image Source="/DemoApp;component/Images/camera.png" />
                                                                            </Button>
                                                                            <Button>
                                                                                <Image Source="/DemoApp;component/Images/Add_32x32.png" />
                                                                            </Button>
                                                                            <Button>
                                                                                <Image Source="/DemoApp;component/Images/close-32x32.png" />
                                                                            </Button>
                                                                            <Button>
                                                                                <Image Source="/DemoApp;component/Images/save-32x32.png" />
                                                                            </Button>
                                                                            <Button>
                                                                                <Image Source="/DemoApp;component/Images/open-32x32.png" />
                                                                            </Button>
                                                                        </StackPanel>
                                                                        <ListBox x:Name="workspaces" Margin="5" BorderBrush="Black" BorderThickness="1" />
                                                                    </StackPanel>
                                                                </Grid>
                                                            </dxn:NavBarGroup.Content>
                                                        </dxn:NavBarGroup>

                                    On pressing one of the buttons defined, captureWorkspace_Click is called, which adds to the listbox using:

                                        workspaces.Items.Add("Default");

                                    this is where the exception is raised.

                                    I've tried placing the listbox onto Mainpage itself, rather than within the Navbar, and all works OK, so it seems to be
                                    an issue when the listbox is contained within the Navbar.

                                    Any help would be appreciated

                                0

                                Hello Chris,

                                Thank you for reporting this issue. I've reproduced the problem and converted your question to a bug report.

                                Best Regards,
                                Nathan

                                You must  log in  or  register  to leave an answer

                                Is your intention to post an answer to your own question?

                                • If so, then proceed.
                                • If you simply wanted to post additional information, ask for further clarification, or to just say "Thanks!", please click Leave a Comment.
                                • If you wish to edit your original question, please use the Edit button in the Toolbox at the top right corner of that entry.