WPF uses DMSkin for WPF to quickly build a beautiful WPF program.
DMSkin-for-WPF is A. Net WPF open-source interface library based on WPF. It implements a borderless WPF development solution and has some built-in control templates. You can modify and improve it by referring to the template. (DFW ).
Core
DFW implements a perfect borderless form scheme, and drag and drop all use WIN32 messages. Drag and Drop rely on the desktop edge perfect, high DPI support, the form will not be deformed or abnormal
In addition, because I am not good at MVVM, the DEMO does not adopt the MVVM framework.
Version update
2.0.0.1 (2011-1-30)1. added a window Demo.
2.0.0.0 (2017-10-15)1. Remove WindowMode.
2. Currently, Windows 7 has some flaws.
3.0)1. Single-layer Windows 7 and below.
2. WIN8 and win10.
2.4)1. Stretch the edge of the window (right, bottom right, bottom right ).
2. The shadow restoration speed is adjusted to 200 ms.
3. The shadow can be completely closed (high efficiency, used with the dotted window)
2.3)1. Fixed the BUG of two forms in ALT + TAB.
2. the background color of the Shadow layer. Better User Experience by selecting colors close to the main form
2.2)1. Fixed the BUG where focus cannot be activated in multiple windows.
2. You can drag a window to display the shadow layer.
3. BUG fixes for shadow layer latency display
2.1)1. Optimize and minimize the order of restoring shadow, so there will be no double layers like Netease cloud music.
2. Remove the window cropping Code (the previous cropping operations are all the more involved)
3. Hide the shadow when dragging the position of the window to improve efficiency
[Version 2.0] uses a double-layer form + Win32 to achieve no border. Version 2.0 does not support rounded corner forms, and does not support transparent forms, but has a perfectly minimized animation. If the dotted border is used, you can remove the double-layer form.
[Version 1.0] uses WindowStyle. None + transparency to achieve no borders. Version defects are common problems without borders, and forms animation minimization fails. However, I used xaml to implement animation (the smoothness of the animation depends on the video card). If you need the source code of this version, click my avatar to go to another 1.0 project to obtain it.
2.0)1. The version is upgraded to 2.0, and the animation minimization solution is finally solved. This solution can be transplanted to the winform box. This is the world's first WPF/winfrom borderless animation solution I know.
0.8)1. fixed minimum animation and restored animation (still optimizable)
0.7)1. Code hosting to GITHUB
2. Added Demo: Jay Chou music player.
3. Added Demo: Default template form
0.6)1. added the background color of the DMSystemButtonHoverColor system button for mouse suspension (set the rounded corner form to transparent for better results)
2. New Form mode: Flat Metro + Shadow
Instructions for use
1. reference DMSkin. WPF. DLL2.Window: MainWindow: DMSkinWindow3. add reference: xmlns: DMSkin = "clr-namespace: DMSkin. WPF; assembly = DMSkin. WPF "4. modify the XAML inheritance to DMSkin: DMSkinWindow x: Class = "DMSkin. WPF. test. mainWindow"
Form attributes
Foreground = "White" // Foreground Background = "White" // Background color DMShowMin = "True" // display system buttons-minimize DMShowMax = "True" // display system buttons-maximize DMShowClose = "True" // display system button-Disable DMWindowShadowSize = "10" // form border shadow size DMWindowShadowColor = "# FFC8C8C8" // form border shadow color DMWindowShadowDragVisibility = "False" // whether the shadow layer DMWindowShadowVisibility = "False" is displayed when the form is dragged. // whether the form has a shadow layer [disable the shadow layer] DMWindowShadowBackColor = "# FF323CAD" // specifies the shadow background color, select colors similar to the main form to stretch and drag the user experience is better | # FF323CAD is blue DMSystemButtonSize = "50" // system button size DMSystemButtonForeground = "# FF666666" // system button [text] color DMSystemButtonHoverColor = "#33000000" // system button hover [background] color DMSystemButtonHoverForeground = "White" // system button hover [text] color DMSystemButtonCloseHoverColor = "Red "/ /hover the mouse over the system close button [background] color-Default: Red DMSystemButtonShadowEffect = "0" // system button shadow size ResizeMode = "CanResize" // border stretch scheme CanResiz and CanResizeWithGripHeight = "700" Width = "1000" // form size MinHeight = "268" MinWidth = "360" // form maximum and minimum properties WindowStartupLocation = "CenterScreen" // form initial Location dsf-robordercolor = "# FFC8C8C8" // form border color-only valid in Metro -- remove dsf-robordersize = "1" // border size in 2.0-only valid in Metro -- remove DMWindow in 2.0 = "Shadow" // Shadow-Shadow mode Metro-line flat mode -- remove from 2.0
Resource reference
<Application.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="pack://application:,,,/DMSkin.WPF;Component/Themes/DMSkin.xaml" /> <ResourceDictionary Source="pack://application:,,,/DMSkin.WPF;Component/Themes/DMColor.xaml" /> <ResourceDictionary Source="pack://application:,,,/DMSkin.WPF;Component/Themes/DMScrollViewer.xaml" /> <ResourceDictionary Source="pack://application:,,,/DMSkin.Wpf;component/Themes/DMButton.xaml" /> <ResourceDictionary Source="pack://application:,,,/DMSkin.Wpf;component/Themes/DMTabControl.xaml" /> <ResourceDictionary Source="pack://application:,,,/DMSkin.Wpf;component/Themes/DMRadioButton.xaml" /> <ResourceDictionary Source="pack://application:,,,/DMSkin.Wpf;component/Themes/DMTreeView.xaml" /> <ResourceDictionary Source="pack://application:,,,/DMSkin.Wpf;component/Themes/DMDataGrid.xaml" /> <ResourceDictionary Source="pack://application:,,,/DMSkin.Wpf;component/Themes/DMListBox.xaml" /> <ResourceDictionary Source="pack://application:,,,/DMSkin.Wpf;component/Themes/DMSlider.xaml" /> <ResourceDictionary Source="pack://application:,,,/DMSkin.Wpf;component/Themes/DMCheckBox.xaml" /> <ResourceDictionary Source="pack://application:,,,/DMSkin.Wpf;component/Themes/DMContextMenu.xaml" /> </ResourceDictionary.MergedDictionaries> </ResourceDictionary></Application.Resources>
DMSkin-for-WPF 2.0.0.1
Open Source Address: https://github.com/944095635/DMSkin-for-WPF