private void AddData()
        {
            Views.DataValidateView validateView = new Views.DataValidateView();
            DataModel             newData       = new DataModel();
            DataValidateViewModel validateVM    = new DataValidateViewModel(ref newData, ref validateView.passwordBox, new DataGenerator());

            validateView.DataContext = validateVM;
            validateView.ShowDialog();

            if (newData.Password != null)
            {
                CategoryModel currentCategory = OnNeededCurrentCategory?.Invoke();
                if (currentCategory == null)
                {
                    return;
                }

                try
                {
                    storageHandler.AddData(newData, currentCategory);
                }
                catch (FileNotFoundException ex)
                { MessageBox.Show($"File not found {ex.Message}."); }
                catch (InvalidOperationException ex)
                { MessageBox.Show($"Can't write data to file {ex.Message}."); }
                catch (Exception ex)
                { MessageBox.Show($"Something is wrong {ex.Message}."); }

                DataChanged();
            }
        }
        private void EditData()
        {
            DataModel newData = new DataModel {
                Date = SelectedData.Date, Description = SelectedData.Description, Login = SelectedData.Login, Password = SelectedData.Password
            };

            Views.DataValidateView validateView = new Views.DataValidateView();
            DataValidateViewModel  validateVM   = new DataValidateViewModel(ref newData, ref validateView.passwordBox);

            validateView.DataContext = validateVM;
            validateView.ShowDialog();

            if (!SelectedData.Equals(newData))
            {
                try
                {
                    storageHandler.ReplaceData(SelectedData, newData);
                }
                catch (FileNotFoundException ex)
                { MessageBox.Show($"File not found {ex.Message}."); }
                catch (InvalidOperationException ex)
                { MessageBox.Show($"Can't write data to file {ex.Message}."); }
                catch (Exception ex)
                { MessageBox.Show($"Something is wrong {ex.Message}."); }

                DataChanged();
            }
        }