Exemplo n.º 1
0
        public MainWindowViewModel(IViewServiceProvider viewServiceProvider, string startupFileName)
        {
            _viewService = viewServiceProvider;
            _errorMessages.CollectionChanged += (_, __) => HasErrorMessages = _errorMessages.Count > 0;
            _host     = new CsvEditSharpApi();
            Workspace = new CsvEditSharpWorkspace(_host, _errorMessages);

            ConfigurationDoc = new TextDocument(StringTextSource.Empty);
            QueryDoc         = new TextDocument(new StringTextSource("api.Query<FieldData>( records => records.Where(row => true).OrderBy(row => row) );"));

            CurrentFilePath   = string.Empty;
            CurrentFileName   = "(Empty)";
            CurrentConfigName = "(Empty)";
            SelectedTab       = 0;
            _startupFilePath  = startupFileName;
        }