another bug detected

Nov 29, 2011 at 7:53 AM

The one I discovered regarding binding seems to be fixed but there is still on little issue. for example if u do not specify largitemcount it only shows three items there but this is not as important as the one I discovered yesterday. when u open panel options windows and try to move up or down items or even simple open it an click Ok button there is a exception which says object reference is not set to the instance of the object. here is the line throwing this ecxeption

   NavigationPaneItem selItem = (nav.SelectedItem is NavigationPaneItem ? nav.SelectedItem :
    nav.ItemContainerGenerator.ContainerFromItem(nav.SelectedItem)) as NavigationPaneItem;

 

try to run demo app an drug splitter to minimize items u get object reference exception (line cosing this is

 lastLargeItemHeight = (navigationPane.ItemContainerGenerator.ContainerFromIndex(index) as FrameworkElement).RenderSize.Height;

this is really bugs and needs to be fixed ASAP.

I had no chance to thank u for this control and despite these bugs initial release version 1.0 is really brilliant.

Coordinator
Nov 29, 2011 at 10:35 AM

Hi taicodev

This bug too was related to the changes that caused the other one
In short in some cases item was not recognized as a NavigationPaneItem, causing the errors.
This should be fixed in latest sources, I added some checks to ensure items are always recognized. 

I should thank you for reporting... if you find any other bugs let me know.
0xfefi

Nov 29, 2011 at 1:34 PM

Good it seems to be fixed now but my question is, why it only shows 3 items if one does not specify LargeItems count? is not it easier to show all items what DataBinding takes place? another suggestion might be to create DependencyProperty for NavigationPanelItem which would indicate if it is minimized or not if this second suggestion requiters addition coding u can just implement function to show all items if count is not specified. 

Coordinator
Nov 29, 2011 at 3:27 PM

In fact this is because of the way the subdivision of the items works.. To be able to use a single collection of items and not two separate collections, the solution was to simply have a integer position indicating to the panels ( small buttons and biggerbuttons ) where to start and stop displayng items from the same collection.
So i picked up a default value of 3.

Having the property on the would need a totlly different approch, which could end up with having two separated collections.

Could be an idea though increse the default value to an acceptable value, 10 perhaps is good value.
Or even having the value -1 as all items. But if the control is databinded to a data source with 100 data records, it would mean that the control will pratically have just buttons.

Largeitems could be set to a really high value in the window, if the navigation pane is expected to have a large number of items.
1000 as an example, if the number of items is known to not exceed 1000, will always show all items.

I think I'll implement the -1 feature have the possibility to show all items... but always having a default value > 0, maybe with a bigger value than 3.
0xfefi

Coordinator
Nov 29, 2011 at 3:30 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.