public GeologyHatchLayersViewModel(Document doc)
        {
            acceptCommand = new RelayCommand(new Action <object>(Accept));

            string initialPath = defaultExcelPath == null?Path.GetDirectoryName(doc.Name) : defaultExcelPath;

            excelPathVM = new FileNameInputViewModel("Excel Files|*.xls;*.xlsx;", "Укажите путь к файлу Excel");

            сolumnNumberVM = new NumericUpDownViewModel(defaultColumnNumber, 1, 1, formatting: "f0");

            rowNumberVM = new NumericUpDownViewModel(defaultRowNumber, 1, 1, formatting: "f0");


            excelPathVM.FileNameChanged += OnFileNameChanged;
            //excelPathVM.FileNameChanged += SomethingDifferent;
            сolumnNumberVM.ValueChanged += SomethingDifferent;
            rowNumberVM.ValueChanged    += SomethingDifferent;


            excelPathVM.FileName = initialPath;

            if (defaultLayoutName != null)
            {
                DataTable item = Layouts.ToList().Find(dt => dt.TableName.Equals(defaultLayoutName));
                SelectedLayout = item;
            }
        }
Beispiel #2
0
 public void SaveLayouts()
 {
     Properties.Settings.Default.Layouts = JsonConvert.SerializeObject(Layouts.ToList(), Formatting.Indented, new LayoutsConverter());
     Properties.Settings.Default.Save();
 }