public void Validate(object sender) { TextBlock txt = new TextBlock(); if (CvName.Text == "") { txt.Text = "Veuillez renseigner un nom."; txt.Foreground = (Application.Current as App).Resources["CloVisOrange"] as SolidColorBrush; } else if ((Application.Current as App).ExistResume(CvName.Text)) { txt.Text = "Ce nom est déjà utilisé"; txt.Foreground = (Application.Current as App).Resources["CloVisOrange"] as SolidColorBrush; } else { //ajouter le nom au CV CV_name = CvName.Text; if (Window.Current.Content is Frame f && f.Content is EditionMode root) { root.IsModified = false; this.Result = SavingTemplateResult.Validate; this.Hide(); } return; } var fo = new Flyout() { Content = txt }; fo.ShowAt(CvName); }
public PreventSavingTemplateWithoutNameDialog() { this.InitializeComponent(); Result = SavingTemplateResult.NotValidate; }