protected override async void OnAppearing() { base.OnAppearing(); await serverConnection.Connect(); await serverConnection.Request("GetAllProfiles"); }
private async Task SetDefaultProfile() { var profiles = new ClockProfile[] { GetDefaultProfile }; await serverConnection.Request("UpdateAllProfiles", JsonConvert.SerializeObject(profiles)); }
public void SaveProfile(ClockProfile profile) { if (Profile == null) { currentData.Profiles.Insert(0, profile); } else { int index = currentData.Profiles.IndexOf(Profile); if (index >= 0 && index < currentData.Profiles.Count) { currentData.Profiles[index] = profile; } } serverConnection.Request("UpdateAllProfiles", JsonConvert.SerializeObject(currentData.Profiles)); navigationService.NavigateAsync(nameof(ClockPage)); }