public static void ShowFileManager(Form owner) { using (var fileManager = new FileManagerWindow()) { _ = fileManager.ShowDialog(owner); } }
public MainWindow() { InitializeComponent(); if (!File.Exists(@"./Sheets/data.json")) { FileManagerWindow fmw = new FileManagerWindow(); MessageBox.Show("Отстутствует таблица! Пожалуйста, выполните загрузку."); fmw.ShowDialog(); } excelList = JsonConvert.DeserializeObject <List <ExcelRow> >(File.ReadAllText(@"./Sheets/data.json")); excelListShort = excelList.Cast <ExcelRowShort>().ToList(); PagedTable.PageIndex = 1; //Sets the Initial Index to a default value int[] recordsToShow = { 15, 30, 50, 100 }; //This Array can be any number groups foreach (int recordGroup in recordsToShow) { NumberOfRecords.Items.Add(recordGroup); //Fill the ComboBox with the Array } NumberOfRecords.SelectedItem = 15; //Initialize the ComboBox numberOfRecPerPage = Convert.ToInt32(NumberOfRecords.SelectedItem); //Convert the Combobox Output to type int DataTable firstTable = PagedTable.SetPaging(excelListShort, numberOfRecPerPage); //Fill a DataTable with the First set based on the numberOfRecPerPage dataGrid.ItemsSource = firstTable.DefaultView; //Fill the dataGrid with the DataTable created previously dataGrid.IsReadOnly = true; //Makes dataGrid ReadOnly }
public static void ShowFileManager(Form owner) { using FileManagerWindow fileManagerWindow = new FileManagerWindow(); fileManagerWindow.ShowDialog(owner); }