Application.Current.Properties properties not persisting between application runs

IanGeogheganIanGeoghegan USUniversity ✭✭
edited September 2015 in Xamarin.Forms

This behavior persists with the latest (1.5.0.6447) release of Forms and I have filed a bug on it with reproduction steps here:

https://bugzilla.xamarin.com/show_bug.cgi?id=33630

Can anyone confirm that they are experiencing the same behavior? Thanks.

Posts

  • DavidStrickland0DavidStrickland0 USMember ✭✭✭

    Note: Just noticed that your working on a Mac and make a reference to IOS down in your reproduction steps so knowing it works on Android might not be much help :D.

    Tried this in Xamarin Studio 5.9.6(windows) testing with a Samsung GT-S5301 the functionality for me appears to work as I would expect. I did however have to make a change to the code posted in the bug report to get it to work.

    Changed:
    if( !Properties.ContainsKey( "testKey" ) )
    {
    Debug.WriteLine( "TestKey not found in properties; creating accordingly. || App.OnStart()" );
    Properties.Add( TestKey, "Test key!!!" );
    SavePropertiesAsync();
    }
    To:
    if( !Properties.ContainsKey( "testKey" ) )
    {
    Properties.Add( "testKey", "Test key!!!" );
    SavePropertiesAsync();
    }

    I put a break point on Properties.Add it dropped into the if on the first run. I stopped the app and reran it from the IDE and it bypassed the code the second time.

    Your issue caught my eye because implementing Properties in an app is on my todo list today. If I have any issues I'll update here but as it sits it looks like it should full-fill my needs.

Sign In or Register to comment.