private void OpenForeignDB(object sender, RoutedEventArgs e)
        {
            var DbFile = new Microsoft.Win32.OpenFileDialog() { Filter = "DataBase Files (*.db)|*.db" };
            var result = DbFile.ShowDialog();

            if ((bool)result)
            {
                var file = DbFile.FileName;

                ForeignDB = new DbHandle(new SQLIteClient("", "", "", @file));

                ForeignColection = new CookingBookDataCollection(ForeignDB);

                ForeignColection.GetAll();

                ForeignDbListViev.ItemsSource = ForeignColection.ListOfRecipes;

                CollectionView ForeignRecipeViev = (CollectionView)CollectionViewSource.GetDefaultView(ForeignDbListViev.ItemsSource);
                ForeignRecipeViev.Filter = (item => (String.IsNullOrEmpty(ForeignRecipeFilterText.Text) ? true : ((item as Recipe).Name.IndexOf(ForeignRecipeFilterText.Text, StringComparison.OrdinalIgnoreCase) >= 0)));
                OpenedName.Text = @DbFile.SafeFileName;
            }
            else
            {
                MessageBox.Show("dsfgds");
            }
        }
        public MigrationBase2Base(IDbHandle dbCli)
        {
            InitializeComponent();

            MainDB = dbCli;

            MainColection = new CookingBookDataCollection(dbCli);
            
            MainColection.GetAll();

            MainDbListViev.ItemsSource = MainColection.ListOfRecipes;

            CollectionView MainRecipeViev = (CollectionView)CollectionViewSource.GetDefaultView(MainDbListViev.ItemsSource);
            MainRecipeViev.Filter = (item => (String.IsNullOrEmpty(MainRecipeFilterText.Text) ? true : ((item as Recipe).Name.IndexOf(MainRecipeFilterText.Text, StringComparison.OrdinalIgnoreCase) >= 0)));

        }
        public RecipesWindow(IDbHandle dbCli)
        {
            InitializeComponent();

            DbCli = dbCli;

            DataCollection = new CookingBookDataCollection(DbCli);

            MainGrid.DataContext = CookinBookDictionary.Instance.GetNames(MainWindow.SelectedLanguage);
           
            RecipeListViev.ItemsSource = DataCollection.GetFullRecipeList();
            AllComponentsViev.ItemsSource = DataCollection.GetFullComponentList();

            CollectionView RecipeViev = (CollectionView)CollectionViewSource.GetDefaultView(RecipeListViev.ItemsSource);
            RecipeViev.Filter = (item => (String.IsNullOrEmpty(RecipeFilterText.Text) ? true : ((item as Recipe).Name.IndexOf(RecipeFilterText.Text, StringComparison.OrdinalIgnoreCase) >= 0)));
            CollectionView ComponentViev = (CollectionView)CollectionViewSource.GetDefaultView(AllComponentsViev.ItemsSource);
            ComponentViev.Filter = (item => (String.IsNullOrEmpty(ComponentsFilterText.Text) ? true : ((item as Component).Name.IndexOf(ComponentsFilterText.Text, StringComparison.OrdinalIgnoreCase) >= 0)));

        }
        public ComponentsWindow(IDbHandle dbCli)
        {
            InitializeComponent();
           
            CookingBookLanguageSelect.ChangeLanuage(MainWindow.SelectedLanguage, this);

            DbCli = dbCli;
           
            Components = new CookingBookDataCollection(DbCli);

            ComponentsListViev.ItemsSource = Components.GetFullComponentList();

            CollectionView ComponentViev = (CollectionView)CollectionViewSource.GetDefaultView(ComponentsListViev.ItemsSource);
            ComponentViev.Filter = ComponentFilter;

        }