protected override async Task onSelected()
 {
     _wrkspc = new CollectionWrkspcVM(this._model, this);
     _wrkspc.IsView = this.IsView;
     if (View != null && this.IsView)
     {
         _wrkspc.Collection.Filter = View.Filter;
         _wrkspc.Collection.Columns = new System.Collections.ObjectModel.ObservableCollection<PropertyDefinitionModel>(View.Columns);
         _wrkspc.Collection.SqlText = View.SqlText;
         _wrkspc.Collection.IsSqlEditMode = View.IsSqlEditMdoe;
         _wrkspc.IsSqlVisible = View.IsSqlVisible;
     }
     this.Main.CurrentWorkspace = _wrkspc;
     await _wrkspc.Refresh();
     if (this.IsView)
         Config.Instance.SelectedCollectionViewModel = this.View;
     Config.Instance.SelectCollection(_model.Name, _model.Database.Name, _model.Database.Account.Endpoint, (this.IsView) ? this.View.ViewName : null);
     await base.onSelected();
 }
 public CollectionVM(CollectionModel model, CollectionWrkspcVM wrkspc)
 {
     _model = model;
     Workspace = wrkspc;
     Filter = new CollectionFilterData();
     Columns = new ObservableCollection<PropertyDefinitionModel> { new PropertyDefinitionModel { Name = "id", Path="id", Type = Enums.PropertyType.String } };
     this.AvailableProperties = new ObservableCollection<PropertyDefinitionModel>();
     this.MaxItems = 20;
 }