The main window of the application, containing the Account List.
Наследование: BaseWindow
        /// <summary>
        /// Called when the "Create new file" command button is clicked.
        /// </summary>
        private void NewFileCommand_Clicked(object sender, RoutedEventArgs e)
        {
            SaveFileDialog sfd = new SaveFileDialog();
            sfd.AddExtension = true;
            sfd.Filter = "TrialBalance data files (*.tbdx)|*.tbdx";
            sfd.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
            sfd.OverwritePrompt = true;
            sfd.Title = "New TrialBalance File";

            bool? dr = sfd.ShowDialog(this);
            if (dr ?? true) {
                PackageDataProvider dataProvider = PackageDataProvider.CreateFile(sfd.FileName);
                Workbook workbook = new Workbook(dataProvider);

                MainWindow mainWindow = new MainWindow(workbook);
                Application.Current.MainWindow = mainWindow;

                this.Close();
                mainWindow.Show();
            }
        }
        /// <summary>
        /// Called when the "Open a previous file" command button is clicked.
        /// </summary>
        private void OpenFileCommand_Clicked(object sender, RoutedEventArgs e)
        {
            OpenFileDialog ofd = new OpenFileDialog();
            ofd.Filter = "TrialBalance Data Files (*.tbdx)|*.tbdx|All Files (*.*)|*.*";
            ofd.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
            ofd.Title = "Open TrialBalance File";

            bool? dr = ofd.ShowDialog(this);
            if (dr ?? true) {
                PackageDataProvider dataProvider = PackageDataProvider.OpenFile(ofd.FileName);
                Workbook workbook = new Workbook(dataProvider);

                MainWindow mainWindow = new MainWindow(workbook);
                Application.Current.MainWindow = mainWindow;

                this.Close();
                mainWindow.Show();
            }
        }