Exemple #1
0
 private static bool _IsValidSacrificialEdge(object value)
 {
     Microsoft.Windows.Shell.SacrificialEdge sacrificialEdge = Microsoft.Windows.Shell.SacrificialEdge.None;
     try
     {
         sacrificialEdge = (Microsoft.Windows.Shell.SacrificialEdge)value;
     }
     catch (InvalidCastException invalidCastException)
     {
         return(false);
     }
     if (sacrificialEdge == Microsoft.Windows.Shell.SacrificialEdge.None)
     {
         return(true);
     }
     if ((sacrificialEdge | WindowChrome.SacrificialEdge_All) != WindowChrome.SacrificialEdge_All)
     {
         return(false);
     }
     if (sacrificialEdge == WindowChrome.SacrificialEdge_All)
     {
         return(false);
     }
     return(true);
 }
Exemple #2
0
        static WindowChrome()
        {
            Class6.yDnXvgqzyB5jw();
            WindowChrome.WindowChromeProperty             = DependencyProperty.RegisterAttached("WindowChrome", typeof(WindowChrome), typeof(WindowChrome), new PropertyMetadata(null, new PropertyChangedCallback(WindowChrome._OnChromeChanged)));
            WindowChrome.IsHitTestVisibleInChromeProperty = DependencyProperty.RegisterAttached("IsHitTestVisibleInChrome", typeof(bool), typeof(WindowChrome), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.Inherits));
            WindowChrome.ResizeGripDirectionProperty      = DependencyProperty.RegisterAttached("ResizeGripDirection", typeof(ResizeGripDirection), typeof(WindowChrome), new FrameworkPropertyMetadata((object)ResizeGripDirection.None, FrameworkPropertyMetadataOptions.Inherits));
            WindowChrome.CaptionHeightProperty            = DependencyProperty.Register("CaptionHeight", typeof(double), typeof(WindowChrome), new PropertyMetadata((object)0, (DependencyObject d, DependencyPropertyChangedEventArgs e) => ((WindowChrome)d)._OnPropertyChangedThatRequiresRepaint()), (object value) => (double)value >= 0);
            Type      type      = typeof(Thickness);
            Type      type1     = typeof(WindowChrome);
            Thickness thickness = new Thickness();

            WindowChrome.ResizeBorderThicknessProperty = DependencyProperty.Register("ResizeBorderThickness", type, type1, new PropertyMetadata((object)thickness), (object value) => ((Thickness)value).IsNonNegative());
            Type type2 = typeof(Thickness);
            Type type3 = typeof(WindowChrome);

            thickness = new Thickness();
            WindowChrome.GlassFrameThicknessProperty     = DependencyProperty.Register("GlassFrameThickness", type2, type3, new PropertyMetadata((object)thickness, (DependencyObject d, DependencyPropertyChangedEventArgs e) => ((WindowChrome)d)._OnPropertyChangedThatRequiresRepaint(), (DependencyObject d, object o) => WindowChrome._CoerceGlassFrameThickness((Thickness)o)));
            WindowChrome.UseAeroCaptionButtonsProperty   = DependencyProperty.Register("UseAeroCaptionButtons", typeof(bool), typeof(WindowChrome), new FrameworkPropertyMetadata(true));
            WindowChrome.IgnoreTaskbarOnMaximizeProperty = DependencyProperty.Register("IgnoreTaskbarOnMaximize", typeof(bool), typeof(WindowChrome), new FrameworkPropertyMetadata(false, (DependencyObject d, DependencyPropertyChangedEventArgs e) => ((WindowChrome)d)._OnPropertyChangedThatRequiresRepaint()));
            WindowChrome.UseNoneWindowStyleProperty      = DependencyProperty.Register("UseNoneWindowStyle", typeof(bool), typeof(WindowChrome), new FrameworkPropertyMetadata(false, (DependencyObject d, DependencyPropertyChangedEventArgs e) => ((WindowChrome)d)._OnPropertyChangedThatRequiresRepaint()));
            Type type4 = typeof(System.Windows.CornerRadius);
            Type type5 = typeof(WindowChrome);

            System.Windows.CornerRadius cornerRadiu = new System.Windows.CornerRadius();
            WindowChrome.CornerRadiusProperty    = DependencyProperty.Register("CornerRadius", type4, type5, new PropertyMetadata((object)cornerRadiu, (DependencyObject d, DependencyPropertyChangedEventArgs e) => ((WindowChrome)d)._OnPropertyChangedThatRequiresRepaint()), (object value) => ((System.Windows.CornerRadius)value).IsValid());
            WindowChrome.SacrificialEdgeProperty = DependencyProperty.Register("SacrificialEdge", typeof(Microsoft.Windows.Shell.SacrificialEdge), typeof(WindowChrome), new PropertyMetadata((object)Microsoft.Windows.Shell.SacrificialEdge.None, (DependencyObject d, DependencyPropertyChangedEventArgs e) => ((WindowChrome)d)._OnPropertyChangedThatRequiresRepaint()), new ValidateValueCallback(WindowChrome._IsValidSacrificialEdge));
            WindowChrome.SacrificialEdge_All     = Microsoft.Windows.Shell.SacrificialEdge.Left | Microsoft.Windows.Shell.SacrificialEdge.Top | Microsoft.Windows.Shell.SacrificialEdge.Right | Microsoft.Windows.Shell.SacrificialEdge.Bottom | Microsoft.Windows.Shell.SacrificialEdge.Office;
            List <WindowChrome._SystemParameterBoundProperty> _SystemParameterBoundProperties = new List <WindowChrome._SystemParameterBoundProperty>();

            WindowChrome._SystemParameterBoundProperty __SystemParameterBoundProperty = new WindowChrome._SystemParameterBoundProperty()
            {
                DependencyProperty          = WindowChrome.CornerRadiusProperty,
                SystemParameterPropertyName = "WindowCornerRadius"
            };
            _SystemParameterBoundProperties.Add(__SystemParameterBoundProperty);
            __SystemParameterBoundProperty = new WindowChrome._SystemParameterBoundProperty()
            {
                DependencyProperty          = WindowChrome.CaptionHeightProperty,
                SystemParameterPropertyName = "WindowCaptionHeight"
            };
            _SystemParameterBoundProperties.Add(__SystemParameterBoundProperty);
            __SystemParameterBoundProperty = new WindowChrome._SystemParameterBoundProperty()
            {
                DependencyProperty          = WindowChrome.ResizeBorderThicknessProperty,
                SystemParameterPropertyName = "WindowResizeBorderThickness"
            };
            _SystemParameterBoundProperties.Add(__SystemParameterBoundProperty);
            __SystemParameterBoundProperty = new WindowChrome._SystemParameterBoundProperty()
            {
                DependencyProperty          = WindowChrome.GlassFrameThicknessProperty,
                SystemParameterPropertyName = "WindowNonClientFrameThickness"
            };
            _SystemParameterBoundProperties.Add(__SystemParameterBoundProperty);
            WindowChrome._BoundProperties = _SystemParameterBoundProperties;
        }