This is a migrated thread and some comments may be shown as answers.

Bug Report (2010_Q3) Another Null Reference

1 Answer 25 Views
TileView
This is a migrated thread and some comments may be shown as answers.
Alex Fan
Top achievements
Rank 1
Alex Fan asked on 08 Mar 2011, 12:35 AM
Hi

I just find another case that will cause Null Reference, please reuse the code in my previous post
http://www.telerik.com/community/forums/silverlight/tileview/bug-report-2010-q3-null-reference.aspx
but this time it is to do with "PreservePositionWhenMaximized" property

In the code, there is a tile view model collection in the main view model to generate all tiles. First please remove the binding to TileState property to demonstrate this is an unrelated new bug. Then please set PreservePositionWhenMaximized="true" in xaml and add a button that will regenerate different view model collection (in my case i always create a new collection with 4 tile view models), you will find that:
1, if all current tiles are restored, clicking the button will be fine
2, if first tile is maximized, clicking the button is also fine
3, if not-first tile is maximized, clicking the button will raise NullReferenceException

Regards,
Alex

1 Answer, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 10 Mar 2011, 02:17 PM
Hello Alex Fan,

Thank you for the bug report. This issue is present in the older versions of the RadTileView but is fixed in the Q1 Beta. The problem is again related to the MaximizedItem and an easy work around is to set it to null before you change the view model collection:
this.myTileView.MaximizedItem = null;
this.DataContext = new MainViewModel(4);



Best wishes,
Petar Mladenov
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Tags
TileView
Asked by
Alex Fan
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Share this question
or