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" >
<StackPanel Orientation="Horizontal" Margin="5,15,0,0">
<Image Source="/DemoApp;component/Images/camera.png" />
<Image Source="/DemoApp;component/Images/Add_32x32.png" />
<Image Source="/DemoApp;component/Images/close-32x32.png" />
<Image Source="/DemoApp;component/Images/save-32x32.png" />
<Image Source="/DemoApp;component/Images/open-32x32.png" />
<ListBox x:Name="workspaces" Margin="5" BorderBrush="Black" BorderThickness="1" />
On pressing one of the buttons defined, captureWorkspace_Click is called, which adds to the listbox using:
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
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.