public Itembar() { this.DataContext = this; InitializeComponent(); TitleTextBox.Visibility = Visibility.Visible; TitleTextBlock.Visibility = Visibility.Collapsed; CheckboxGrid.IsEnabled = false; StarToggle.IsEnabled = false; TitleTextBox.Focus(); SaveNewTask?.Invoke(this, EventArgs.Empty); }
//Check if user can enter title, if they can, set new title private void Set_NewTitle() { if (TitleTextBox.Visibility == Visibility.Visible) { if (TitleTextBox.Text != string.Empty) { Title = TitleTextBox.Text; TitleTextBlock.Visibility = Visibility.Visible; TitleTextBox.Visibility = Visibility.Collapsed; CheckboxGrid.IsEnabled = true; StarToggle.IsEnabled = true; SaveNewTask?.Invoke(this, EventArgs.Empty); } else { Remove?.Invoke(this, EventArgs.Empty); } } }