async Task Initialize() { notification = new NotificationManager(); favoriteList = new FavoriteList(false); watchdog = new Watchdog(); Debug.OnCatchLog += (l) => { Logs = l; }; await favoriteList.InitializeFavoriteList().ConfigureAwait(false); watchdog.OnAddUser += (l, u) => { try { OnAddUser(l, u); } catch (Exception e) { Debug.Log(e.ToString()); Debug.Log("Listing Error... Please Relogin"); throw; } }; watchdog.OnUpdateLocation += OnUpdateLocation; watchdog.OnLostUser += OnLostUser; watchdog.OnUpdateUser += OnUpdateUser; watchdog.OnLogout += OpenLoginDialog; isReloading = true; watchdog.OnUpdateFinish += ListFilterUpdate; await watchdog.InitializeUserList(() => { isReloading = false; watchdog.StartWatchdog(); }).ConfigureAwait(false); OnReloadClick = new DelegateCommand(() => { if (isReloading == false) { isReloading = true; watchdog.StopWatchdog(); watchdog.ReloadInstance(() => { Locations = new List <LocationList>(); FilterdLocationList = new ObservableCollection <LocationList>(); watchdog.InitializeUserList(() => { isReloading = false; watchdog.StartWatchdog(); }); }); } }); OnLogoutClick = new DelegateCommand(() => { ConfigData.UserName = ""; ConfigData.Password = ""; OpenLoginDialog?.Invoke(); }); OnTaskIconClick = new DelegateCommand(() => { OpenWindow?.Invoke(); }); }