public static void ShowTaskWindow(IWin32Window parent, string title, Control userControl, int secToClose)
        {
            if (singletonWindow != null)
            {
                singletonWindow.Close();
                singletonWindow.Dispose();
                singletonWindow = null;
            }

            singletonWindow = new MetroTaskWindow(secToClose, userControl);
            singletonWindow.Text = title;
            singletonWindow.Resizable = false;
            singletonWindow.StartPosition = FormStartPosition.Manual;
            
            if (parent != null && parent is IMetroForm)
            {
                singletonWindow.Theme = ((IMetroForm)parent).Theme;
                singletonWindow.Style = ((IMetroForm)parent).Style;
                singletonWindow.StyleManager = ((IMetroForm)parent).StyleManager.Clone() as MetroStyleManager;

                if (singletonWindow.StyleManager != null)
                    singletonWindow.StyleManager.Owner = singletonWindow;
            }

            singletonWindow.Show(parent);
        }
Example #2
0
        public static void ShowTaskWindow(IWin32Window parent, string title, Control userControl, int secToClose)
        {
            if (singletonWindow != null)
            {
                singletonWindow.Close();
                singletonWindow.Dispose();
                singletonWindow = null;
            }

            singletonWindow               = new MetroTaskWindow(secToClose, userControl);
            singletonWindow.Text          = title;
            singletonWindow.Resizable     = false;
            singletonWindow.StartPosition = FormStartPosition.Manual;

            if (parent != null && parent is IMetroForm)
            {
                singletonWindow.Theme        = ((IMetroForm)parent).Theme;
                singletonWindow.Style        = ((IMetroForm)parent).Style;
                singletonWindow.StyleManager = ((IMetroForm)parent).StyleManager.Clone() as MetroStyleManager;

                if (singletonWindow.StyleManager != null)
                {
                    singletonWindow.StyleManager.OwnerForm = singletonWindow;
                }
            }

            singletonWindow.Show(parent);
        }
Example #3
0
        public static void ShowTaskWindow(IWin32Window parent, string title, Control userControl, int secToClose)
        {
            if (singletonWindow != null)
            {
                singletonWindow.Close();
                singletonWindow.Dispose();
                singletonWindow = null;
            }

            singletonWindow = new MetroTaskWindow(secToClose, userControl);
            singletonWindow.Text = title;
            singletonWindow.Resizable = false;
            singletonWindow.StartPosition = FormStartPosition.Manual;

            IMetroForm parentForm = parent as IMetroForm;
            if (parentForm != null && parentForm.StyleManager != null)
            {
                ((IMetroStyledComponent)singletonWindow.metroStyleManager).InternalStyleManager = parentForm.StyleManager;
            }

            singletonWindow.Show(parent);
        }