Ejemplo n.º 1
0
        internal LoaderWindow(ViewModels.LoaderViewModel viewModel)
        {
            DataContext    = viewModel;
            this.ViewModel = DataContext as ViewModels.LoaderViewModel;
            InitializeComponent();

            DataTypePropBox.SelectedIndex = 0;
        }
Ejemplo n.º 2
0
        public MainWindowViewModel()
        {
            LaunchLoaderWindow = new RelayCommand((o) => { return(true); }, (o) => {
                LoaderViewModel lvm = new LoaderViewModel(this);
                LoadingFileCommand loadingFileCommand = new LoadingFileCommand(lvm, this);
                lvm.LoadFileCommand = loadingFileCommand;
                lvm.LaunchViewCommand.Execute(this);
            });

            Metadatas = FakeDataFactory.TEMP_GenerateMeta();
            RaisePropertyChangedEvent(nameof(ColumnNames));
        }
Ejemplo n.º 3
0
        public void LoadData(LoaderViewModel lvm)
        {
            List <Type>   dataTypes   = new List <Type>();
            List <string> columnNames = new List <string>();

            foreach (var meta in lvm.metadataDefinitionVM.MetadataCollection)
            {
                dataTypes.Add(meta.ColumnDataType);
                columnNames.Add(meta.ColumnName);
            }
            Metadatas = lvm.metadataDefinitionVM.MetadataCollection.ToArray();
            Importer  = new CsvImporter(lvm.FilePath, dataTypes.ToArray(), lvm.SeparatorChar[0]);

            if (ViewGenerateColumns != null)
            {
                ViewGenerateColumns(Metadatas);
            }

            // Trying smt 'creative' here...
            RaisePropertyChangedEvent(nameof(ColumnNames));
            RaisePropertyChangedEvent(nameof(AllData));
        }