static BaseWindow() { DefaultStyleKeyProperty.OverrideMetadata(typeof(BaseWindow), new FrameworkPropertyMetadata(typeof(BaseWindow))); WindowStyleProperty.OverrideMetadata(typeof(BaseWindow), new FrameworkPropertyMetadata(WindowStyle.None)); }
/// <summary>Fires when the IsBorderless property changess</summary> /// <param name="d">The dependency object.</param> /// <param name="args">The <see cref="DependencyPropertyChangedEventArgs" /> instance containing the event data.</param> private static void IsBorderlessChanged(DependencyObject d, DependencyPropertyChangedEventArgs args) { var window = d as Window; if (window == null) { return; } if ((bool)args.NewValue) { window.WindowStyle = WindowStyle.None; window.ResizeMode = ResizeMode.NoResize; window.SourceInitialized += (o, e) => { if (!GetIsBorderless(window)) { return; } var handle = (new WindowInteropHelper(window)).Handle; var hwndSource = HwndSource.FromHwnd(handle); if (hwndSource != null) { hwndSource.AddHook(WindowHook); } }; } else { window.WindowStyle = (WindowStyle)WindowStyleProperty.GetMetadata(typeof(Window)).DefaultValue; window.ResizeMode = (ResizeMode)ResizeModeProperty.GetMetadata(typeof(Window)).DefaultValue; } }
//-------------------------------------------------------------- #region Dependency Properties & Routed Events //-------------------------------------------------------------- #endregion //-------------------------------------------------------------- #region Creation & Cleanup //-------------------------------------------------------------- /// <summary> /// Initializes static members of the <see cref="FloatWindow"/> class. /// </summary> static FloatWindow() { DefaultStyleKeyProperty.OverrideMetadata(typeof(FloatWindow), new FrameworkPropertyMetadata(typeof(FloatWindow))); ShowInTaskbarProperty.OverrideMetadata(typeof(FloatWindow), new FrameworkPropertyMetadata(Boxed.BooleanFalse)); WindowStyleProperty.OverrideMetadata(typeof(FloatWindow), new FrameworkPropertyMetadata(WindowStyle.ToolWindow)); SizeToContentProperty.OverrideMetadata(typeof(FloatWindow), new FrameworkPropertyMetadata(SizeToContent.WidthAndHeight)); }
static InfoCardWindowControl() { DefaultStyleKeyProperty.OverrideMetadata( typeof(InfoCardWindowControl), new FrameworkPropertyMetadata(typeof(InfoCardWindowControl))); VisibilityProperty.OverrideMetadata( typeof(InfoCardWindowControl), new FrameworkPropertyMetadata(Visibility.Collapsed)); DropShadowColorProperty.OverrideMetadata( typeof(InfoCardWindowControl), new FrameworkPropertyMetadata(Color.FromArgb(0x38, 0, 0, 0))); HasDropShadowProperty.OverrideMetadata( typeof(InfoCardWindowControl), new FrameworkPropertyMetadata(true)); WindowStyleProperty.OverrideMetadata( typeof(InfoCardWindowControl), new FrameworkPropertyMetadata(WindowStyle.None)); ResizeModeProperty.OverrideMetadata( typeof(InfoCardWindowControl), new FrameworkPropertyMetadata(ResizeMode.NoResize)); }
static LayoutFloatingWindowControl() { AllowsTransparencyProperty.OverrideMetadata(typeof(LayoutFloatingWindowControl), new FrameworkPropertyMetadata(false)); ContentProperty.OverrideMetadata(typeof(LayoutFloatingWindowControl), new FrameworkPropertyMetadata(null, null, CoerceContentValue)); ShowInTaskbarProperty.OverrideMetadata(typeof(LayoutFloatingWindowControl), new FrameworkPropertyMetadata(false)); WindowStyleProperty.OverrideMetadata(typeof(LayoutFloatingWindowControl), new FrameworkPropertyMetadata(WindowStyle.None)); }
/// <summary> /// Static constructor /// </summary> static RibbonWindow() { DefaultStyleKeyProperty.OverrideMetadata(typeof(RibbonWindow), new FrameworkPropertyMetadata(typeof(RibbonWindow))); BorderThicknessProperty.OverrideMetadata(typeof(RibbonWindow), new FrameworkPropertyMetadata(new Thickness(1))); WindowStyleProperty.OverrideMetadata(typeof(RibbonWindow), new FrameworkPropertyMetadata(WindowStyle.None)); }
//-------------------------------------------------------------- #region Dependency Properties & Routed Events //-------------------------------------------------------------- #endregion //-------------------------------------------------------------- #region Creation & Cleanup //-------------------------------------------------------------- /// <summary> /// Initializes static members of the <see cref="DockOverlay"/> class. /// </summary> static DockOverlay() { AllowsTransparencyProperty.OverrideMetadata(typeof(DockOverlay), new FrameworkPropertyMetadata(Boxed.BooleanTrue)); BackgroundProperty.OverrideMetadata(typeof(DockOverlay), new FrameworkPropertyMetadata(null)); ShowActivatedProperty.OverrideMetadata(typeof(DockOverlay), new FrameworkPropertyMetadata(Boxed.BooleanFalse)); ShowInTaskbarProperty.OverrideMetadata(typeof(DockOverlay), new FrameworkPropertyMetadata(Boxed.BooleanFalse)); WindowStyleProperty.OverrideMetadata(typeof(DockOverlay), new FrameworkPropertyMetadata(WindowStyle.None)); }
static FloatingWindow() { ShowInTaskbarProperty.OverrideMetadata(typeof(FloatingWindow), new FrameworkPropertyMetadata(false)); WindowStyleProperty.OverrideMetadata(typeof(FloatingWindow), new FrameworkPropertyMetadata(WindowStyle.ToolWindow)); //DefaultStyleKeyProperty.OverrideMetadata(typeof(FloatingWindow), new FrameworkPropertyMetadata(typeof(FloatingWindow))); }
static DialogWindow() { WindowStyleProperty.OverrideMetadata(typeof(DialogWindow), new FrameworkPropertyMetadata(WindowStyle.None)); ShowActivatedProperty.OverrideMetadata(typeof(DialogWindow), new FrameworkPropertyMetadata(false)); ShowInTaskbarProperty.OverrideMetadata(typeof(DialogWindow), new FrameworkPropertyMetadata(false)); ResizeModeProperty.OverrideMetadata(typeof(DialogWindow), new FrameworkPropertyMetadata(ResizeMode.NoResize)); }
static CursorWindow() { TopmostProperty.OverrideMetadata(typeof(CursorWindow), new FrameworkPropertyMetadata(true)); WindowStyleProperty.OverrideMetadata(typeof(CursorWindow), new FrameworkPropertyMetadata(WindowStyle.None)); ResizeModeProperty.OverrideMetadata(typeof(CursorWindow), new FrameworkPropertyMetadata(ResizeMode.NoResize)); AllowsTransparencyProperty.OverrideMetadata(typeof(CursorWindow), new FrameworkPropertyMetadata(true)); ShowInTaskbarProperty.OverrideMetadata(typeof(CursorWindow), new FrameworkPropertyMetadata(false)); }
static WindowChromeWindow() { DefaultStyleKeyProperty.OverrideMetadata(typeof(WindowChromeWindow), new FrameworkPropertyMetadata(typeof(WindowChromeWindow))); WindowStyleProperty.OverrideMetadata(typeof(WindowChromeWindow), new FrameworkPropertyMetadata(WindowStyle.SingleBorderWindow)); AllowsTransparencyProperty.OverrideMetadata(typeof(WindowChromeWindow), new FrameworkPropertyMetadata(BooleanBoxes.FalseBox)); }
static PrecisePopupWindow() { DefaultStyleKeyProperty.OverrideMetadata(typeof(PrecisePopupWindow), new FrameworkPropertyMetadata(typeof(PrecisePopupWindow))); TopmostProperty.OverrideMetadata(typeof(PrecisePopupWindow), new FrameworkPropertyMetadata(true)); WindowStyleProperty.OverrideMetadata(typeof(PrecisePopupWindow), new FrameworkPropertyMetadata(WindowStyle.None)); ResizeModeProperty.OverrideMetadata(typeof(PrecisePopupWindow), new FrameworkPropertyMetadata(ResizeMode.NoResize)); ShowInTaskbarProperty.OverrideMetadata(typeof(PrecisePopupWindow), new FrameworkPropertyMetadata(false)); AllowsTransparencyProperty.OverrideMetadata(typeof(PrecisePopupWindow), new FrameworkPropertyMetadata(true)); }
static WindowChromeWindow() { DefaultStyleKeyProperty.OverrideMetadata(typeof(WindowChromeWindow), new FrameworkPropertyMetadata(typeof(WindowChromeWindow))); BorderThicknessProperty.OverrideMetadata(typeof(WindowChromeWindow), new FrameworkPropertyMetadata(new Thickness(1))); WindowStyleProperty.OverrideMetadata(typeof(WindowChromeWindow), new FrameworkPropertyMetadata(WindowStyle.None)); AllowsTransparencyProperty.OverrideMetadata(typeof(WindowChromeWindow), new FrameworkPropertyMetadata(false)); }
static CompletionWindowBase() { WindowStyleProperty.OverrideMetadata(typeof(CompletionWindowBase), new FrameworkPropertyMetadata(WindowStyle.None)); ShowActivatedProperty.OverrideMetadata(typeof(CompletionWindowBase), new FrameworkPropertyMetadata(Boxes.False)); ShowInTaskbarProperty.OverrideMetadata(typeof(CompletionWindowBase), new FrameworkPropertyMetadata(Boxes.False)); //!!!! //AllowsTransparencyProperty.OverrideMetadata( typeof( CompletionWindowBase ),new FrameworkPropertyMetadata( Boxes.True ) ); }
/// <summary> /// Static constructor /// </summary> static RibbonWindow() { DefaultStyleKeyProperty.OverrideMetadata(typeof(RibbonWindow), new FrameworkPropertyMetadata(typeof(RibbonWindow))); BorderThicknessProperty.OverrideMetadata(typeof(RibbonWindow), new FrameworkPropertyMetadata(new Thickness(1))); WindowStyleProperty.OverrideMetadata(typeof(RibbonWindow), new FrameworkPropertyMetadata(WindowStyle.None)); AllowsTransparencyProperty.OverrideMetadata(typeof(RibbonWindow), new FrameworkPropertyMetadata(BooleanBoxes.FalseBox)); }
static NavigatorWindow() { DefaultStyleKeyProperty.OverrideMetadata(typeof(NavigatorWindow), new FrameworkPropertyMetadata(typeof(NavigatorWindow))); AllowsTransparencyProperty.OverrideMetadata(typeof(NavigatorWindow), new FrameworkPropertyMetadata(true)); WindowStyleProperty.OverrideMetadata(typeof(NavigatorWindow), new FrameworkPropertyMetadata(WindowStyle.None)); ShowInTaskbarProperty.OverrideMetadata(typeof(NavigatorWindow), new FrameworkPropertyMetadata(false)); BackgroundProperty.OverrideMetadata(typeof(NavigatorWindow), new FrameworkPropertyMetadata(Brushes.Transparent)); }
static CompletionWindowBase() { WindowStyleProperty.OverrideMetadata(typeof(CompletionWindowBase), new FrameworkPropertyMetadata(WindowStyle.None)); ShowActivatedProperty.OverrideMetadata(typeof(CompletionWindowBase), new FrameworkPropertyMetadata(Boxes.False)); ShowInTaskbarProperty.OverrideMetadata(typeof(CompletionWindowBase), new FrameworkPropertyMetadata(Boxes.False)); //Dirkster99 BugFix to get rid of window border on completion drop-down list AllowsTransparencyProperty.OverrideMetadata(typeof(CompletionWindowBase), new FrameworkPropertyMetadata(true)); }
static GlowWindow() { AllowsTransparencyProperty.OverrideMetadata(typeof(GlowWindow), new FrameworkPropertyMetadata(true)); BackgroundProperty.OverrideMetadata(typeof(GlowWindow), new FrameworkPropertyMetadata(Brushes.Transparent)); ResizeModeProperty.OverrideMetadata(typeof(GlowWindow), new FrameworkPropertyMetadata(ResizeMode.NoResize)); ShowActivatedProperty.OverrideMetadata(typeof(GlowWindow), new FrameworkPropertyMetadata(false)); ShowInTaskbarProperty.OverrideMetadata(typeof(GlowWindow), new FrameworkPropertyMetadata(false)); SnapsToDevicePixelsProperty.OverrideMetadata(typeof(GlowWindow), new FrameworkPropertyMetadata(true)); WindowStyleProperty.OverrideMetadata(typeof(GlowWindow), new FrameworkPropertyMetadata(WindowStyle.None)); }
static OverlayWindow() { DefaultStyleKeyProperty.OverrideMetadata(typeof(OverlayWindow), new FrameworkPropertyMetadata(typeof(OverlayWindow))); AllowsTransparencyProperty.OverrideMetadata(typeof(OverlayWindow), new FrameworkPropertyMetadata(true)); WindowStyleProperty.OverrideMetadata(typeof(OverlayWindow), new FrameworkPropertyMetadata(WindowStyle.None)); ShowInTaskbarProperty.OverrideMetadata(typeof(OverlayWindow), new FrameworkPropertyMetadata(false)); ShowActivatedProperty.OverrideMetadata(typeof(OverlayWindow), new FrameworkPropertyMetadata(false)); }
static BlurWindow() { DefaultStyleKeyProperty.OverrideMetadata(typeof(BlurWindow), new FrameworkPropertyMetadata(typeof(BlurWindow))); ResizeModeProperty.OverrideMetadata(typeof(BlurWindow), new FrameworkPropertyMetadata(ResizeMode.CanMinimize)); WindowStyleProperty.OverrideMetadata(typeof(BlurWindow), new FrameworkPropertyMetadata(WindowStyle.None)); if (WindowsVersion.Is10) { AllowsTransparencyProperty.OverrideMetadata(typeof(BlurWindow), new FrameworkPropertyMetadata(true)); } }
static LinqPadCompletionWindow() { WindowStyleProperty.OverrideMetadata( typeof(LinqPadCompletionWindow), new FrameworkPropertyMetadata(WindowStyle.None)); AllowsTransparencyProperty.OverrideMetadata( typeof(LinqPadCompletionWindow), new FrameworkPropertyMetadata(true)); }
static NotificationWindow() { DefaultStyleKeyProperty.OverrideMetadata(typeof(NotificationWindow), new FrameworkPropertyMetadata(typeof(NotificationWindow))); WindowStyleProperty.OverrideMetadata(typeof(NotificationWindow), new FrameworkPropertyMetadata(WindowStyle.None)); AllowsTransparencyProperty.OverrideMetadata(typeof(NotificationWindow), new FrameworkPropertyMetadata(true)); BackgroundProperty.OverrideMetadata(typeof(NotificationWindow), new FrameworkPropertyMetadata(Brushes.CadetBlue)); TopmostProperty.OverrideMetadata(typeof(NotificationWindow), new FrameworkPropertyMetadata(true)); ShowInTaskbarProperty.OverrideMetadata(typeof(NotificationWindow), new FrameworkPropertyMetadata(false)); ShowActivatedProperty.OverrideMetadata(typeof(NotificationWindow), new FrameworkPropertyMetadata(false)); SizeToContentProperty.OverrideMetadata(typeof(NotificationWindow), new FrameworkPropertyMetadata(SizeToContent.Manual)); }
static LegacyBorderWindow() { //DefaultStyleKeyProperty.OverrideMetadata(typeof(BorderWindow), new FrameworkPropertyMetadata(typeof(BorderWindow))); WindowStyleProperty.OverrideMetadata(typeof(LegacyBorderWindow), new FrameworkPropertyMetadata(WindowStyle.None)); ShowInTaskbarProperty.OverrideMetadata(typeof(LegacyBorderWindow), new FrameworkPropertyMetadata(false)); AllowsTransparencyProperty.OverrideMetadata(typeof(LegacyBorderWindow), new FrameworkPropertyMetadata(true)); ShowActivatedProperty.OverrideMetadata(typeof(LegacyBorderWindow), new FrameworkPropertyMetadata(false)); // override to make border less visible initially for slow machines //WindowStateProperty.OverrideMetadata(typeof(BorderWindow), new FrameworkPropertyMetadata(WindowState.Minimized)); WidthProperty.OverrideMetadata(typeof(LegacyBorderWindow), new FrameworkPropertyMetadata(1d)); HeightProperty.OverrideMetadata(typeof(LegacyBorderWindow), new FrameworkPropertyMetadata(1d)); }
static BorderWindow() { DefaultStyleKeyProperty.OverrideMetadata(typeof(BorderWindow), new FrameworkPropertyMetadata(typeof(BorderWindow))); WindowStyleProperty.OverrideMetadata(typeof(BorderWindow), new FrameworkPropertyMetadata(WindowStyle.None)); ShowInTaskbarProperty.OverrideMetadata(typeof(BorderWindow), new FrameworkPropertyMetadata(false)); AllowsTransparencyProperty.OverrideMetadata(typeof(BorderWindow), new FrameworkPropertyMetadata(true)); ShowActivatedProperty.OverrideMetadata(typeof(BorderWindow), new FrameworkPropertyMetadata(false)); ResizeModeProperty.OverrideMetadata(typeof(BorderWindow), new FrameworkPropertyMetadata(ResizeMode.NoResize)); BorderBrushProperty.OverrideMetadata(typeof(BorderWindow), new FrameworkPropertyMetadata(Brushes.DimGray)); // override to make border less visible initially for slow machines WidthProperty.OverrideMetadata(typeof(BorderWindow), new FrameworkPropertyMetadata(1d)); HeightProperty.OverrideMetadata(typeof(BorderWindow), new FrameworkPropertyMetadata(1d)); }
static FlyoutPaneWindow() { //This OverrideMetadata call tells the system that this element wants to provide a style that is different than its base class. //This style is defined in themes\generic.xaml DefaultStyleKeyProperty.OverrideMetadata(typeof(FlyoutPaneWindow), new FrameworkPropertyMetadata(typeof(FlyoutPaneWindow))); //AllowsTransparency slow down perfomance under XP/VISTA because rendering is enterely perfomed using CPU //Window.AllowsTransparencyProperty.OverrideMetadata(typeof(FlyoutPaneWindow), new FrameworkPropertyMetadata(true)); WindowStyleProperty.OverrideMetadata(typeof(FlyoutPaneWindow), new FrameworkPropertyMetadata(WindowStyle.None)); ShowInTaskbarProperty.OverrideMetadata(typeof(FlyoutPaneWindow), new FrameworkPropertyMetadata(false)); ResizeModeProperty.OverrideMetadata(typeof(FlyoutPaneWindow), new FrameworkPropertyMetadata(ResizeMode.NoResize)); BackgroundProperty.OverrideMetadata(typeof(FlyoutPaneWindow), new FrameworkPropertyMetadata(Brushes.Transparent)); }
/// <summary> /// 静的コンストラクタ /// </summary> static MovableWindow() { WindowStyleProperty.OverrideMetadata( typeof(MovableWindow), new FrameworkPropertyMetadata(WindowStyle.None)); AllowsTransparencyProperty.OverrideMetadata( typeof(MovableWindow), new FrameworkPropertyMetadata(true)); /*BackgroundProperty.OverrideMetadata( * typeof(MovableWindow), * new FrameworkPropertyMetadata(Brushes.Transparent));*/ }
static NativeFloatingWindow() { DefaultStyleKeyProperty.OverrideMetadata(typeof(NativeFloatingWindow), new FrameworkPropertyMetadata(typeof(NativeFloatingWindow))); ShowInTaskbarProperty.OverrideMetadata(typeof(NativeFloatingWindow), new FrameworkPropertyMetadata(BooleanBoxes.False)); WindowStyleProperty.OverrideMetadata(typeof(NativeFloatingWindow), new FrameworkPropertyMetadata(WindowStyle.ToolWindow)); ShowActivatedProperty.OverrideMetadata(typeof(NativeFloatingWindow), new FrameworkPropertyMetadata(BooleanBoxes.False)); CommandBinding performCloseCommandBinding = new CommandBinding(DockCommands.PerformClose, new ExecutedRoutedEventHandler(OnPerformCloseExecuted)); CommandBinding toggleFloatingCommandBinding = new CommandBinding(DockCommands.ToggleFloating, new ExecutedRoutedEventHandler(OnToggleFloatingExecuted)); CommandBinding toggleWindowStateCommandBinding = new CommandBinding(DockCommands.ToggleWindowState, new ExecutedRoutedEventHandler(OnToggleWindowStateExecuted)); CommandManager.RegisterClassCommandBinding(typeof(NativeFloatingWindow), performCloseCommandBinding); CommandManager.RegisterClassCommandBinding(typeof(NativeFloatingWindow), toggleFloatingCommandBinding); CommandManager.RegisterClassCommandBinding(typeof(NativeFloatingWindow), toggleWindowStateCommandBinding); }
static ChromeWindow() { AllowsTransparencyProperty.OverrideMetadata( typeof(ChromeWindow), new FrameworkPropertyMetadata(true)); ResizeModeProperty.OverrideMetadata( typeof(ChromeWindow), new FrameworkPropertyMetadata(ResizeMode.NoResize)); ShowActivatedProperty.OverrideMetadata( typeof(ChromeWindow), new FrameworkPropertyMetadata(false)); ShowInTaskbarProperty.OverrideMetadata( typeof(ChromeWindow), new FrameworkPropertyMetadata(false)); VisibilityProperty.OverrideMetadata( typeof(ChromeWindow), new FrameworkPropertyMetadata(Visibility.Collapsed)); WindowStyleProperty.OverrideMetadata( typeof(ChromeWindow), new FrameworkPropertyMetadata(WindowStyle.None)); }
static InfoCardWindow() { ShowInTaskbarProperty.OverrideMetadata( typeof(InfoCardWindow), new FrameworkPropertyMetadata(false)); SizeToContentProperty.OverrideMetadata( typeof(InfoCardWindow), new FrameworkPropertyMetadata(SizeToContent.WidthAndHeight)); WindowStyleProperty.OverrideMetadata( typeof(InfoCardWindow), new FrameworkPropertyMetadata(WindowStyle.None)); ResizeModeProperty.OverrideMetadata( typeof(InfoCardWindow), new FrameworkPropertyMetadata(ResizeMode.NoResize)); AllowsTransparencyProperty.OverrideMetadata( typeof(InfoCardWindow), new FrameworkPropertyMetadata(true)); BackgroundProperty.OverrideMetadata( typeof(InfoCardWindow), new FrameworkPropertyMetadata(Brushes.Transparent)); EventManager.RegisterClassHandler( typeof(InfoCard), InfoCard.PinnedEvent, (RoutedEventHandler)OnInfoCardPinned); EventManager.RegisterClassHandler( typeof(InfoCard), InfoCard.UnpinnedEvent, (RoutedEventHandler)OnInfoCardUnpinned); }
static BlurWindow() { DefaultStyleKeyProperty.OverrideMetadata(typeof(BlurWindow), new FrameworkPropertyMetadata(typeof(BlurWindow))); WindowStyleProperty.OverrideMetadata(typeof(BlurWindow), new FrameworkPropertyMetadata(WindowStyle.None)); AllowsTransparencyProperty.OverrideMetadata(typeof(BlurWindow), new FrameworkPropertyMetadata(true)); }