public void Init()
        {
            //client.RegisterToServer("*****@*****.**", "David@1&1.de", "David@1&1.de").Wait();

            //Doujin_Interface.Properties.Settings.Default.User = null;

            //-----------------------------------------------------------------------------
            //For Damian
            //On stackoverflow they said the way the task is called migth cause deadlock so it might be a good idea to start looking here
            //-------------------------------------------------------------------------------
            DoujinUtility.MainWindow = this;
            DoujinUtility.MainWindow.animatedBrush.Color = Color.FromArgb(255, 138, 0, 219);
            //var test = new HIDoujin("Bokurano@Mii-chan | Our @Mii-chan","english", 1278968);

            //test2.AddObject("petenshi",Doujin_Interface.UpdateFeed.Types.Arist);
            //(throw new NotImplementedException();

            //Application.Current.Resources["UiDarkGray"] = new SolidColorBrush(Color.FromArgb(100, 200, 20, 20));
            //Color.FromArgb(100, 200, 20, 20);
            this.KeyDown += MainWindow_KeyDown;
            this.KeyUp   += MainWindow_KeyUp;

            var searchElement = new SE();

            search = SE.CreateSearchElement(picgrid, rootGrid, this);
            rootGrid.Children.Add(search);

            registerAndLoginElement = new RegisterElementE();
            rootGrid.Children.Add(registerAndLoginElement);
            registerAndLoginElement.Visibility = Visibility.Hidden;
            accountElement = new AccountElement();
            rootGrid.Children.Add(accountElement);
            accountElement.Visibility = Visibility.Hidden;
            accountElement.Margin     = new Thickness(52, 0, 0, 0);
            rootGrid.Children.Add(notifyer);


            //has to be added last
            var navBar = new NavBar();

            rootGrid.Children.Add(NavBar.CreateNavBar(this));

            Thickness margin = settingElement.Margin;

            margin.Left           = 283;
            settingElement.Margin = margin;
            rootGrid.Children.Add(settingElement);

            if (File.Exists(DatabaseControler.favDataPath))
            {
                DatabaseControler.favorites.ReadXml(DatabaseControler.favDataPath);
                foreach (var row in DatabaseControler.favorites)
                {
                    row.favorite = true;
                    favId.Add(row.nHentaiID);
                    favDoujin.Add(DoujinUtility.DataRowToDoujin(row));
                    Console.WriteLine("fav added to list " + row.nHentaiID);
                }
            }
            if (File.Exists("cache.xml"))
            {
                DatabaseControler.doujinCache.ReadXml("cache.xml");
            }
            //Page(1);
        }