public MainWindowViewModel() { // Read the settings file to get the available profiles List<Profile> profiles = ProfileSettings.getProfiles(); _profilesView = new ProfilesViewModel(profiles); _comparisonView = new DbComparisonViewModel(); _comparisonView.OnComparisonComplete += new EventHandler<DatabaseComparisonEventArgs>((sender, args) => { StatusText = ""; foreach (TableComparison tableComp in args.Tables) { if (tableComp.LeftTable != null && tableComp.RightTable == null && tableComp.LeftTable.CreateStatement != null) { StatusText = StatusText + tableComp.LeftTable.CreateStatement + _sqlStatementDivider; } else if (tableComp.LeftTable != null) { StatusText = StatusText + tableComp.LeftTable.ToString() + _sqlStatementDivider; } } }); CopySqlToClipboardCommand = new AppCommand((sender) => CopySqlToClipboard(sender), (sender) => CanCopySqlToClipboard(sender)); }
public DbComparisonViewModel() { CompareSchemaCommand = new AppCommand(x => DoCompareSchemaCommand(x), x => CanDoCompareSchemaCommand(x)); ClearProfilesCommand = new AppCommand(x => DoClearProfilesCommand(x), x => CanDoClearProfilesCommand(x)); }