Beispiel #1
0
        private void DateItem_Click(object sender, RoutedEventArgs e)
        {
            DateTimeWindow std = new DateTimeWindow();

            if (window != null)
            {
                window.Close(); window = null;
            }
            window = std;
            window.Show();
            window.Activate();
        }
Beispiel #2
0
        private void OpLv_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            int index = OpLv.SelectedIndex;

            switch (index)
            {
            case 0:
            {
                StdCackWindow std = new StdCackWindow();
                if (window != null)
                {
                    window.Close(); window = null;
                }
                window = std;
                window.Show();
                window.Activate();
                break;
            }



            case 1:
            {
                DigitalWindow std = new DigitalWindow();
                if (window != null)
                {
                    window.Close(); window = null;
                }
                window = std;
                window.Show();
                window.Activate();
                Close();
                break;
            }

            case 2:
            {
                ConverterWindow window = new ConverterWindow();
                if (converter == null)
                {
                    converter = window;
                    converter.Show();
                    converter.Activate();
                }
                else
                {
                    converter.Close();
                    converter = window;
                    converter.Show();
                    converter.Activate();
                }
                break;
            }

            case 3:
            {
                DateTimeWindow std = new DateTimeWindow();
                if (window != null)
                {
                    window.Close(); window = null;
                }
                window = std;
                window.Show();
                window.Activate();

                break;
            }

            case 4:
            {
                ColorWindow std = new ColorWindow();
                if (window != null)
                {
                    window.Close(); window = null;
                }
                window = std;
                window.Show();
                window.Activate();
                break;
            }

            case 5:
            {
                ConstFormWindow window = new ConstFormWindow();
                if (ConstWindow == null)
                {
                    ConstWindow = window;
                    ConstWindow.Show();
                    ConstWindow.Activate();
                }
                else
                {
                    ConstWindow.Close();
                    ConstWindow = window;
                    ConstWindow.Show();
                    ConstWindow.Activate();
                }
                break;
            }
            }
            OpLv.Visibility = Visibility.Hidden;
        }