├── .gitattributes
├── .gitignore
├── DMSkin-for-WPF.sln
├── DMSkin.Core
├── Common
│ ├── Base64.cs
│ ├── Execute.cs
│ ├── HTTP.cs
│ └── UINT.cs
├── Converters
│ ├── BoolToVisibilityConverter.cs
│ ├── CompareToVisibilityConverter.cs
│ ├── EnumToBooleanConverter.cs
│ ├── EnumToVisibilityConverter.cs
│ ├── SecondToStringConverter.cs
│ └── TimeSpanToStringConverter.cs
├── DMSkin.Core.csproj
├── MVVM
│ ├── DelegateCommand.cs
│ └── ViewModelBase.cs
├── Properties
│ └── AssemblyInfo.cs
├── TaskManager.cs
└── WIN32
│ ├── DesktopAPI.cs
│ └── Native.cs
├── DMSkin.Docs
└── README.md
├── DMSkin.ScreenShot
├── demo.png
├── demo1.png
└── demo2.png
├── DMSkin.WPF.AntDesign
├── DMSkin.WPF.AntDesign.csproj
├── Properties
│ └── AssemblyInfo.cs
└── Style.xaml
├── DMSkin.WPF.Demos
├── App.xaml
├── App.xaml.cs
├── DMSkin.WPF.Demos.csproj
├── Images
│ ├── image1.png
│ └── user.jpg
├── Properties
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ ├── Resources.resx
│ ├── Settings.Designer.cs
│ └── Settings.settings
├── StartWindow.xaml
├── StartWindow.xaml.cs
├── ViewModels
│ ├── MainWindowViewModel.cs
│ ├── PageAboutViewModel.cs
│ └── StartWindowViewModel.cs
├── Views
│ ├── PageAbout.xaml
│ ├── PageAbout.xaml.cs
│ ├── PageAnimation.xaml
│ ├── PageAnimation.xaml.cs
│ ├── PageAntDesign.xaml
│ ├── PageAntDesign.xaml.cs
│ ├── PageScrollViewer.xaml
│ ├── PageScrollViewer.xaml.cs
│ ├── PageVirtualizing.xaml
│ ├── PageVirtualizing.xaml.cs
│ └── Window
│ │ ├── ComplexWindow.xaml
│ │ ├── ComplexWindow.xaml.cs
│ │ ├── SimpleWindow.xaml
│ │ └── SimpleWindow.xaml.cs
└── app.config
├── DMSkin.WPF
├── Controls
│ ├── DMButton.cs
│ ├── DMCheckBox.cs
│ ├── DMLinkButton.cs
│ ├── DMNumericBox.cs
│ ├── DMRadioButton.cs
│ ├── DMScrollBar.cs
│ ├── DMScrollViewer.cs
│ ├── DMSystemButton.cs
│ ├── DMSystemCloseButton.cs
│ ├── DMSystemMaxButton.cs
│ ├── DMSystemMinButton.cs
│ ├── DMTabItem.cs
│ ├── DMTextBox.cs
│ ├── DMThumb.cs
│ ├── ElasticWrapPanel.cs
│ └── VirtualizingWrapPanel .cs
├── DMSkin.WPF.csproj
├── DMSkinComplexWindow.cs
├── DMSkinSimpleWindow.cs
├── Properties
│ └── AssemblyInfo.cs
├── ShadowWindow.xaml
├── ShadowWindow.xaml.cs
└── Styles
│ ├── Animation.xaml
│ ├── DMButton.xaml
│ ├── DMCheckBox.xaml
│ ├── DMContextMenu.xaml
│ ├── DMDataGrid.xaml
│ ├── DMIcon.xaml
│ ├── DMImage.xaml
│ ├── DMItemsControl.xaml
│ ├── DMListBox.xaml
│ ├── DMRadioButton.xaml
│ ├── DMResizeGrip.xaml
│ ├── DMScrollViewer.xaml
│ ├── DMSkin.xaml
│ ├── DMSkinSimpleWindow.xaml
│ ├── DMSlider.xaml
│ ├── DMTabControl.xaml
│ ├── DMTextBox.xaml
│ ├── DMToolTip.xaml
│ └── DMTreeView.xaml
├── LICENSE
└── README.md
/.gitattributes:
--------------------------------------------------------------------------------
1 | * text=auto
2 |
3 | ###############################################################################
4 | # Set default behavior for command prompt diff.
5 | #
6 | # This is need for earlier builds of msysgit that does not have it on by
7 | # default for csharp files.
8 | # Note: This is only used by command line
9 | ###############################################################################
10 | #*.cs diff=csharp
11 |
12 | ###############################################################################
13 | # Set the merge driver for project and solution files
14 | #
15 | # Merging from the command prompt will add diff markers to the files if there
16 | # are conflicts (Merging from VS is not affected by the settings below, in VS
17 | # the diff markers are never inserted). Diff markers may cause the following
18 | # file extensions to fail to load in VS. An alternative would be to treat
19 | # these files as binary and thus will always conflict and require user
20 | # intervention with every merge. To do so, just uncomment the entries below
21 | ###############################################################################
22 | #*.sln merge=binary
23 | #*.csproj merge=binary
24 | #*.vbproj merge=binary
25 | #*.vcxproj merge=binary
26 | #*.vcproj merge=binary
27 | #*.dbproj merge=binary
28 | #*.fsproj merge=binary
29 | #*.lsproj merge=binary
30 | #*.wixproj merge=binary
31 | #*.modelproj merge=binary
32 | #*.sqlproj merge=binary
33 | #*.wwaproj merge=binary
34 |
35 | ###############################################################################
36 | # behavior for image files
37 | #
38 | # image files are treated as binary by default.
39 | ###############################################################################
40 | #*.jpg binary
41 | #*.png binary
42 | #*.gif binary
43 |
44 | ###############################################################################
45 | # diff behavior for common document formats
46 | #
47 | # Convert binary document formats to text before diffing them. This feature
48 | # is only available from the command line. Turn it on by uncommenting the
49 | # entries below.
50 | ###############################################################################
51 | #*.doc diff=astextplain
52 | #*.DOC diff=astextplain
53 | #*.docx diff=astextplain
54 | #*.DOCX diff=astextplain
55 | #*.dot diff=astextplain
56 | #*.DOT diff=astextplain
57 | #*.pdf diff=astextplain
58 | #*.PDF diff=astextplain
59 | #*.rtf diff=astextplain
60 | #*.RTF diff=astextplain
61 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 | ##
4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
5 |
6 | # User-specific files
7 | *.suo
8 | *.user
9 | *.userosscache
10 | *.sln.docstates
11 |
12 | # User-specific files (MonoDevelop/Xamarin Studio)
13 | *.userprefs
14 |
15 | # Build results
16 | [Dd]ebug/
17 | [Dd]ebugPublic/
18 | [Rr]elease/
19 | [Rr]eleases/
20 | x64/
21 | x86/
22 | bld/
23 | [Bb]in/
24 | [Oo]bj/
25 | [Ll]og/
26 |
27 | # Visual Studio 2015/2017 cache/options directory
28 | .vs/
29 | # Uncomment if you have tasks that create the project's static files in wwwroot
30 | #wwwroot/
31 |
32 | # Visual Studio 2017 auto generated files
33 | Generated\ Files/
34 |
35 | # MSTest test Results
36 | [Tt]est[Rr]esult*/
37 | [Bb]uild[Ll]og.*
38 |
39 | # NUNIT
40 | *.VisualState.xml
41 | TestResult.xml
42 |
43 | # Build Results of an ATL Project
44 | [Dd]ebugPS/
45 | [Rr]eleasePS/
46 | dlldata.c
47 |
48 | # Benchmark Results
49 | BenchmarkDotNet.Artifacts/
50 |
51 | # .NET Core
52 | project.lock.json
53 | project.fragment.lock.json
54 | artifacts/
55 | **/Properties/launchSettings.json
56 |
57 | # StyleCop
58 | StyleCopReport.xml
59 |
60 | # Files built by Visual Studio
61 | *_i.c
62 | *_p.c
63 | *_i.h
64 | *.ilk
65 | *.meta
66 | *.obj
67 | *.iobj
68 | *.pch
69 | *.pdb
70 | *.ipdb
71 | *.pgc
72 | *.pgd
73 | *.rsp
74 | *.sbr
75 | *.tlb
76 | *.tli
77 | *.tlh
78 | *.tmp
79 | *.tmp_proj
80 | *.log
81 | *.vspscc
82 | *.vssscc
83 | .builds
84 | *.pidb
85 | *.svclog
86 | *.scc
87 |
88 | # Chutzpah Test files
89 | _Chutzpah*
90 |
91 | # Visual C++ cache files
92 | ipch/
93 | *.aps
94 | *.ncb
95 | *.opendb
96 | *.opensdf
97 | *.sdf
98 | *.cachefile
99 | *.VC.db
100 | *.VC.VC.opendb
101 |
102 | # Visual Studio profiler
103 | *.psess
104 | *.vsp
105 | *.vspx
106 | *.sap
107 |
108 | # Visual Studio Trace Files
109 | *.e2e
110 |
111 | # TFS 2012 Local Workspace
112 | $tf/
113 |
114 | # Guidance Automation Toolkit
115 | *.gpState
116 |
117 | # ReSharper is a .NET coding add-in
118 | _ReSharper*/
119 | *.[Rr]e[Ss]harper
120 | *.DotSettings.user
121 |
122 | # JustCode is a .NET coding add-in
123 | .JustCode
124 |
125 | # TeamCity is a build add-in
126 | _TeamCity*
127 |
128 | # DotCover is a Code Coverage Tool
129 | *.dotCover
130 |
131 | # AxoCover is a Code Coverage Tool
132 | .axoCover/*
133 | !.axoCover/settings.json
134 |
135 | # Visual Studio code coverage results
136 | *.coverage
137 | *.coveragexml
138 |
139 | # NCrunch
140 | _NCrunch_*
141 | .*crunch*.local.xml
142 | nCrunchTemp_*
143 |
144 | # MightyMoose
145 | *.mm.*
146 | AutoTest.Net/
147 |
148 | # Web workbench (sass)
149 | .sass-cache/
150 |
151 | # Installshield output folder
152 | [Ee]xpress/
153 |
154 | # DocProject is a documentation generator add-in
155 | DocProject/buildhelp/
156 | DocProject/Help/*.HxT
157 | DocProject/Help/*.HxC
158 | DocProject/Help/*.hhc
159 | DocProject/Help/*.hhk
160 | DocProject/Help/*.hhp
161 | DocProject/Help/Html2
162 | DocProject/Help/html
163 |
164 | # Click-Once directory
165 | publish/
166 |
167 | # Publish Web Output
168 | *.[Pp]ublish.xml
169 | *.azurePubxml
170 | # Note: Comment the next line if you want to checkin your web deploy settings,
171 | # but database connection strings (with potential passwords) will be unencrypted
172 | *.pubxml
173 | *.publishproj
174 |
175 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
176 | # checkin your Azure Web App publish settings, but sensitive information contained
177 | # in these scripts will be unencrypted
178 | PublishScripts/
179 |
180 | # NuGet Packages
181 | *.nupkg
182 | # The packages folder can be ignored because of Package Restore
183 | [Pp]ackages/
184 | # except build/, which is used as an MSBuild target.
185 | !**/[Pp]ackages/build/
186 | # Uncomment if necessary however generally it will be regenerated when needed
187 | #!**/[Pp]ackages/repositories.config
188 | # NuGet v3's project.json files produces more ignorable files
189 | *.nuget.props
190 | *.nuget.targets
191 |
192 | # Microsoft Azure Build Output
193 | csx/
194 | *.build.csdef
195 |
196 | # Microsoft Azure Emulator
197 | ecf/
198 | rcf/
199 |
200 | # Windows Store app package directories and files
201 | AppPackages/
202 | BundleArtifacts/
203 | Package.StoreAssociation.xml
204 | _pkginfo.txt
205 | *.appx
206 |
207 | # Visual Studio cache files
208 | # files ending in .cache can be ignored
209 | *.[Cc]ache
210 | # but keep track of directories ending in .cache
211 | !*.[Cc]ache/
212 |
213 | # Others
214 | ClientBin/
215 | ~$*
216 | *~
217 | *.dbmdl
218 | *.dbproj.schemaview
219 | *.jfm
220 | *.pfx
221 | *.publishsettings
222 | orleans.codegen.cs
223 |
224 | # Including strong name files can present a security risk
225 | # (https://github.com/github/gitignore/pull/2483#issue-259490424)
226 | #*.snk
227 |
228 | # Since there are multiple workflows, uncomment next line to ignore bower_components
229 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
230 | #bower_components/
231 |
232 | # RIA/Silverlight projects
233 | Generated_Code/
234 |
235 | # Backup & report files from converting an old project file
236 | # to a newer Visual Studio version. Backup files are not needed,
237 | # because we have git ;-)
238 | _UpgradeReport_Files/
239 | Backup*/
240 | UpgradeLog*.XML
241 | UpgradeLog*.htm
242 | ServiceFabricBackup/
243 | *.rptproj.bak
244 |
245 | # SQL Server files
246 | *.mdf
247 | *.ldf
248 | *.ndf
249 |
250 | # Business Intelligence projects
251 | *.rdl.data
252 | *.bim.layout
253 | *.bim_*.settings
254 | *.rptproj.rsuser
255 |
256 | # Microsoft Fakes
257 | FakesAssemblies/
258 |
259 | # GhostDoc plugin setting file
260 | *.GhostDoc.xml
261 |
262 | # Node.js Tools for Visual Studio
263 | .ntvs_analysis.dat
264 | node_modules/
265 |
266 | # Visual Studio 6 build log
267 | *.plg
268 |
269 | # Visual Studio 6 workspace options file
270 | *.opt
271 |
272 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
273 | *.vbw
274 |
275 | # Visual Studio LightSwitch build output
276 | **/*.HTMLClient/GeneratedArtifacts
277 | **/*.DesktopClient/GeneratedArtifacts
278 | **/*.DesktopClient/ModelManifest.xml
279 | **/*.Server/GeneratedArtifacts
280 | **/*.Server/ModelManifest.xml
281 | _Pvt_Extensions
282 |
283 | # Paket dependency manager
284 | .paket/paket.exe
285 | paket-files/
286 |
287 | # FAKE - F# Make
288 | .fake/
289 |
290 | # JetBrains Rider
291 | .idea/
292 | *.sln.iml
293 |
294 | # CodeRush
295 | .cr/
296 |
297 | # Python Tools for Visual Studio (PTVS)
298 | __pycache__/
299 | *.pyc
300 |
301 | # Cake - Uncomment if you are using it
302 | # tools/**
303 | # !tools/packages.config
304 |
305 | # Tabs Studio
306 | *.tss
307 |
308 | # Telerik's JustMock configuration file
309 | *.jmconfig
310 |
311 | # BizTalk build output
312 | *.btp.cs
313 | *.btm.cs
314 | *.odx.cs
315 | *.xsd.cs
316 |
317 | # OpenCover UI analysis results
318 | OpenCover/
319 |
320 | # Azure Stream Analytics local run output
321 | ASALocalRun/
322 |
323 | # MSBuild Binary and Structured Log
324 | *.binlog
325 |
326 | # NVidia Nsight GPU debugger configuration file
327 | *.nvuser
328 |
329 | # MFractors (Xamarin productivity tool) working folder
330 | .mfractor/
331 |
--------------------------------------------------------------------------------
/DMSkin-for-WPF.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 15
4 | VisualStudioVersion = 15.0.27703.2035
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DMSkin.WPF.Demos", "DMSkin.WPF.Demos\DMSkin.WPF.Demos.csproj", "{C758EC5E-4A44-4921-8C8A-2F0127BB9406}"
7 | EndProject
8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DMSkin.WPF", "DMSkin.WPF\DMSkin.WPF.csproj", "{168352B1-6A0C-4C9C-8A32-68B512DA3CFC}"
9 | EndProject
10 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "Samples", "{2DF8544C-E3FF-4A5B-9457-D6ACDA73FD6A}"
11 | EndProject
12 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DMSkin.Core", "DMSkin.Core\DMSkin.Core.csproj", "{13DA6558-356B-47B9-96F2-FE4D5457CB02}"
13 | EndProject
14 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DMSkin.WPF.AntDesign", "DMSkin.WPF.AntDesign\DMSkin.WPF.AntDesign.csproj", "{D633FDA6-DDBE-46D6-A3E4-8BCC145935BF}"
15 | EndProject
16 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DMSkin", "DMSkin", "{FA2916B9-1FB8-4B88-A5D5-470D5ED67B48}"
17 | EndProject
18 | Global
19 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
20 | Debug|Any CPU = Debug|Any CPU
21 | Debug|x64 = Debug|x64
22 | Debug|x86 = Debug|x86
23 | Release|Any CPU = Release|Any CPU
24 | Release|x64 = Release|x64
25 | Release|x86 = Release|x86
26 | EndGlobalSection
27 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
28 | {C758EC5E-4A44-4921-8C8A-2F0127BB9406}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
29 | {C758EC5E-4A44-4921-8C8A-2F0127BB9406}.Debug|Any CPU.Build.0 = Debug|Any CPU
30 | {C758EC5E-4A44-4921-8C8A-2F0127BB9406}.Debug|x64.ActiveCfg = Debug|x64
31 | {C758EC5E-4A44-4921-8C8A-2F0127BB9406}.Debug|x64.Build.0 = Debug|x64
32 | {C758EC5E-4A44-4921-8C8A-2F0127BB9406}.Debug|x86.ActiveCfg = Debug|x86
33 | {C758EC5E-4A44-4921-8C8A-2F0127BB9406}.Debug|x86.Build.0 = Debug|x86
34 | {C758EC5E-4A44-4921-8C8A-2F0127BB9406}.Release|Any CPU.ActiveCfg = Release|Any CPU
35 | {C758EC5E-4A44-4921-8C8A-2F0127BB9406}.Release|Any CPU.Build.0 = Release|Any CPU
36 | {C758EC5E-4A44-4921-8C8A-2F0127BB9406}.Release|x64.ActiveCfg = Release|x64
37 | {C758EC5E-4A44-4921-8C8A-2F0127BB9406}.Release|x64.Build.0 = Release|x64
38 | {C758EC5E-4A44-4921-8C8A-2F0127BB9406}.Release|x86.ActiveCfg = Release|x86
39 | {C758EC5E-4A44-4921-8C8A-2F0127BB9406}.Release|x86.Build.0 = Release|x86
40 | {168352B1-6A0C-4C9C-8A32-68B512DA3CFC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
41 | {168352B1-6A0C-4C9C-8A32-68B512DA3CFC}.Debug|Any CPU.Build.0 = Debug|Any CPU
42 | {168352B1-6A0C-4C9C-8A32-68B512DA3CFC}.Debug|x64.ActiveCfg = Debug|Any CPU
43 | {168352B1-6A0C-4C9C-8A32-68B512DA3CFC}.Debug|x64.Build.0 = Debug|Any CPU
44 | {168352B1-6A0C-4C9C-8A32-68B512DA3CFC}.Debug|x86.ActiveCfg = Debug|Any CPU
45 | {168352B1-6A0C-4C9C-8A32-68B512DA3CFC}.Debug|x86.Build.0 = Debug|Any CPU
46 | {168352B1-6A0C-4C9C-8A32-68B512DA3CFC}.Release|Any CPU.ActiveCfg = Release|Any CPU
47 | {168352B1-6A0C-4C9C-8A32-68B512DA3CFC}.Release|Any CPU.Build.0 = Release|Any CPU
48 | {168352B1-6A0C-4C9C-8A32-68B512DA3CFC}.Release|x64.ActiveCfg = Release|Any CPU
49 | {168352B1-6A0C-4C9C-8A32-68B512DA3CFC}.Release|x64.Build.0 = Release|Any CPU
50 | {168352B1-6A0C-4C9C-8A32-68B512DA3CFC}.Release|x86.ActiveCfg = Release|Any CPU
51 | {168352B1-6A0C-4C9C-8A32-68B512DA3CFC}.Release|x86.Build.0 = Release|Any CPU
52 | {13DA6558-356B-47B9-96F2-FE4D5457CB02}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
53 | {13DA6558-356B-47B9-96F2-FE4D5457CB02}.Debug|Any CPU.Build.0 = Debug|Any CPU
54 | {13DA6558-356B-47B9-96F2-FE4D5457CB02}.Debug|x64.ActiveCfg = Debug|Any CPU
55 | {13DA6558-356B-47B9-96F2-FE4D5457CB02}.Debug|x64.Build.0 = Debug|Any CPU
56 | {13DA6558-356B-47B9-96F2-FE4D5457CB02}.Debug|x86.ActiveCfg = Debug|Any CPU
57 | {13DA6558-356B-47B9-96F2-FE4D5457CB02}.Debug|x86.Build.0 = Debug|Any CPU
58 | {13DA6558-356B-47B9-96F2-FE4D5457CB02}.Release|Any CPU.ActiveCfg = Release|Any CPU
59 | {13DA6558-356B-47B9-96F2-FE4D5457CB02}.Release|Any CPU.Build.0 = Release|Any CPU
60 | {13DA6558-356B-47B9-96F2-FE4D5457CB02}.Release|x64.ActiveCfg = Release|Any CPU
61 | {13DA6558-356B-47B9-96F2-FE4D5457CB02}.Release|x64.Build.0 = Release|Any CPU
62 | {13DA6558-356B-47B9-96F2-FE4D5457CB02}.Release|x86.ActiveCfg = Release|Any CPU
63 | {13DA6558-356B-47B9-96F2-FE4D5457CB02}.Release|x86.Build.0 = Release|Any CPU
64 | {D633FDA6-DDBE-46D6-A3E4-8BCC145935BF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
65 | {D633FDA6-DDBE-46D6-A3E4-8BCC145935BF}.Debug|Any CPU.Build.0 = Debug|Any CPU
66 | {D633FDA6-DDBE-46D6-A3E4-8BCC145935BF}.Debug|x64.ActiveCfg = Debug|Any CPU
67 | {D633FDA6-DDBE-46D6-A3E4-8BCC145935BF}.Debug|x64.Build.0 = Debug|Any CPU
68 | {D633FDA6-DDBE-46D6-A3E4-8BCC145935BF}.Debug|x86.ActiveCfg = Debug|Any CPU
69 | {D633FDA6-DDBE-46D6-A3E4-8BCC145935BF}.Debug|x86.Build.0 = Debug|Any CPU
70 | {D633FDA6-DDBE-46D6-A3E4-8BCC145935BF}.Release|Any CPU.ActiveCfg = Release|Any CPU
71 | {D633FDA6-DDBE-46D6-A3E4-8BCC145935BF}.Release|Any CPU.Build.0 = Release|Any CPU
72 | {D633FDA6-DDBE-46D6-A3E4-8BCC145935BF}.Release|x64.ActiveCfg = Release|Any CPU
73 | {D633FDA6-DDBE-46D6-A3E4-8BCC145935BF}.Release|x64.Build.0 = Release|Any CPU
74 | {D633FDA6-DDBE-46D6-A3E4-8BCC145935BF}.Release|x86.ActiveCfg = Release|Any CPU
75 | {D633FDA6-DDBE-46D6-A3E4-8BCC145935BF}.Release|x86.Build.0 = Release|Any CPU
76 | EndGlobalSection
77 | GlobalSection(SolutionProperties) = preSolution
78 | HideSolutionNode = FALSE
79 | EndGlobalSection
80 | GlobalSection(NestedProjects) = preSolution
81 | {C758EC5E-4A44-4921-8C8A-2F0127BB9406} = {2DF8544C-E3FF-4A5B-9457-D6ACDA73FD6A}
82 | {168352B1-6A0C-4C9C-8A32-68B512DA3CFC} = {FA2916B9-1FB8-4B88-A5D5-470D5ED67B48}
83 | {13DA6558-356B-47B9-96F2-FE4D5457CB02} = {FA2916B9-1FB8-4B88-A5D5-470D5ED67B48}
84 | {D633FDA6-DDBE-46D6-A3E4-8BCC145935BF} = {FA2916B9-1FB8-4B88-A5D5-470D5ED67B48}
85 | EndGlobalSection
86 | GlobalSection(ExtensibilityGlobals) = postSolution
87 | SolutionGuid = {6069BA25-CF28-480D-A274-F643B7FADE0D}
88 | EndGlobalSection
89 | EndGlobal
90 |
--------------------------------------------------------------------------------
/DMSkin.Core/Common/Base64.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Text;
3 |
4 | namespace DMSkin.Core.Commom
5 | {
6 | public sealed class Base64
7 | {
8 | ///
9 | /// Base64加密
10 | ///
11 | /// 加密采用的编码方式
12 | /// 待加密的明文
13 | /// 返回加密的文本
14 | public static string EncodeBase64(Encoding encode, string source)
15 | {
16 | byte[] bytes = encode.GetBytes(source);
17 | try
18 | {
19 | source = Convert.ToBase64String(bytes);
20 | }
21 | catch
22 | {
23 |
24 | }
25 | return source;
26 | }
27 |
28 | ///
29 | /// Base64加密,采用utf8编码方式加密
30 | ///
31 | /// 待加密的明文
32 | /// 加密后的字符串
33 | public static string EncodeBase64(string source)
34 | {
35 | return EncodeBase64(Encoding.UTF8, source);
36 | }
37 |
38 | ///
39 | /// Base64解密
40 | ///
41 | /// 解密采用的编码方式,注意和加密时采用的方式一致
42 | /// 待解密的密文
43 | /// 解密后的字符串
44 | public static string DecodeBase64(Encoding encode, string result)
45 | {
46 | string decode = "";
47 | byte[] bytes = Convert.FromBase64String(result);
48 | try
49 | {
50 | decode = encode.GetString(bytes);
51 | }
52 | catch
53 | {
54 | decode = result;
55 | }
56 | return decode;
57 | }
58 |
59 | ///
60 | /// Base64解密,采用utf8编码方式解密
61 | ///
62 | /// 待解密的密文
63 | /// 解密后的字符串
64 | public static string DecodeBase64(string result)
65 | {
66 | return DecodeBase64(Encoding.UTF8, result);
67 | }
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/DMSkin.Core/Common/Execute.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows.Threading;
3 |
4 | namespace DMSkin.Core.Common
5 | {
6 | public static class Execute
7 | {
8 | private static Action executor = (action, async) => action();
9 | ///
10 | /// 初始化UI调度器
11 | ///
12 | public static void InitializeWithDispatcher()
13 | {
14 | var dispatcher = Dispatcher.CurrentDispatcher;
15 | executor = (action, async) =>
16 | {
17 | //确认是当前的线程
18 | if (dispatcher.CheckAccess())
19 | {
20 | action();
21 | }
22 | else
23 | {
24 | //异步执行
25 | if (async)
26 | {
27 | dispatcher.BeginInvoke(action);
28 | }
29 | else
30 | {
31 | dispatcher.Invoke(action);
32 | }
33 | }
34 | };
35 | }
36 |
37 | ///
38 | /// UI线程中执行方法
39 | ///
40 | public static void OnUIThread(this Action action,bool async = false)
41 | {
42 | executor(action,async);
43 | }
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/DMSkin.Core/Common/UINT.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace DMSkin.Core.Common
7 | {
8 | public class UINT
9 | {
10 | ///
11 | /// 将数据转换为
12 | ///
13 | /// 数值
14 | /// 从类型
15 | /// 到类型
16 | /// 小数点后位数
17 | public static string ToSize(UINTYPE fromtype,double size,int count = 2)
18 | {
19 | double temp = size;
20 | double mod = 1024.0;
21 | switch (fromtype)
22 | {
23 | case UINTYPE.KB:
24 | temp = size * mod;
25 | break;
26 | case UINTYPE.MB:
27 | temp = size * mod * mod;
28 | break;
29 | case UINTYPE.GB:
30 | temp = size * mod * mod * mod;
31 | break;
32 | }
33 |
34 | string[] units = new string[] { "B", "KB", "MB", "GB", "TB"};
35 | int i = 0;
36 | while (temp >= mod)
37 | {
38 | temp /= mod;
39 | i++;
40 | }
41 | return Math.Round(temp,count) + units[i];
42 | }
43 | }
44 |
45 | public enum UINTYPE
46 | {
47 | B,
48 | KB,
49 | MB,
50 | GB
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/DMSkin.Core/Converters/BoolToVisibilityConverter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Globalization;
3 | using System.Windows;
4 | using System.Windows.Data;
5 |
6 | namespace DMSkin.Core.Converters
7 | {
8 | ///
9 | /// Bool 转换 为 Visibility
10 | ///
11 | public class BoolToVisibilityConverter : IValueConverter
12 | {
13 | ///
14 | /// 转换函数
15 | ///
16 | /// 只要有值就会被反转 - 相当于取反
17 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
18 | {
19 | if (value is bool b && b)
20 | {
21 | return ConvertFun(Visibility.Visible, parameter);
22 | }
23 | return ConvertFun(Visibility.Collapsed, parameter);
24 | }
25 |
26 | public object ConvertFun(Visibility visibility, object parameter)
27 | {
28 | //有command参数 取反值
29 | if (parameter is string p)//取反值
30 | {
31 | if (visibility == Visibility.Visible)
32 | {
33 | return Visibility.Collapsed;
34 | }
35 | return Visibility.Visible;
36 | }
37 | return visibility;
38 | }
39 |
40 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
41 | {
42 | return value != null && value.Equals(true) ? parameter : Binding.DoNothing;
43 | }
44 | }
45 | }
--------------------------------------------------------------------------------
/DMSkin.Core/Converters/CompareToVisibilityConverter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Globalization;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Windows;
7 | using System.Windows.Data;
8 | using Converts = System.Convert;
9 |
10 | namespace DMSkin.Core.Converters
11 | {
12 | ///
13 | /// 比较数字大小 返回是否显示的转换器
14 | /// 例:当界面尺寸大于某个值的时候显示某些东西。
15 | ///
16 | public class CompareToVisibilityConverter : IValueConverter
17 | {
18 | ///
19 | /// 转换函数
20 | ///
21 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
22 | {
23 | try
24 | {
25 | double v1 = Converts.ToDouble(value);
26 | double v2 = Converts.ToDouble(parameter);
27 | if (v1 > v2)
28 | {
29 | return Visibility.Visible;
30 | }
31 | }
32 | catch (Exception)
33 | {
34 |
35 | }
36 | return Visibility.Collapsed;
37 | }
38 |
39 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
40 | {
41 | return Binding.DoNothing;
42 | }
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/DMSkin.Core/Converters/EnumToBooleanConverter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Globalization;
3 | using System.Windows.Data;
4 |
5 | namespace DMSkin.Core.Converters
6 | {
7 | public class EnumToBooleanConverter : IValueConverter
8 | {
9 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
10 | {
11 | if (value == null||value.ToString()!=parameter.ToString())
12 | {
13 | return false;
14 | }
15 | return true;
16 | }
17 |
18 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
19 | {
20 | return value != null && value.Equals(true) ? parameter : Binding.DoNothing;
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/DMSkin.Core/Converters/EnumToVisibilityConverter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Globalization;
3 | using System.Windows;
4 | using System.Windows.Data;
5 |
6 | namespace DMSkin.Core.Converters
7 | {
8 | ///
9 | /// 将枚举值 转换为 是否显示
10 | ///
11 | public class EnumToVisibilityConverter : IValueConverter
12 | {
13 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
14 | {
15 | if (value == null||value.ToString()!=parameter.ToString())
16 | {
17 | return Visibility.Collapsed;
18 | }
19 | return Visibility.Visible;
20 | }
21 |
22 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
23 | {
24 | return value != null && value.Equals(true) ? parameter : Binding.DoNothing;
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/DMSkin.Core/Converters/SecondToStringConverter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Globalization;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Windows.Data;
7 |
8 | namespace DMSkin.Core.Converters
9 | {
10 | ///
11 | /// 将秒数 转换 为时间显示 00:10:00
12 | ///
13 | public class SecondToStringConverter : IValueConverter
14 | {
15 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
16 | {
17 | if (value is int offset)
18 | {
19 | var absOffset = Math.Abs(offset);
20 | var hour = ((absOffset / 3600)).ToString();
21 | var minute = ((absOffset - ((absOffset / 3600) * 3600)) / 60).ToString();
22 | var second = ((absOffset - ((absOffset / 3600) * 3600)) % 60).ToString();
23 | return $"{(offset >= 0 ? "" : "-")}{hour.PadLeft(2, '0')}:{minute.PadLeft(2, '0')}:{second.PadLeft(2, '0')}";
24 | }
25 | return value;
26 | }
27 |
28 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
29 | {
30 | var arr = (value as string)?.Split(':');
31 | if (arr?.Length == 2)
32 | {
33 | long hour, minute;
34 | if (Int64.TryParse(arr[0], out hour) && Int64.TryParse(arr[1], out minute))
35 | {
36 | return hour * 3600 + minute * 60;
37 | }
38 | }
39 | return value;
40 | }
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/DMSkin.Core/Converters/TimeSpanToStringConverter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Globalization;
3 | using System.Windows.Data;
4 |
5 | namespace DMSkin.Core.Converters
6 | {
7 | ///
8 | /// 将TimeSpan 转换为 00:00
9 | ///
10 | [ValueConversion(typeof(DateTime?), typeof(string))]
11 | public class TimeSpanToStringConverter : IValueConverter
12 | {
13 | #region Implementation of IValueConverter
14 |
15 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
16 | {
17 | var date = (TimeSpan)value;
18 | return date.ToString(@"mm\:ss\ ");
19 | }
20 |
21 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
22 | {
23 | throw new NotSupportedException();
24 | }
25 | #endregion
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/DMSkin.Core/DMSkin.Core.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {13DA6558-356B-47B9-96F2-FE4D5457CB02}
8 | Library
9 | Properties
10 | DMSkin.Core
11 | DMSkin.Core
12 | v4.0
13 | 512
14 | true
15 |
16 |
17 |
18 | true
19 | full
20 | false
21 | bin\Debug\
22 | DEBUG;TRACE
23 | prompt
24 | 4
25 | false
26 |
27 |
28 | pdbonly
29 | true
30 | bin\Release\
31 | TRACE
32 | prompt
33 | 4
34 | false
35 |
36 |
37 | true
38 | bin\x86\Debug\
39 | DEBUG;TRACE
40 | full
41 | x86
42 | prompt
43 | MinimumRecommendedRules.ruleset
44 | false
45 |
46 |
47 | bin\x86\Release\
48 | TRACE
49 | true
50 | pdbonly
51 | x86
52 | prompt
53 | MinimumRecommendedRules.ruleset
54 | false
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
--------------------------------------------------------------------------------
/DMSkin.Core/MVVM/DelegateCommand.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows.Input;
3 |
4 | namespace DMSkin.Core.MVVM
5 | {
6 | public class DelegateCommand : ICommand
7 | {
8 | private Action