°ó¶¨ÃüÁîºÍÃüÁîʼþµ½ËÞÖ÷UI BindCommand(this UIElement @ui, ICommand com, Action<object, ExecutedRoutedEventArgs> call) { var bind = new CommandBinding(com); bind.Executed += new ExecutedRoutedEventHandler(call); @ui.CommandBindings.Add(bind); }
¡¡¡¡WindowBaseµÄÑùʽÓÐÁ½¸ö£¬Ò»¸öÊÇ»ù´¡ÑùʽBaseWindowStyle£¬¿ÉÒÔ×Ô¶¨ÒåÍ·²¿±êÌâÀ¸£¬Ìṩ¸ü¶à¶¨ÖÆÐèÇó¡£ÁíÒ»¸öÑùʽDefaultWindowStyleΪĬÈÏ´°ÌåÑùʽ£¬ÓÃÓÚ´ó¶àÊý²»ÒªÌرð¶¨ÖƵĴ°ÌåÐèÇó¡£BaseWindowStyleÑùʽ´úÂ룺
ResizeBorderThickness Background BorderThickness Background BorderThickness Visibility Style shell:WindowChrome.IsHitTestVisibleInChrome Command Visibility Style shell:WindowChrome.IsHitTestVisibleInChrome Command MouseOverBackground AllowsAnimation shell:WindowChrome.IsHitTestVisibleInChrome Command
¡¡¡¡DefaultWindowStyleÑùʽ´úÂ룺
ResizeBorderThickness Background BorderThickness Background BorderThickness Visibility Style shell:WindowChrome.IsHitTestVisibleInChrome Command Visibility Style shell:WindowChrome.IsHitTestVisibleInChrome Command MouseOverBackground AllowsAnimation shell:WindowChrome.IsHitTestVisibleInChrome Command
View Code¡¡¡¡ÉÏÃæЧ¹ûµÄ±³¾°É«²Ê¡¢±ß¿òµÄ×ÊÔ´£º
<ImageBrush x:Key="WindowInnerBackground" Stretch="Fill" ImageSource="pack://application:,,,/XLY.Framework.WPFTest;component/Images/back/b2.jpg" Opacity="1" Viewport="0,0,1,1" ViewportUnits="Absolute" TileMode="Tile" AlignmentX="Left" AlignmentY="Top"/><LinearGradientBrush x:Key="CaptionBackground" StartPoint="0.5,0" EndPoint="0.5,1"> <GradientStop Color="#571457" Offset="0"/> <GradientStop Color="#6A196A" Offset="1"/> </LinearGradientBrush> ImageSource Viewport
Èý£®ÊµÏÖ×Ô¶¨ÒåMessageBoxÏûÏ¢Ìáʾ¿ò
¡¡¡¡»ùÓÚµÚ¶þ½Ú×Ô¶¨ÒåµÄ´°ÌåWindowBase£¬ÊµÏÖ×Ô¶¨ÒåµÄMessageBox¾Í¼òµ¥ÁË£¬Ð§¹ûͼ£º
¡¡