Exemplo n.º 1
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            TaskWindow taskWindow = new TaskWindow();

            taskWindow.ViewModel = "ViewModel";

            taskWindow.Owner = this;

            taskWindow.Show();


            foreach (Window window in App.Current.Windows)
            {
                window.Background = new SolidColorBrush(Colors.Red);

                // если окно - объект TaskWindow
                if (window is TaskWindow)
                {
                    window.Title = "Новый заголовок!";
                }
            }

            //foreach (Window window in this.OwnedWindows)
            //{
            //    window.Background = new SolidColorBrush(Colors.Red);

            //    if (window is TaskWindow)
            //        window.Title = "Новый заголовок!";
            //}
        }
Exemplo n.º 2
0
        private void exchange_rates(object sender, RoutedEventArgs e)
        {
            TaskWindow taskWindow = new TaskWindow();

            taskWindow.Owner = this;
            if (TaskWindow.WindowOpened && MiningSpace.WindowOpened && OptionWindow.WindowOpened && MiningCalc.WindowOpened)
            {
                taskWindow.Show();
                TaskWindow.WindowOpened = false;
            }
        }