Esempio n. 1
0
        public static T GetContainer <T>(TestWindowCreate create) where T : TestWindow
        {
            if (!IsAllowStaticContainer)
            {
                return(create() as T);
            }
            T res = StaticContainers[typeof(T)] as T;

            if (res == null)
            {
                res = create() as T;
                ClearThemeName(res);
                res.Show();
                StaticContainers[typeof(T)] = res;
            }
            else
            {
                res.Content = null;
                ClearThemeName(res);
                res.WindowState = WindowState.Normal;
                if (!double.Equals(double.NaN, res.Width))
                {
                    res.ClearValue(FrameworkElement.WidthProperty);
                }
                if (!double.Equals(double.NaN, res.Height))
                {
                    res.ClearValue(FrameworkElement.HeightProperty);
                }
            }
            return(res);
        }
Esempio n. 2
0
 public static T GetContainer <T>(TestWindowCreate create) where T : TestWindow
 {
     return(create() as T);
 }