using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; namespace Tango.Scripting.IDE.Dialogs { /// /// Interaction logic for NewProjectDialog.xaml /// public partial class NewProjectDialog : Window { static string _sAddNewProjectTitle = "Add New Project"; static string _sNewProjectTitle = "New Project"; protected bool _bNewProject; public NewProjectDialog(bool bNewProject) { _bNewProject = bNewProject; InitializeComponent(); Title = bNewProject ? _sAddNewProjectTitle : _sNewProjectTitle; Loaded += DialogLoaded; } private void DialogLoaded(object sender, RoutedEventArgs e) { if (AddNewControl.DataContext is NewProjectDialogVM) { (AddNewControl.DataContext as NewProjectDialogVM).IsNewSolutionDialog = _bNewProject; } } private void CancelDialog(object sender, RoutedEventArgs e) { // Dialog box canceled DialogResult = false; } private void OKDialog(object sender, RoutedEventArgs e) { // Don't accept the dialog box if there is invalid data // if (!IsValid(this)) return; // Dialog box accepted DialogResult = true; } } }