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

new RadFlipTileData() throws null error

3 Answers 67 Views
HubTile
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jonathan
Top achievements
Rank 1
Jonathan asked on 22 Mar 2013, 04:30 PM
For some reason the following creation of a new RadFlipTileData() is throwing a null reference error. Can someone explain why?

RadFlipTileData rftd= new RadFlipTileData()
                {
                    BackContent = "Title2",
                    Title = "Title",
                };

                LiveTileHelper.CreateOrUpdateTile(rftd, new Uri("/MainPage.xaml?Secondary=test", UriKind.Relative), true, true);

{System.NullReferenceException: Object reference not set to an instance of an object.
   at Telerik.Windows.Controls.FlipTileData..ctor()
   at Telerik.Windows.Controls.RadFlipTileData..ctor()
   at LockScreen.MainPage.pin_start_Click(Object sender, EventArgs e)}

3 Answers, 1 is accepted

Sort by
0
Todor
Telerik team
answered on 25 Mar 2013, 03:19 PM
Hello Jonathan,

Thank you for writing.

I created a simple project by using the code that you provided and didn't get the exception that you mentioned. I only got an exception when trying to use RadFlipTileData on a Windows Phone 7 emulator, but it is expected since as mentioned here these features are supported on Windows Phone 7.8 or newer. I have attached a video demonstrating the expected behavior, which you can open in your browser. If you notice that I'm missing something, please let me know. If you still get NullReferenceException, please open a new support ticket with attached sample project reproducing the undesired behavior so that we can assist you further.

Regards,
Todor
the Telerik team
Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
0
Jonathan
Top achievements
Rank 1
answered on 06 May 2013, 01:52 PM
Sorry to reopen an old post, but I ran into this problem again.

Here's a copy of the code
if (LiveTileHelper.AreNewTilesSupported)
                {
                     tileFlip= new RadFlipTileData()
                        {
                            Title = selectedP.tag,
                            BackgroundImage = new Uri(selectedP.pic, UriKind.Absolute),
                            Count = (int)selectedP.Cp,
                            BackTitle = selectedP.Score.ToString() ,
                            BackContent = selectedP.Status,
                            VisualElement = container,
                        };
                }
and the error I get:
{System.NullReferenceException: Object reference not set to an instance of an object.
   at Telerik.Windows.Controls.FlipTileData..ctor()
   at Telerik.Windows.Controls.RadFlipTileData..ctor()
   at Cheevos.MainPage.PreviousSearch_PinUser(Object sender, ContextMenuItemSelectedEventArgs e)
   at Telerik.Windows.Controls.RadContextMenuItem.OnSelected()
   at Telerik.Windows.Controls.RadContextMenuItem.OnManipulationCompleted(ManipulationCompletedEventArgs e)
   at System.Windows.Controls.Control.OnManipulationCompleted(Control ctrl, EventArgs e)
   at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName)}

this happens on the line: tileFlip= new RadFlipTileData()

Note: I AM using the windows phone 7 version of the controls, but I'm testing them on a windows phone 8 emulator since the features are implemented and supported on the wp7 telerik controls.
0
Deyan
Telerik team
answered on 09 May 2013, 03:12 PM
Hello Jonathan,

Thanks for writing back and please excuse us for the delay with our answer.

Can you please create a sample project that reproduces the exception and send it to us for further investigation?

This will help us directly debug the code and see what goes wrong.

Thanks for your time.

Regards,
Deyan
the Telerik team
Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
Tags
HubTile
Asked by
Jonathan
Top achievements
Rank 1
Answers by
Todor
Telerik team
Jonathan
Top achievements
Rank 1
Deyan
Telerik team
Share this question
or