Search code examples
c#windows-10-mobile

detect first app launch in windows 10


I am new to windows 10 application development. I want to show some details to user when only user launch the app for the first time. Please help me to solve this problem !!


Solution

  • Use ApplicationDataContainer and check for a boolean on startup.

    var localSettings = Windows.Storage.ApplicationData.Current.LocalSettings;
    if (localSettings.Values["HasStartedOnce"] == null) { 
        // (...do first-time-only things)
        localSettings.Values["HasStartedOnce"] = true;
    }