private async void AddTask() { try { if (string.IsNullOrWhiteSpace(ContentEntry.Text)) { await App.Current.MainPage.DisplayAlert("할 일 추가", "할 일을 입력해주세요.", "확인"); ContentEntry.Focus(); return; } if (string.IsNullOrWhiteSpace(CurrentIconPath)) { CurrentIconPath = "Resources/task.png"; } OnClosed?.Invoke(this, new AddTaskResult { Task = new TaskModel { IconPath = CurrentIconPath, Content = ContentEntry.Text.Trim(), Status = false } }); await PopupNavigation.Instance.RemovePageAsync(this); } catch (Exception ex) { App.DisplayEx(ex); } }
public AddTaskPopup(string currentTaskList) { InitializeComponent(); CurrentTaskList = currentTaskList; if (App.UseDarkMode) { MainFrame.BackgroundColor = Color.FromHex("333333"); } ContentEntry.Focus(); }