Ejemplo n.º 1
0
		private void OnSelectedChanged(TableViewModel obj)
		{
			RefreshCommands();
		}
Ejemplo n.º 2
0
		private void OnAdd()
		{
			IsEnabled = false;

			CParserGenericAdapter proccesor = new CParserGenericAdapter();
			string path = CFileHelper.GetPathFromDialog();

			if (string.IsNullOrWhiteSpace(path))
			{
				IsEnabled = true;
				return;
			}

			IsLoading = true;

			ThreadPool.QueueUserWorkItem(new WaitCallback((par) =>
			{
				try
				{
					DataTable data = proccesor.GetDataTabletFromCSVFile(path);
					CTable table = CTable.Create(data);

					BeginInvoke(DispatcherPriority.Normal, () =>
					{
						SelectedTable = new TableViewModel(table);
						SelectedTable.State = enFormState.Create;
						SelectedTable.Current.Status = Status.Added;
						
						this.Tables.Add(SelectedTable);
						RaiseRefresh();
						this.RaisePropertyChanged(() => this.SelectedTableView);
					});
				}
				catch (Exception ex)
				{ }

				ChangeState(false);
			}));

		}
Ejemplo n.º 3
0
		private void LoadTable(TableViewModel target)
		{

			var country = Tables.FirstOrDefault(p => p.Id == target.Id);
			if (country != null)
			{
				SelectedTable = country;
				//eventAggregator.GetEvent<ComboChangeEvent>().Publish(SelectedCountry);
			}
		}