Exemple #1
0
        public MainWindow()
        {
            InitializeComponent();
            SetLanguageDictionary();

            tvm = (ViewModel.TsunamiViewModel)FindResource("TsunamiVM");

            titleBlock.Text = Title + " " + Settings.Application.TSUNAMI_VERSION;

            Closing += Window_Closing;

            Classes.Switcher.PageSwitcher = this;

            if (ViewModel.TsunamiViewModel.TorrentList.Count > 0)
            {
                // we have torrent, switch to download list
                Classes.Switcher.Switch(_listPage);
            }
            else
            {
                Classes.Switcher.Switch(_addPage);
            }
        }
Exemple #2
0
        private void ApplicationInitialize(ViewModel.TsunamiViewModel tsunamiVM)
        {
            // wait for tsunami fast resume
            while (!tsunamiVM.IsTsunamiEnabled)
            {
                Thread.Sleep(500);
            }

            // wait something else
            tsunamiVM.StringLoading = "Elaborating...";
            Thread.Sleep(2000);

            // Create the main window, but on the UI thread.
            Dispatcher.BeginInvoke(DispatcherPriority.Normal, (Invoker) delegate
            {
                //Current.MainWindow.Hide();
                Current.MainWindow.Close();
                Current.MainWindow = null;
                Current.MainWindow = new Tsunami.MainWindow();
                Current.MainWindow.Show();
                SquirrelUpdate();
            });
        }