public App() { string fileName = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "korisnik.txt"); bool doesExist = File.Exists(fileName); if (!doesExist) { using (File.Create(fileName)) { } //Login } string tokenFileName = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "token.txt"); bool doesExistToken = File.Exists(tokenFileName); if (!doesExistToken) { using (File.Create(tokenFileName)) { } //Login } //Korisnik.Id = Guid.Parse("6ebb86dc-d316-4798-2f50-08d7c5ce7cbc"); Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense("MjQ5OTM0QDMxMzgyZTMxMmUzMG9hOXpiZHZhV3pkaWp5Vm5lbmdDeGFGY1BDYUZiQ3JzYVhWNE1qbis5U3M9"); InitializeComponent(); AppDomain.CurrentDomain.UnhandledException += (sender, args) => { System.Exception ex = (System.Exception)args.ExceptionObject; Console.WriteLine(ex); }; Token = File.ReadAllText(tokenFileName); if (!doesExist || Token == "") { MainPage = new LoginPage(); } else { var content = File.ReadAllText(fileName); Korisnik = JsonConvert.DeserializeObject <Korisnik>(content); MainPage = new KorisnikMainPage(); } }
public void UspjesanLogin() { MainPage = new KorisnikMainPage(); }