Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6358797
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:26:05+00:00 2026-05-24T23:26:05+00:00

When I use a custome page inheriting from PhoneApplicationPage instead of directly using it,

  • 0

When I use a custome page inheriting from PhoneApplicationPage instead of directly using it, the datepicker throws a null ref exception…

My custom class:

public class CustomPhoneApplicationPage : PhoneApplicationPage
{
  public CustomPhoneApplicationPage()
  {
      Loaded += CustomPhoneApplicationPageLoaded;
      IsAnimFromDisabled = false;
      IsAnimToDisabled = false;
      this.Tap += CustomPhoneApplicationPageTap;
      InitTransition();
  }
  private void InitTransition()
  {
    RenderTransform = new CompositeTransform();
    _comeInStoryboard = Application.Current.Resources["FadeIn"] as Storyboard;
    _comeOutStoryboard = Application.Current.Resources["FadeOut"] as Storyboard;
    Debug.Assert(_comeInStoryboard != null, "_comeInStoryboard != null");
    Debug.Assert(_comeOutStoryboard != null, "_comeOutStoryboard != null");
  }
}

The use of the date picker in the Xaml:

<toolkit:DatePicker x:Name="_dateTimePicker" Value="{Binding SnapshotTime, Mode=TwoWay}" />

The exception is thrown here:

Microsoft.Phone.Controls.Toolkit.dll!Microsoft.Phone.Controls.DataSource.GetPrevious(object relativeTo) + 0x7 bytes

Here is how I use this class as a base for my pages in the app:

public partial class AddOrEditData : CustomPhoneApplicationPage
{


    public AddOrEditData()
    {
        InitializeComponent();
        Loaded += AddOrEditDataLoaded;

    }
...
}

Here is the full stack trace:

Microsoft.Phone.Controls.Toolkit.dll!Microsoft.Phone.Controls.DataSource.GetPrevious(object relativeTo) Line 58 + 0x7 bytes C#
Microsoft.Phone.Controls.Toolkit.dll!Microsoft.Phone.Controls.Primitives.LoopingSelector.Balance() Line 146 + 0xd bytes C#
Microsoft.Phone.Controls.Toolkit.dll!Microsoft.Phone.Controls.Primitives.LoopingSelector.UpdateData() Line 552 + 0xc0 bytes C#
Microsoft.Phone.Controls.Toolkit.dll!Microsoft.Phone.Controls.Primitives.LoopingSelector.LoopingSelector_SizeChanged(object sender, System.Windows.SizeChangedEventArgs e) Line 365 C#
System.Windows.dll!System.Windows.FrameworkElement.OnSizeChanged(object sender, System.Windows.SizeChangedEventArgs e) + 0x15 bytes
System.Windows.dll!MS.Internal.JoltHelper.RaiseEvent(System.IntPtr target, uint eventId, System.IntPtr coreEventArgs, uint eventArgsTypeIndex) + 0xb2 bytes
[Native to Managed Transition]

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T23:26:06+00:00Added an answer on May 24, 2026 at 11:26 pm

    Ok,

    I solved it by adding this line of code to my inheriting page to disable some custom animation when leaving the page:

     protected override void OnNavigatingFrom(System.Windows.Navigation.NavigatingCancelEventArgs e)
        {
            IsAnimFromDisabled = e.Uri.OriginalString == @"/Microsoft.Phone.Controls.Toolkit;component/DateTimePickers/DatePickerPage.xaml";
            base.OnNavigatingFrom(e);
        }
    

    And it works !

    Thanks every one !

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to use custom exception handling, for example instead of using (Exception ex)
I integrated my vBulletin with custom front page. I'm wondering, how could I use
I want to use Custom URL Scheme to transfer data from application to other
I am using wordpress and use custom permalink structure: /%category%/%postname%/ My problem is that
I'm currently investigating the possibility to use custom attributes derived from ActionFilterAttribute. I want
I am trying to use custom error pages using redirects in IIS7. This is
I'm using the SPGridView in a custom page which has been deployed via SharePoint
I use the IE PrintTemplate to add custom page header/footer. The print template sample
I been trying to follow the example on this page: http://grysz.com/2010/06/01/use-custom-fonts-in-jasperreports-pdf-exporter/ Still, when I
I'm building a custom search page and attempting to use an existing custom search

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.