public Login(EnvDTE80.DTE2 dte, Settings settings) { WifDetector.CheckForWifInstall(); InitializeComponent(); var main = dte.GetMainWindow(); this.Owner = main; //Loaded += delegate { this.CenterWindow(main); }; this.settings = settings; this.txtPassword.Password = settings.Password; // PasswordBox doesn't allow 2 way binding this.DataContext = settings; }
public AddTemplate(EnvDTE80.DTE2 dte, Project project) { InitializeComponent(); var main = dte.GetMainWindow(); this.Owner = main; //Loaded += delegate { this.CenterWindow(main); }; _Props = new AddTemplateProp(); this.DataContext = Props; var samplesPath = System.IO.Path.Combine(DteHelper.AssemblyDirectory(), @"Resources\Templates"); var dir = new DirectoryInfo(samplesPath); Props.TemplateList = new ObservableCollection <String>(dir.GetFiles().Select(x => x.Name).Where(x => !x.Equals("_Blank.tt")).ToArray()); Props.Template = "CrmSchema.tt"; Props.Folder = project.GetProjectDirectory(); }