I'm trying to load a layout, but I keep getting an error. "Object reference not set to an instance of an object."
See the layout xml below. I am handeling LoadingItemMapping, creating the tile and adding it to the TileControl's items and to the LoadingItemMappingEvenArgs.Item property. (Just like in the feature brower sample code.)
I'm not sure what else to do to make this work, any help would be great.
Saved layout:
<?xml version="1.0" encoding="utf-8" ?> <xamTilesControl assemblyVersion="10.2.20102.1014" layoutVersion="1"> <items> <item serializationId="RSSReader" isMaximized="true" maximizedIndex="0" logicalIndex="0" /> </items></xamTilesControl>
Exception Message: Object reference not set to an instance of an object.
Stack Trace:
at Infragistics.Windows.Internal.TileManager.get_Items() at Infragistics.Windows.Internal.TileManager.EnsureItemArrayIsAllocated() at Infragistics.Windows.Internal.TileManager.SortItems(IComparer`1 comparer) at Infragistics.Windows.Tiles.LayoutManager.LoadLayout(XamTilesControl tilesControl, Stream stream) at Infragistics.Windows.Tiles.LayoutManager.LoadLayout(XamTilesControl tilesControl, String layout) at Infragistics.Windows.Tiles.XamTilesControl.LoadLayout(String layout)
Hi Shaboboo,
Can you provide us with a simple project demonstrating the problem?
Thanks in advanced
Sincerely,
Horen Kirazyan
Sure, zip file added.
I'm probably missing a step somewhere but I just can't spot it. Thanks
In your code you load the layout in the constructor of the Window1 when the TilesControl is not completely loaded. I suggest you to move the layout and the loading code I mean this:
string layout = "<?xml version=\"1.0\" encoding=\"utf-8\" ?> <xamTilesControl assemblyVersion=\"10.2.20102.1014\" layoutVersion=\"1\"><items><item serializationId=\"RSSReader\" isMaximized=\"true\" maximizedIndex=\"0\" logicalIndex=\"0\" /> </items> </xamTilesControl>"; TilesControl.LoadLayout(layout);
into the Loaded event of the TilesControl. I have tried this and that worked for me.
Hope this solves your problem!