private bool determineIsUpgrade(ApplicationDataContainer container, PackageVersion packageVersion) { var persistedAppVersion = LastApplicationVersion; if (persistedAppVersion == null) { return(false); } var currentAppVersion = ApplicationInfoBuilder.GetAppVersion(packageVersion); return(!(currentAppVersion.Equals(persistedAppVersion))); }
public void Initialize(PackageVersion packageVersion) { dataContainer = ApplicationData.Current.LocalSettings.CreateContainer(options.DataContainer, ApplicationDataCreateDisposition.Always); IsFirstRun = determineIsFirstRun(dataContainer); if (IsFirstRun) { FirstRunTimeMillis = DateTimeOffset.Now.ToUnixTimeMilliseconds(); } IsUpgrade = determineIsUpgrade(dataContainer, packageVersion); LastApplicationVersion = ApplicationInfoBuilder.GetAppVersion(packageVersion); }