示例#1
0
	    private void DownloadAndLoadDataIntoViewModel()
	    {
            downloadStringService.DownloadAsync(new Uri("../Services/NoSql/Databases.ashx", UriKind.Relative), data =>
            {
                var databases = Collection.Parse(data);
                foreach (var databaseDoc in databases.Documents.OrderBy(d => d["Name"].Value<Object>()))
                {
                    var databaseViewModel = new DatabaseViewModel()
                    {
                        Name = databaseDoc["Name"].Value<String>()
                    };
                    foreach (var collectionDoc in databaseDoc["Collections"])
                    {
                        databaseViewModel.Collections.Add(new CollectionViewModel()
                        {
                            Name = collectionDoc["Name"].Value<string>() 
                        });    
                    }
                    GraphSettingsViewModel.Databases.Add(databaseViewModel);

                    MapConfigurationToViewModel();
                }
            });
	    }
		public DatabaseViewModelController(DatabaseViewModel viewModel)
		{
			this.viewModel = viewModel;
		}
示例#3
0
		public GraphSettings()
		{
			Databases = new ObservableCollection<DatabaseViewModel>();
			SelectedDatabase = new DatabaseViewModel();
			SelectedCollection = new CollectionViewModel();
			AvailableProperties = new ObservableCollection<string>();
						Graph = new Graph();
	
			Save = new DelegateCommand();
			Refresh = new DelegateCommand();
			Test = new DelegateCommand();
			Cancel = new DelegateCommand();
		
			ApplyDefaultConventions();
		}