├── .gitattributes
├── .gitignore
├── README.md
├── docs
├── resource
│ ├── IconSource
│ │ └── font_8ogtnltrgul
│ │ │ ├── demo.css
│ │ │ ├── demo_index.html
│ │ │ ├── iconfont.css
│ │ │ ├── iconfont.eot
│ │ │ ├── iconfont.js
│ │ │ ├── iconfont.json
│ │ │ ├── iconfont.svg
│ │ │ ├── iconfont.ttf
│ │ │ ├── iconfont.woff
│ │ │ └── iconfont.woff2
│ ├── System.Windows.Interactivity.dll
│ ├── WeMove-SignIn.psd
│ ├── log.png
│ ├── log.psd
│ ├── readme.image
│ │ ├── log.png
│ │ ├── log48.png
│ │ ├── main.png
│ │ ├── signin.png
│ │ ├── signinpwd.png
│ │ └── signup.png
│ ├── wemove-sign.0.png
│ └── wemove.ico
└── tutorial
│ ├── MYSQL数据库搭建与测试.md
│ ├── WeMove .NET 5移植.md
│ ├── WeMove 21年接下来.md
│ ├── WeMove 更新数据库到MYSQL8.0.md
│ ├── WeMove 界面语言定义和切换.md
│ ├── WeMove 登录信息验证调整与焦点获取.md
│ ├── WeMove 自定义图标按钮.md
│ ├── WeMove 自定义窗口新设计.md
│ └── WeMove 错误提供与擦除.md
└── src
└── Melphily200329.WeMove
├── Deamon
├── App.xaml
├── App.xaml.cs
├── AssemblyInfo.cs
├── Deamon.csproj
├── Deamon.csproj.user
├── Models
│ └── MainModule.cs
├── ServiceLocator.cs
├── System.Windows.Interactivity.dll
├── Themes
│ ├── DefaultStyles.xaml
│ └── Generic.xaml
├── UiCore
│ ├── AttachedProperties
│ │ ├── BaseAttachedProperty.cs
│ │ ├── IsBusyProperty.cs
│ │ ├── IsFocusedProperty.cs
│ │ ├── IsMaximizedProperty.cs
│ │ └── PasswordProperties.cs
│ ├── CommonHelper.cs
│ ├── Controls
│ │ ├── CommandControl.cs
│ │ └── IconButton.cs
│ ├── Styles
│ │ ├── Buttons.xaml
│ │ ├── CheckBoxs.xaml
│ │ ├── IconButtons.xaml
│ │ ├── Languages
│ │ │ ├── String.en-US.xaml
│ │ │ └── String.zh-CN.xaml
│ │ ├── PasswordBoxs.xaml
│ │ └── TextBoxs.xaml
│ ├── Util
│ │ └── AnimationExtensions.cs
│ ├── ValueConverters
│ │ ├── BooleanToObjectConverter.cs
│ │ └── ValueConverter.xaml
│ └── WindowResizer.cs
├── ViewModels
│ ├── BaseWindowModel.cs
│ ├── MainViewModel.cs
│ └── Sign
│ │ ├── BaseSignInViewModel.cs
│ │ ├── SignInMailViewModel.cs
│ │ ├── SignInPassViewModel.cs
│ │ ├── SignUpViewModel.cs
│ │ └── SignViewModel.cs
├── Views
│ ├── MainWindow.xaml
│ ├── MainWindow.xaml.cs
│ ├── SearchView.xaml
│ ├── SearchView.xaml.cs
│ └── Sign
│ │ ├── AnimatableBaseView.cs
│ │ ├── SignHost.xaml
│ │ ├── SignHost.xaml.cs
│ │ ├── SignInMailView.xaml
│ │ ├── SignInMailView.xaml.cs
│ │ ├── SignInPassView.xaml
│ │ ├── SignInPassView.xaml.cs
│ │ ├── SignLoadingView.xaml
│ │ ├── SignLoadingView.xaml.cs
│ │ ├── SignUpView.xaml
│ │ ├── SignUpView.xaml.cs
│ │ ├── SignWindow.xaml
│ │ └── SignWindow.xaml.cs
└── wemove.ico
├── MeiOrm
├── BaseSqlService.cs
├── MeiOrm.csproj
├── OperationResult.cs
└── SqlConnectionConfig.cs
├── Melphi.Base
├── Binder.cs
├── ExpressionHelpers.cs
├── IBinder.cs
├── IModule.cs
├── Melphi.Base.csproj
├── NotifyPropertyChanged.cs
├── RelayCommand.cs
└── ServiceProvider.cs
├── Melphi.Core
├── Melphi.Core.csproj
├── MySql.Data.dll
└── MySqlDatabaseEntity.cs
├── Melphi.IconSet
├── FdoiIconSet.cs
├── IIconSet.cs
├── MaterialSet.cs
└── Melphi.IconSet.csproj
├── Melphi.WebApi
├── Melphi.WebApi.csproj
├── Program.cs
├── Properties
│ └── launchSettings.json
├── WemoveDbService.cs
├── appsettings.Development.json
├── appsettings.json
└── wemove_db_sql.txt
└── Melphily200329.WeMove.sln
/.gitattributes:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Set default behavior to automatically normalize line endings.
3 | ###############################################################################
4 | * text=auto
5 |
6 | ###############################################################################
7 | # Set default behavior for command prompt diff.
8 | #
9 | # This is need for earlier builds of msysgit that does not have it on by
10 | # default for csharp files.
11 | # Note: This is only used by command line
12 | ###############################################################################
13 | #*.cs diff=csharp
14 |
15 | ###############################################################################
16 | # Set the merge driver for project and solution files
17 | #
18 | # Merging from the command prompt will add diff markers to the files if there
19 | # are conflicts (Merging from VS is not affected by the settings below, in VS
20 | # the diff markers are never inserted). Diff markers may cause the following
21 | # file extensions to fail to load in VS. An alternative would be to treat
22 | # these files as binary and thus will always conflict and require user
23 | # intervention with every merge. To do so, just uncomment the entries below
24 | ###############################################################################
25 | #*.sln merge=binary
26 | #*.csproj merge=binary
27 | #*.vbproj merge=binary
28 | #*.vcxproj merge=binary
29 | #*.vcproj merge=binary
30 | #*.dbproj merge=binary
31 | #*.fsproj merge=binary
32 | #*.lsproj merge=binary
33 | #*.wixproj merge=binary
34 | #*.modelproj merge=binary
35 | #*.sqlproj merge=binary
36 | #*.wwaproj merge=binary
37 |
38 | ###############################################################################
39 | # behavior for image files
40 | #
41 | # image files are treated as binary by default.
42 | ###############################################################################
43 | #*.jpg binary
44 | #*.png binary
45 | #*.gif binary
46 |
47 | ###############################################################################
48 | # diff behavior for common document formats
49 | #
50 | # Convert binary document formats to text before diffing them. This feature
51 | # is only available from the command line. Turn it on by uncommenting the
52 | # entries below.
53 | ###############################################################################
54 | #*.doc diff=astextplain
55 | #*.DOC diff=astextplain
56 | #*.docx diff=astextplain
57 | #*.DOCX diff=astextplain
58 | #*.dot diff=astextplain
59 | #*.DOT diff=astextplain
60 | #*.pdf diff=astextplain
61 | #*.PDF diff=astextplain
62 | #*.rtf diff=astextplain
63 | #*.RTF diff=astextplain
64 |
--------------------------------------------------------------------------------
/.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 | *.rsuser
8 | *.suo
9 | *.user
10 | *.userosscache
11 | *.sln.docstates
12 | doc/*/*.ini
13 |
14 | # User-specific files (MonoDevelop/Xamarin Studio)
15 | *.userprefs
16 |
17 | # Build results
18 | [Dd]ebug/
19 | [Dd]ebugPublic/
20 | [Rr]elease/
21 | [Rr]eleases/
22 | x64/
23 | x86/
24 | [Aa][Rr][Mm]/
25 | [Aa][Rr][Mm]64/
26 | bld/
27 | [Bb]in/
28 | [Oo]bj/
29 | [Ll]og/
30 |
31 | # Visual Studio 2015/2017 cache/options directory
32 | .vs/
33 | # Uncomment if you have tasks that create the project's static files in wwwroot
34 | #wwwroot/
35 |
36 | # Visual Studio 2017 auto generated files
37 | Generated\ Files/
38 |
39 | # MSTest test Results
40 | [Tt]est[Rr]esult*/
41 | [Bb]uild[Ll]og.*
42 |
43 | # NUNIT
44 | *.VisualState.xml
45 | TestResult.xml
46 |
47 | # Build Results of an ATL Project
48 | [Dd]ebugPS/
49 | [Rr]eleasePS/
50 | dlldata.c
51 |
52 | # Benchmark Results
53 | BenchmarkDotNet.Artifacts/
54 |
55 | # .NET Core
56 | project.lock.json
57 | project.fragment.lock.json
58 | artifacts/
59 |
60 | # StyleCop
61 | StyleCopReport.xml
62 |
63 | # Files built by Visual Studio
64 | *_i.c
65 | *_p.c
66 | *_h.h
67 | *.ilk
68 | *.meta
69 | *.obj
70 | *.iobj
71 | *.pch
72 | *.pdb
73 | *.ipdb
74 | *.pgc
75 | *.pgd
76 | *.rsp
77 | *.sbr
78 | *.tlb
79 | *.tli
80 | *.tlh
81 | *.tmp
82 | *.tmp_proj
83 | *_wpftmp.csproj
84 | *.log
85 | *.vspscc
86 | *.vssscc
87 | .builds
88 | *.pidb
89 | *.svclog
90 | *.scc
91 |
92 | # Chutzpah Test files
93 | _Chutzpah*
94 |
95 | # Visual C++ cache files
96 | ipch/
97 | *.aps
98 | *.ncb
99 | *.opendb
100 | *.opensdf
101 | *.sdf
102 | *.cachefile
103 | *.VC.db
104 | *.VC.VC.opendb
105 |
106 | # Visual Studio profiler
107 | *.psess
108 | *.vsp
109 | *.vspx
110 | *.sap
111 |
112 | # Visual Studio Trace Files
113 | *.e2e
114 |
115 | # TFS 2012 Local Workspace
116 | $tf/
117 |
118 | # Guidance Automation Toolkit
119 | *.gpState
120 |
121 | # ReSharper is a .NET coding add-in
122 | _ReSharper*/
123 | *.[Rr]e[Ss]harper
124 | *.DotSettings.user
125 |
126 | # JustCode is a .NET coding add-in
127 | .JustCode
128 |
129 | # TeamCity is a build add-in
130 | _TeamCity*
131 |
132 | # DotCover is a Code Coverage Tool
133 | *.dotCover
134 |
135 | # AxoCover is a Code Coverage Tool
136 | .axoCover/*
137 | !.axoCover/settings.json
138 |
139 | # Visual Studio code coverage results
140 | *.coverage
141 | *.coveragexml
142 |
143 | # NCrunch
144 | _NCrunch_*
145 | .*crunch*.local.xml
146 | nCrunchTemp_*
147 |
148 | # MightyMoose
149 | *.mm.*
150 | AutoTest.Net/
151 |
152 | # Web workbench (sass)
153 | .sass-cache/
154 |
155 | # Installshield output folder
156 | [Ee]xpress/
157 |
158 | # DocProject is a documentation generator add-in
159 | DocProject/buildhelp/
160 | DocProject/Help/*.HxT
161 | DocProject/Help/*.HxC
162 | DocProject/Help/*.hhc
163 | DocProject/Help/*.hhk
164 | DocProject/Help/*.hhp
165 | DocProject/Help/Html2
166 | DocProject/Help/html
167 |
168 | # Click-Once directory
169 | publish/
170 |
171 | # Publish Web Output
172 | *.[Pp]ublish.xml
173 | *.azurePubxml
174 | # Note: Comment the next line if you want to checkin your web deploy settings,
175 | # but database connection strings (with potential passwords) will be unencrypted
176 | *.pubxml
177 | *.publishproj
178 |
179 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
180 | # checkin your Azure Web App publish settings, but sensitive information contained
181 | # in these scripts will be unencrypted
182 | PublishScripts/
183 |
184 | # NuGet Packages
185 | *.nupkg
186 | # The packages folder can be ignored because of Package Restore
187 | **/[Pp]ackages/*
188 | # except build/, which is used as an MSBuild target.
189 | !**/[Pp]ackages/build/
190 | # Uncomment if necessary however generally it will be regenerated when needed
191 | #!**/[Pp]ackages/repositories.config
192 | # NuGet v3's project.json files produces more ignorable files
193 | *.nuget.props
194 | *.nuget.targets
195 |
196 | # Microsoft Azure Build Output
197 | csx/
198 | *.build.csdef
199 |
200 | # Microsoft Azure Emulator
201 | ecf/
202 | rcf/
203 |
204 | # Windows Store app package directories and files
205 | AppPackages/
206 | BundleArtifacts/
207 | Package.StoreAssociation.xml
208 | _pkginfo.txt
209 | *.appx
210 |
211 | # Visual Studio cache files
212 | # files ending in .cache can be ignored
213 | *.[Cc]ache
214 | # but keep track of directories ending in .cache
215 | !?*.[Cc]ache/
216 |
217 | # Others
218 | ClientBin/
219 | ~$*
220 | *~
221 | *.dbmdl
222 | *.dbproj.schemaview
223 | *.jfm
224 | *.pfx
225 | *.publishsettings
226 | orleans.codegen.cs
227 |
228 | # Including strong name files can present a security risk
229 | # (https://github.com/github/gitignore/pull/2483#issue-259490424)
230 | #*.snk
231 |
232 | # Since there are multiple workflows, uncomment next line to ignore bower_components
233 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
234 | #bower_components/
235 |
236 | # RIA/Silverlight projects
237 | Generated_Code/
238 |
239 | # Backup & report files from converting an old project file
240 | # to a newer Visual Studio version. Backup files are not needed,
241 | # because we have git ;-)
242 | _UpgradeReport_Files/
243 | Backup*/
244 | UpgradeLog*.XML
245 | UpgradeLog*.htm
246 | ServiceFabricBackup/
247 | *.rptproj.bak
248 |
249 | # SQL Server files
250 | *.mdf
251 | *.ldf
252 | *.ndf
253 |
254 | # Business Intelligence projects
255 | *.rdl.data
256 | *.bim.layout
257 | *.bim_*.settings
258 | *.rptproj.rsuser
259 | *- Backup*.rdl
260 |
261 | # Microsoft Fakes
262 | FakesAssemblies/
263 |
264 | # GhostDoc plugin setting file
265 | *.GhostDoc.xml
266 |
267 | # Node.js Tools for Visual Studio
268 | .ntvs_analysis.dat
269 | node_modules/
270 |
271 | # Visual Studio 6 build log
272 | *.plg
273 |
274 | # Visual Studio 6 workspace options file
275 | *.opt
276 |
277 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
278 | *.vbw
279 |
280 | # Visual Studio LightSwitch build output
281 | **/*.HTMLClient/GeneratedArtifacts
282 | **/*.DesktopClient/GeneratedArtifacts
283 | **/*.DesktopClient/ModelManifest.xml
284 | **/*.Server/GeneratedArtifacts
285 | **/*.Server/ModelManifest.xml
286 | _Pvt_Extensions
287 |
288 | # Paket dependency manager
289 | .paket/paket.exe
290 | paket-files/
291 |
292 | # FAKE - F# Make
293 | .fake/
294 |
295 | # JetBrains Rider
296 | .idea/
297 | *.sln.iml
298 |
299 | # CodeRush personal settings
300 | .cr/personal
301 |
302 | # Python Tools for Visual Studio (PTVS)
303 | __pycache__/
304 | *.pyc
305 |
306 | # Cake - Uncomment if you are using it
307 | # tools/**
308 | # !tools/packages.config
309 |
310 | # Tabs Studio
311 | *.tss
312 |
313 | # Telerik's JustMock configuration file
314 | *.jmconfig
315 |
316 | # BizTalk build output
317 | *.btp.cs
318 | *.btm.cs
319 | *.odx.cs
320 | *.xsd.cs
321 |
322 | # OpenCover UI analysis results
323 | OpenCover/
324 |
325 | # Azure Stream Analytics local run output
326 | ASALocalRun/
327 |
328 | # MSBuild Binary and Structured Log
329 | *.binlog
330 |
331 | # NVidia Nsight GPU debugger configuration file
332 | *.nvuser
333 |
334 | # MFractors (Xamarin productivity tool) working folder
335 | .mfractor/
336 |
337 | # Local History for Visual Studio
338 | .localhistory/
339 |
340 | # BeatPulse healthcheck temp database
341 | healthchecksdb
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ---
2 | typora-root-url: ./
3 | ---
4 |
5 |
6 |
7 | #
Desktop-WeMove
8 |
9 | ##
Summary(概要)
10 |
11 | - Wemove is a practical project of WPF technology sharing.
12 | - Wemove是一个练习WPF技术的共享项目。
13 |
14 |
15 |
16 | ##
Screenshots(截图)
17 |
18 | - sign in email page(email verification )登录(邮箱验证)
19 |
20 |
21 |
22 |
23 |
24 | - sign in password page(password verification )登录(密码验证)
25 |
26 |
27 |
28 |
29 |
30 | - sign up page(注册)
31 |
32 |
33 |
34 |
35 |
36 | - main page(主页)
37 |
38 |
39 |
40 |
41 |
42 | ## 数据库
43 |
44 | 数据库表内容
45 |
46 | ```mysql
47 | CREATE TABLE `user_info` (
48 | `Id` int(11) NOT NULL AUTO_INCREMENT,
49 | `UserName` varchar(255) DEFAULT NULL COMMENT '用户名',
50 | `Email` varchar(255) NOT NULL DEFAULT '' COMMENT '邮箱',
51 | `Password` varchar(255) NOT NULL DEFAULT '' COMMENT '密码',
52 | `CreateDate` date DEFAULT '2020-07-16' COMMENT '创建日期',
53 | PRIMARY KEY (`Id`)
54 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户信息表';
55 | ```
56 |
57 | C#链接字符串(本地数据库)
58 |
59 | ```c#
60 | string ConnectionString = @"server = 127.0.0.1; userid = root; password = deamon; database = wemove; persistsecurityinfo = True;";
61 | ```
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
--------------------------------------------------------------------------------
/docs/resource/IconSource/font_8ogtnltrgul/iconfont.css:
--------------------------------------------------------------------------------
1 | @font-face {font-family: "iconfont";
2 | src: url('iconfont.eot?t=1583248561135'); /* IE9 */
3 | src: url('iconfont.eot?t=1583248561135#iefix') format('embedded-opentype'), /* IE6-IE8 */
4 | url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAAAegAAsAAAAAEjAAAAdRAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEIGVgCFFAqSaI5fATYCJANQCyoABCAFhG0HgnMbNA8jETaMcsIl++sDGxxxAyTDcEPNcgNnDjkU9GZ0viaCk0LoZcHvHv34Wng99LOf86H3rDczaSqlS7oLHSB+gf06KgegmzrrM68eluDY+5lWnNAgJ65BOVkuBADx3659M1lCsRUl/CUJqDm+Sbf3od3grtMT3yrim68QaiJhbFjFnmnS9qttNjrTR8BNaXhXeLklamp1Wg9d/7Ufq7pF9UZoZG/tm7wFFlVtYomhMYQkJsmkRGh4STdX4pXQDwIeb98Nrka9CZ84HggABVwEIVk5RVWQgYMrEUr17NalDbJKELgeQwKZHy/YlgOZiz3I6DR6BcCc5O3JG0REBlBIGNx1yzpnd0SayERPNtY69jtSALNeBABtIYABCAJwGlorDFgOZOIYMyjW2UVvABrIQMGL3sJ60SQ6ii6ip9W6tqipWtuKzqJ7fckpgQYChygPXmxEwcBBAh5SyCCX/5OnhApqaKCFjp6BEQgPV1ah+jXbCCILXIEAIucKFBAlEvqARwKgQQKgRQKgA0MK6MGQASYw5IAtGArADgwlYA+GCnAAQw04ImE/cEYC4IIEwB0JgAcYBsCTKjACACHaxg/gA/QOwIbARSsTf+Ih9m6S6aeGkhU5qomJydXw0imowo16nZ9hVMscVQHhRekNenndzCCVrgpb0HKZgqE7OF6J5smnsy6gioecnObHpuUWgEodkss4eQWedvJGnCYtwq8xvIx2BzVh7HxZgtI6NDKsVspZopndSRAj6my/7/cPF7JvPUXvXfliTlzUP6LPvuLvi/TJO15c8y506C/LwD/AXhA0dkaBMm+O+i3RZ8Y+vPI+gw36S15++T7qt8cBtT5m59+x45vqDxqwRRwBrOQYGdSrAXSTkQtQAwt8VbffHt1hSfLGeaxAAdiAuV2vXp/Xw83uE64y6TwslLL+JOKnC0+gPIWWiEtoI3CZUZm+Ij1HRAyiWytjYmKU91CwRQZhmlhEKngp9i/A/AxDfRD20UXYmrDsV2MUWSyScnYM0H1skzzhwfu0Iuy3/Jr7SfeHbs1yx0Kq6sIhus6/X3qFL2q3H2l99Tew1AtZpaI4whWyHB4oqBjOd53vahWn4TXyl6oL4OfT17Wivsd/A0h2yE6e44CaHYlad+emV+WaO/ejsvrhr21zKPumurBBLbXIydgtxPpXifQTGsav48mmdRbL3eTF+m5dl+5yP9nSrt30iydPs1j+V2BdU7uG+2CrFOwIGo/dvz/Ep59a/VUb3lZEv/YWaRpuONxo0CSDmvvU3EudF6+3JB+ZsVXRV7F1RrpU7wic+aiIjIlUuEQFrMHjqNioEsV6SD2a7nO7ym+MyyRmMwmFTAj+bN4Yd1gtnBDShyo2zvub8XfeRs/8dQf6H1iXv6bRUi3L3htXcjyu9Ey2rNpS2PX39OYPPQLGWe1e1+3vtyEvv7bs0LyNw3beV3pw5vSqxPt+95ctC593SV1JVPCYsIGv8/OvcSfS3qam3vdTDcrKCinid0fl7T3VtOV3pl+WGi98TwxcaE7q2rDtftvD+vZlcQG2VjhhHDMxqG9fAVkWhVtQjzEp3csIBz0wdgq1SmMD+hldumRhbOiKjxk3q/0jid7qqvEH/IBwDfFT/c2xnY583PAosHwc183jw3LGT+UZk/klxeScF4TDsTlBfjLmPlF5N8n0D5FmY782x0cHHh0ZmJsfPzTfMAPd/D5syfrR7d497e29tpx9zodKlH/kqiENDbZms2308p1N79VlodXNquEZ8+adq/AZvX5tiTwjUl7SJVtdvDRPP3HYMzUZgr5LGl326wNdGq2Rj4lLszyypiUmRWKM9SMBdIJHJyp7zRijYaqMERnX0XFGlPYyoWdpWdQ4ur2KHksqaSZsPN3rXrDvNHrWOICeNg6lO2Mc6Yq/l8th6OKgyy3apG8y5b/QKXcmLtonidwJgoA/epQbTYC/jszIdtyVk4OFZv8bAb16tCC7RJ9BVHj9gL+WcQYPJGQazfxpRqbCjkIKZ5GJVL1EDtUgOwmUiBJ5VFPtFAiUu7MSRv3BQDg5gACTsCPQ2WNHocEZkaF6VeRQvW8ngY13Ao9umJ0CNcS4TyV89kq34wgkgxFqI5zGZP1QPk5Lv8FQgiSJU1b7AsoOk+jq9p77DAlojQ3ycuiZrbCEUTxd1oEQUEyEC9Bcj+RM86axxoa1xjg7nkUgOXJqBLVx6zQmOzwfN17/DYYSJPU06rj9Aspu7kKn1o5QfJbTqEbPUjEvhx5LEVYEGYQxQ09yBAQvC4VJvNQCNNfGGRnTXCN1ZsfK9f4ofgRkvPmadP9mIVSUZEXVdMO0bMf16BkYCUzhwhp0lSTCVRXA8mV1VnLDyGfqgDINFUwQlI4pogNmOMqTI6Si2E5Bbo6TZcmwaIUlhhKhGtUO1zXCn2FciRfXpICrO2NKLAyTOn8QMDM7v72S05nbu9kSQtYEkCpYO764wMkRyTcrwkdjq4oLhlw3kmczAAA=') format('woff2'),
5 | url('iconfont.woff?t=1583248561135') format('woff'),
6 | url('iconfont.ttf?t=1583248561135') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+ */
7 | url('iconfont.svg?t=1583248561135#iconfont') format('svg'); /* iOS 4.1- */
8 | }
9 |
10 | .iconfont {
11 | font-family: "iconfont" !important;
12 | font-size: 16px;
13 | font-style: normal;
14 | -webkit-font-smoothing: antialiased;
15 | -moz-osx-font-smoothing: grayscale;
16 | }
17 |
18 | .icon-fdoi-arrow-left:before {
19 | content: "\e603";
20 | }
21 |
22 | .icon-fdoi-arrow-right:before {
23 | content: "\e604";
24 | }
25 |
26 | .icon-fdoi-arrow-up:before {
27 | content: "\e605";
28 | }
29 |
30 | .icon-fdoi-arrow-down:before {
31 | content: "\e606";
32 | }
33 |
34 | .icon-fdoi-close:before {
35 | content: "\e60e";
36 | }
37 |
38 | .icon-fdoi-menu:before {
39 | content: "\e60f";
40 | }
41 |
42 | .icon-fdoi-play:before {
43 | content: "\e610";
44 | }
45 |
46 | .icon-fdoi-pause:before {
47 | content: "\e611";
48 | }
49 |
50 | .icon-fdoi-volume-high:before {
51 | content: "\e615";
52 | }
53 |
54 | .icon-fdoi-volume-medium:before {
55 | content: "\e617";
56 | }
57 |
58 | .icon-fdoi-volume-low:before {
59 | content: "\e618";
60 | }
61 |
62 | .icon-fdoi-mute-volume-high:before {
63 | content: "\e619";
64 | }
65 |
66 | .icon-fdoi-mute-volume-medium:before {
67 | content: "\e61a";
68 | }
69 |
70 | .icon-fdoi-mute-volume-low:before {
71 | content: "\e61b";
72 | }
73 |
74 | .icon-fdoi-fullscreen-exit:before {
75 | content: "\e61d";
76 | }
77 |
78 | .icon-fdoi-fullscreen:before {
79 | content: "\e61e";
80 | }
81 |
82 | .icon-fdoi-person:before {
83 | content: "\e621";
84 | }
85 |
86 | .icon-fdoi-build:before {
87 | content: "\e622";
88 | }
89 |
90 | .icon-fdoi-edit:before {
91 | content: "\e623";
92 | }
93 |
94 |
--------------------------------------------------------------------------------
/docs/resource/IconSource/font_8ogtnltrgul/iconfont.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mefdeamon/Desktop-WeMove/b1ad5cffcdbba639416e0dd0b32f8c3b7688eadf/docs/resource/IconSource/font_8ogtnltrgul/iconfont.eot
--------------------------------------------------------------------------------
/docs/resource/IconSource/font_8ogtnltrgul/iconfont.js:
--------------------------------------------------------------------------------
1 | !function(n){var a,d='',o=(a=document.getElementsByTagName("script"))[a.length-1].getAttribute("data-injectcss");if(o&&!n.__iconfont__svg__cssinject__){n.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(a){console&&console.log(a)}}!function(a){if(document.addEventListener)if(~["complete","loaded","interactive"].indexOf(document.readyState))setTimeout(a,0);else{var o=function(){document.removeEventListener("DOMContentLoaded",o,!1),a()};document.addEventListener("DOMContentLoaded",o,!1)}else document.attachEvent&&(t=a,i=n.document,l=!1,(d=function(){try{i.documentElement.doScroll("left")}catch(a){return void setTimeout(d,50)}e()})(),i.onreadystatechange=function(){"complete"==i.readyState&&(i.onreadystatechange=null,e())});function e(){l||(l=!0,t())}var t,i,l,d}(function(){var a,o,e,t,i,l;(a=document.createElement("div")).innerHTML=d,d=null,(o=a.getElementsByTagName("svg")[0])&&(o.setAttribute("aria-hidden","true"),o.style.position="absolute",o.style.width=0,o.style.height=0,o.style.overflow="hidden",e=o,(t=document.body).firstChild?(i=e,(l=t.firstChild).parentNode.insertBefore(i,l)):t.appendChild(e))})}(window);
--------------------------------------------------------------------------------
/docs/resource/IconSource/font_8ogtnltrgul/iconfont.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "",
3 | "name": "",
4 | "font_family": "iconfont",
5 | "css_prefix_text": "icon-",
6 | "description": "",
7 | "glyphs": [
8 | {
9 | "icon_id": "13220932",
10 | "name": "fdoi-arrow-left",
11 | "font_class": "fdoi-arrow-left",
12 | "unicode": "e603",
13 | "unicode_decimal": 58883
14 | },
15 | {
16 | "icon_id": "13220933",
17 | "name": "fdoi-arrow-right",
18 | "font_class": "fdoi-arrow-right",
19 | "unicode": "e604",
20 | "unicode_decimal": 58884
21 | },
22 | {
23 | "icon_id": "13220934",
24 | "name": "fdoi-arrow-up",
25 | "font_class": "fdoi-arrow-up",
26 | "unicode": "e605",
27 | "unicode_decimal": 58885
28 | },
29 | {
30 | "icon_id": "13220935",
31 | "name": "fdoi-arrow-down",
32 | "font_class": "fdoi-arrow-down",
33 | "unicode": "e606",
34 | "unicode_decimal": 58886
35 | },
36 | {
37 | "icon_id": "13221144",
38 | "name": "fdoi-close",
39 | "font_class": "fdoi-close",
40 | "unicode": "e60e",
41 | "unicode_decimal": 58894
42 | },
43 | {
44 | "icon_id": "13221151",
45 | "name": "fdoi-menu",
46 | "font_class": "fdoi-menu",
47 | "unicode": "e60f",
48 | "unicode_decimal": 58895
49 | },
50 | {
51 | "icon_id": "13221212",
52 | "name": "fdoi-play",
53 | "font_class": "fdoi-play",
54 | "unicode": "e610",
55 | "unicode_decimal": 58896
56 | },
57 | {
58 | "icon_id": "13221213",
59 | "name": "fdoi-pause",
60 | "font_class": "fdoi-pause",
61 | "unicode": "e611",
62 | "unicode_decimal": 58897
63 | },
64 | {
65 | "icon_id": "13221683",
66 | "name": "fdoi-volume-high",
67 | "font_class": "fdoi-volume-high",
68 | "unicode": "e615",
69 | "unicode_decimal": 58901
70 | },
71 | {
72 | "icon_id": "13221686",
73 | "name": "fdoi-volume-medium",
74 | "font_class": "fdoi-volume-medium",
75 | "unicode": "e617",
76 | "unicode_decimal": 58903
77 | },
78 | {
79 | "icon_id": "13221687",
80 | "name": "fdoi-volume-low",
81 | "font_class": "fdoi-volume-low",
82 | "unicode": "e618",
83 | "unicode_decimal": 58904
84 | },
85 | {
86 | "icon_id": "13221688",
87 | "name": "fdoi-mute-volume-high",
88 | "font_class": "fdoi-mute-volume-high",
89 | "unicode": "e619",
90 | "unicode_decimal": 58905
91 | },
92 | {
93 | "icon_id": "13221689",
94 | "name": "fdoi-mute-volume-medium",
95 | "font_class": "fdoi-mute-volume-medium",
96 | "unicode": "e61a",
97 | "unicode_decimal": 58906
98 | },
99 | {
100 | "icon_id": "13221690",
101 | "name": "fdoi-mute-volume-low",
102 | "font_class": "fdoi-mute-volume-low",
103 | "unicode": "e61b",
104 | "unicode_decimal": 58907
105 | },
106 | {
107 | "icon_id": "13221701",
108 | "name": "fdoi-fullscreen-exit",
109 | "font_class": "fdoi-fullscreen-exit",
110 | "unicode": "e61d",
111 | "unicode_decimal": 58909
112 | },
113 | {
114 | "icon_id": "13221702",
115 | "name": "fdoi-fullscreen",
116 | "font_class": "fdoi-fullscreen",
117 | "unicode": "e61e",
118 | "unicode_decimal": 58910
119 | },
120 | {
121 | "icon_id": "13221716",
122 | "name": "fdoi-person",
123 | "font_class": "fdoi-person",
124 | "unicode": "e621",
125 | "unicode_decimal": 58913
126 | },
127 | {
128 | "icon_id": "13221717",
129 | "name": "fdoi-build",
130 | "font_class": "fdoi-build",
131 | "unicode": "e622",
132 | "unicode_decimal": 58914
133 | },
134 | {
135 | "icon_id": "13221722",
136 | "name": "fdoi-edit",
137 | "font_class": "fdoi-edit",
138 | "unicode": "e623",
139 | "unicode_decimal": 58915
140 | }
141 | ]
142 | }
143 |
--------------------------------------------------------------------------------
/docs/resource/IconSource/font_8ogtnltrgul/iconfont.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
84 |
--------------------------------------------------------------------------------
/docs/resource/IconSource/font_8ogtnltrgul/iconfont.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mefdeamon/Desktop-WeMove/b1ad5cffcdbba639416e0dd0b32f8c3b7688eadf/docs/resource/IconSource/font_8ogtnltrgul/iconfont.ttf
--------------------------------------------------------------------------------
/docs/resource/IconSource/font_8ogtnltrgul/iconfont.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mefdeamon/Desktop-WeMove/b1ad5cffcdbba639416e0dd0b32f8c3b7688eadf/docs/resource/IconSource/font_8ogtnltrgul/iconfont.woff
--------------------------------------------------------------------------------
/docs/resource/IconSource/font_8ogtnltrgul/iconfont.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mefdeamon/Desktop-WeMove/b1ad5cffcdbba639416e0dd0b32f8c3b7688eadf/docs/resource/IconSource/font_8ogtnltrgul/iconfont.woff2
--------------------------------------------------------------------------------
/docs/resource/System.Windows.Interactivity.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mefdeamon/Desktop-WeMove/b1ad5cffcdbba639416e0dd0b32f8c3b7688eadf/docs/resource/System.Windows.Interactivity.dll
--------------------------------------------------------------------------------
/docs/resource/WeMove-SignIn.psd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mefdeamon/Desktop-WeMove/b1ad5cffcdbba639416e0dd0b32f8c3b7688eadf/docs/resource/WeMove-SignIn.psd
--------------------------------------------------------------------------------
/docs/resource/log.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mefdeamon/Desktop-WeMove/b1ad5cffcdbba639416e0dd0b32f8c3b7688eadf/docs/resource/log.png
--------------------------------------------------------------------------------
/docs/resource/log.psd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mefdeamon/Desktop-WeMove/b1ad5cffcdbba639416e0dd0b32f8c3b7688eadf/docs/resource/log.psd
--------------------------------------------------------------------------------
/docs/resource/readme.image/log.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mefdeamon/Desktop-WeMove/b1ad5cffcdbba639416e0dd0b32f8c3b7688eadf/docs/resource/readme.image/log.png
--------------------------------------------------------------------------------
/docs/resource/readme.image/log48.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mefdeamon/Desktop-WeMove/b1ad5cffcdbba639416e0dd0b32f8c3b7688eadf/docs/resource/readme.image/log48.png
--------------------------------------------------------------------------------
/docs/resource/readme.image/main.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mefdeamon/Desktop-WeMove/b1ad5cffcdbba639416e0dd0b32f8c3b7688eadf/docs/resource/readme.image/main.png
--------------------------------------------------------------------------------
/docs/resource/readme.image/signin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mefdeamon/Desktop-WeMove/b1ad5cffcdbba639416e0dd0b32f8c3b7688eadf/docs/resource/readme.image/signin.png
--------------------------------------------------------------------------------
/docs/resource/readme.image/signinpwd.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mefdeamon/Desktop-WeMove/b1ad5cffcdbba639416e0dd0b32f8c3b7688eadf/docs/resource/readme.image/signinpwd.png
--------------------------------------------------------------------------------
/docs/resource/readme.image/signup.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mefdeamon/Desktop-WeMove/b1ad5cffcdbba639416e0dd0b32f8c3b7688eadf/docs/resource/readme.image/signup.png
--------------------------------------------------------------------------------
/docs/resource/wemove-sign.0.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mefdeamon/Desktop-WeMove/b1ad5cffcdbba639416e0dd0b32f8c3b7688eadf/docs/resource/wemove-sign.0.png
--------------------------------------------------------------------------------
/docs/resource/wemove.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mefdeamon/Desktop-WeMove/b1ad5cffcdbba639416e0dd0b32f8c3b7688eadf/docs/resource/wemove.ico
--------------------------------------------------------------------------------
/docs/tutorial/MYSQL数据库搭建与测试.md:
--------------------------------------------------------------------------------
1 | # MYSQL数据库搭建与测试
2 |
3 | 安装MYSQL 5.5版本
4 |
5 | start server失败时,
6 |
7 | 1.先检查C盘的Program Files Program Files(X86) Windows 有没有 MYSQL文件,有就删除
8 |
9 | 2.检查我们使用的端口(例如3306)有没有被占用,如果有就把那个程序给暂停。(切换一个没有工作的端口)。
10 |
11 |
12 |
13 |
14 |
15 | 安装MYSQL-FONT可视化工具
16 |
17 | 登录到本地
18 |
19 | 新建数据库 wemove
20 |
21 | 新建用户信息表 user_info 及其相关字段
22 |
23 | ```mysql
24 | CREATE TABLE `user_info` (
25 | `Id` int(11) NOT NULL AUTO_INCREMENT,
26 | `UserName` varchar(255) DEFAULT NULL COMMENT '用户名',
27 | `Email` varchar(255) NOT NULL DEFAULT '' COMMENT '邮箱',
28 | `Password` varchar(255) NOT NULL DEFAULT '' COMMENT '密码',
29 | `CreateDate` date DEFAULT '2020-07-16' COMMENT '创建日期',
30 | PRIMARY KEY (`Id`)
31 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户信息表';
32 | ```
33 |
34 | 新增一行数据(用于测试使用)
35 |
36 | 在WeMove项目添加Mysql.Data
37 |
38 | 添加数据库访问帮助类MySqlDatabaseHelper
39 |
40 | ```c#
41 | public class MySqlDatabaseHelper
42 | {
43 | private string dbConnStr;
44 | private MySqlConnection dbConn = null;
45 |
46 |
47 | public MySqlDatabaseHelper(string connectionString)
48 | {
49 | dbConnStr = connectionString;
50 | dbConn = new MySqlConnection(dbConnStr);
51 | }
52 |
53 | ~MySqlDatabaseHelper()
54 | {
55 | Close();
56 | }
57 |
58 | public void Open()
59 | {
60 | dbConn.Open();
61 | }
62 |
63 | public void Close()
64 | {
65 | dbConn.Close();
66 | }
67 |
68 | public DataSet ExecuteSelect(string sql)
69 | {
70 | var mycom = dbConn.CreateCommand();
71 | mycom.CommandText = sql;
72 | MySqlDataAdapter adap = new MySqlDataAdapter(mycom);
73 | DataSet ds = new DataSet();
74 | adap.Fill(ds);
75 | return ds;
76 | }
77 |
78 | }
79 | ```
80 |
81 | 登录时,查询邮箱
82 |
83 | ```c#
84 | await Task.Run(() =>
85 | {
86 |
87 | string ConnectionString = "server = 127.0.0.1; userid = root; password = deamon; database = wemove; persistsecurityinfo = True;";
88 | MySqlDatabaseHelper mduser = new MySqlDatabaseHelper(ConnectionString);
89 |
90 | // 打开数据库
91 | mduser.Open();
92 |
93 | // sql 查询语句
94 | string sqlCmdStr = "select Email from user_info";
95 |
96 | var data = mduser.ExecuteSelect(sqlCmdStr);
97 | if (data.Tables[0] != null && data.Tables[0].Rows.Count > 0)
98 | {
99 | var datt = data.Tables[0];
100 |
101 | if (datt.Rows[0]["Email"].ToString() == email)
102 | {
103 | App.Current.Dispatcher.Invoke(() => ServiceProvider.Get().CurrentView = new Views.Sign.SignInPassView());
104 | }
105 | }
106 |
107 | // 关闭数据库
108 | mduser.Close();
109 |
110 | });
111 |
112 | ```
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 | SQL操作资料
125 |
126 | ```c#
127 | string ConnectionString = "server = 127.0.0.1; userid = root; password = deamon; database = mduser; persistsecurityinfo = True;";
128 | MySqlDatabaseHelper mduser = new MySqlDatabaseHelper(ConnectionString);
129 |
130 | // 打开数据库
131 | mduser.Open();
132 |
133 | // sql 查询语句
134 | string sqlCmdStr = null;
135 |
136 | //// 新增记录
137 | //sqlCmdStr = "insert into chipinfo_20200209(chipid, chiptype) values('5','S10')";
138 | //mduser.ExecuteNonQuery(sqlCmdStr);
139 |
140 | //// 删除记录
141 | //sqlCmdStr = "delete from chipinfo_20200209 where chipid = 4";
142 | //mduser.ExecuteNonQuery(sqlCmdStr);
143 |
144 | //// 修改数据
145 | //sqlCmdStr = "update chipinfo_20200209 set boardid = '666' where chipid = '5'";
146 | //mduser.ExecuteNonQuery(sqlCmdStr);
147 |
148 | // 查询数据
149 | sqlCmdStr = "select * from chipinfo_20200209";
150 | MySql.Data.MySqlClient.MySqlDataReader dataReader = mduser.ExecuteReader(sqlCmdStr);
151 | while (dataReader.Read())
152 | {
153 | string str = dataReader["chiptype"].ToString();
154 | }
155 | dataReader.Close();
156 |
157 | // 关闭数据库
158 | mduser.Close();
159 | ```
160 |
161 |
--------------------------------------------------------------------------------
/docs/tutorial/WeMove .NET 5移植.md:
--------------------------------------------------------------------------------
1 | ## 2021 01 09
2 |
3 |
4 |
5 | ### WeMove .NET 5.0 平台移植
6 |
7 | 环境:
8 |
9 | 1.如果没有下载.NET 5.0 的SDK,可以先下载SDK
10 |
11 | https://dotnet.microsoft.com/learn/dotnet/hello-world-tutorial/install
12 |
13 | https://dotnet.microsoft.com/download
14 |
15 | 2.需要更新VS2019到 16.8.3版本
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/docs/tutorial/WeMove 21年接下来.md:
--------------------------------------------------------------------------------
1 | ## 2021 01 31
2 |
3 |
4 |
5 | **WEMOVE**
6 |
7 | ### 接下来想要去完成得事情
8 |
9 |
10 |
11 | 1. 完善对数据库得基本操作。(增、删、查、改)
12 | 1. 增:新增注册页面;
13 | 2. 改:新增忘记密码自主修改密码功能;
14 | 3. 删:新增注销用户页面;
15 | 2. 整理代码和注释提示,使用全英文(百度翻译)编写。(督促学习英语)
16 | 3. 添加语言切换功能
17 | 4. 完善开发文档,详细介绍该项目的功能以及如何使用,便于开发者学习和应用。
18 | 5. 构思项目内容,做自己喜欢的事情。
19 |
20 |
21 |
22 |
23 |
24 | ## 2021 02 15
25 |
26 | ### WeMove 登录设计.7-注册页面
27 |
28 | HintTag 提示标签文本框和密码框样式设计
29 |
30 | 注册信息验证与注册
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 | ## 2021 10 24
39 |
40 |
41 |
42 | 1.将signwindow的高度根据切换页面进行修改
43 |
44 | 2.根据signin页面设计signup界面
45 |
46 | 3.新建signupViewmodel
47 |
48 | 4.实现信息注册并跳转到主页(MYSLQL数据插入)
49 |
50 |
51 |
52 | 1.整合项目,在base代码的基础上,整合注册功能
53 |
54 | 1.注册页面的高度,自动变化。
55 |
56 | 2.输入框的样式,具有HintTag 样式效果。
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 | 1.输入框输入BUG修复
67 |
68 | 2.ViewablePasswordBox(密码可见密码框设计)
69 |
70 | 3.EyePressedButton(按下睁眼按钮设计)
71 |
72 |
73 |
74 |
--------------------------------------------------------------------------------
/docs/tutorial/WeMove 界面语言定义和切换.md:
--------------------------------------------------------------------------------
1 | ## 2021 10 01
2 |
3 |
4 |
5 | ### WeMove 界面语言定义和切换
6 |
7 |
8 |
9 | 1. 添加string.zh-CN.xaml字体资源文件
10 | 2. 将资源文件在APP.xaml文件种引入
11 | 3. 界面呈现文本的地方,修改文本的呈现方式为绑定动态资源
12 | 4. 在APP.xaml.cs文件种定义公共静态属性Language,当属性发生变化时,修改当前的使用的资源文件
13 |
14 |
15 |
16 | 字符串XAML命令空间引用
17 |
18 | ```
19 | xmlns:sys="clr-namespace:System;assembly=mscorlib"
20 | ```
21 |
22 |
23 |
24 |
25 |
26 | 资源切换
27 |
28 | ```c#
29 | List dictionaryList = new List();
30 | foreach (ResourceDictionary dictionary in Application.Current.Resources.MergedDictionaries)
31 | {
32 | dictionaryList.Add(dictionary);
33 | }
34 | string requestedLanguage = string.Format(@"UiCore/Styles/Languages/String.{0}.xaml", Language);
35 | ResourceDictionary resourceDictionary = dictionaryList.FirstOrDefault(d => d.Source.OriginalString.Equals(requestedLanguage));
36 | if (resourceDictionary == null)
37 | {
38 | requestedLanguage = @"UiCore/Styles/Languages/String.zh-CN.xaml";
39 | resourceDictionary = dictionaryList.FirstOrDefault(d => d.Source.OriginalString.Equals(requestedLanguage));
40 | }
41 | if (resourceDictionary != null)
42 | {
43 | Application.Current.Resources.MergedDictionaries.Remove(resourceDictionary);
44 | Application.Current.Resources.MergedDictionaries.Add(resourceDictionary);
45 | }
46 | ```
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
--------------------------------------------------------------------------------
/docs/tutorial/WeMove 登录信息验证调整与焦点获取.md:
--------------------------------------------------------------------------------
1 | ## 2020 08 30
2 |
3 | ### WeMove 登录信息验证调整与焦点获取
4 |
5 |
6 |
7 |
8 |
9 | 1.将登录验证类整理,提高代码复用
10 |
11 | 我们验证密码和邮箱的窗口有部分重复的参数,将其规整到父类中,从而提高代码复用。
12 |
13 | 1.1添加抽象父类BaseSignInViewModel,将共有的信息集中起来
14 |
15 | ```c#
16 | ///
17 | /// The base class of sign in information verification
18 | ///
19 | public abstract class BaseSignInViewModel : NotifyPropertyChanged
20 | {
21 | private bool hasError = false;
22 |
23 | ///
24 | /// has a error occured
25 | ///
26 | public bool HasError
27 | {
28 | get { return hasError; }
29 | set { hasError = value; OnPropertyChanged(); }
30 | }
31 |
32 | private string errorMessage = "";
33 |
34 | ///
35 | /// the error message
36 | ///
37 | public string ErrorMessage
38 | {
39 | get { return errorMessage; }
40 | set { errorMessage = value; OnPropertyChanged(); }
41 | }
42 |
43 | private bool needRemember;
44 |
45 | ///
46 | /// Remember this input and fill in automatically next time
47 | ///
48 | public bool NeedRemember
49 | {
50 | get { return needRemember; }
51 | set { needRemember = value; OnPropertyChanged(); }
52 | }
53 |
54 | private bool canSign;
55 |
56 | ///
57 | /// Is ture U Can Sign In
58 | ///
59 | public bool CanSign
60 | {
61 | get { return canSign; }
62 | set { canSign = value; OnPropertyChanged(); }
63 | }
64 |
65 | private bool isSigning;
66 |
67 | ///
68 | /// Show the status of Sign Button is Running or not
69 | ///
70 | public bool IsSigning
71 | {
72 | get { return isSigning; }
73 | set { isSigning = value; OnPropertyChanged(); }
74 | }
75 |
76 | ///
77 | /// Validate the command
78 | ///
79 | public abstract ICommand SignCommand { get; set; }
80 |
81 | ///
82 | /// Skip to other (like SignUp or SignInEmail) page command
83 | ///
84 | public abstract ICommand GotoCommand { get; set; }
85 |
86 | ///
87 | /// Wait for a while, then erase the error message display
88 | ///
89 | /// The number of milliseconds to wait
90 | protected void WipeErrorAffterMS(int ms = 2000)
91 | {
92 | Task.Run(() =>
93 | {
94 | System.Threading.Thread.Sleep(ms);
95 | ErrorMessage = "";
96 | HasError = false;
97 | });
98 | }
99 | }
100 | ```
101 |
102 | 1.2修改对应SignInPass和Mail的ViewModel继承关系。
103 |
104 | 2调整界面,默认焦点到输入框,与默认ENter在登录按钮上
105 |
106 | 2.1添加IsFocusedProperty附加属性,用于设置控件的Focus状态
107 |
108 | 2.2设置控件可以获取焦点,通过tab切换
109 |
110 | 当获取焦点时,通过变色提示用户【button checkbox】
111 |
112 | 3.将注释统一成英文(直接使用百度翻译)
113 |
114 |
115 |
116 |
117 |
118 | WPF WeMove 验证结构调整与焦点获取
119 |
120 | 1.调整类之间结构,提高代码复用
121 | 2.TextBox、Password等控件默认获取焦点
122 | 3.一般控件获取焦点后样式设置。
123 | 项目开源地址:https://github.com/mefdeamon/Desktop-WeMove
124 |
125 |
126 |
--------------------------------------------------------------------------------
/docs/tutorial/WeMove 自定义图标按钮.md:
--------------------------------------------------------------------------------
1 | ## 2020 09 01
2 |
3 |
4 |
5 | ### WeMove 自定义图标按钮
6 |
7 |
8 |
9 | 1.丰富项目的图标库
10 |
11 | 2.创建IconButton自定义控件,并添加IconData属性
12 |
13 | 3.使用IconButon,设计弹性样式
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 | WPF WeMove 弹性图标按钮样式设计
22 |
23 | 1.创建IconButton自定义控件,并添加IconData属性
24 | 2.使用IconButon,设计弹性样式
25 | 3.丰富项目的图标库
26 |
27 |
28 |
29 |
30 |
31 | 注册窗口完善
32 |
33 | 主窗口出发,
34 |
35 |
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/docs/tutorial/WeMove 自定义窗口新设计.md:
--------------------------------------------------------------------------------
1 | ## 2020 08 31
2 |
3 |
4 |
5 | ### WeMove 自定义窗口新设计
6 |
7 |
8 |
9 |
10 |
11 | 1.最大化,窗口化
12 |
13 | 1.1解决最大化,窗口不能正确在任务栏之上展示
14 |
15 | 添加WindowResizer类【别人的】
16 |
17 | 实现一个可以控制设置的自定义ViewModel【根据别人改的】
18 |
19 | 修改Style,给界面添加一个雏形
20 |
21 |
22 |
23 | 1.2通过附加依赖属性,在Style中提示当前处于什么状态,并做对应UI展示
24 |
25 | IsMaximizedProperty附加属性
26 |
27 | 在BaseWindowModel中添加IsMaximized属性用于获取当前窗口状态,展示对应信息
28 |
29 | 功能按钮提示功能,与动画
30 |
31 | 1.3添加窗体自动缩放和调整大小功能
32 |
33 | 1.4Box光标焦点问题
34 |
35 | TextBox
36 |
37 | ```
38 | if (sender is TextBox textBox)
39 | {
40 | // Set the cursor at the end of the last character
41 | textBox.SelectionStart = textBox.Text.Length;
42 | }
43 | ```
44 |
45 | PasswordBox
46 |
47 | ```
48 | if (sender is PasswordBox passwordBox)
49 | {
50 | // Set the cursor at the end of the last character
51 | passwordBox.GetType()
52 | .GetMethod("Select", BindingFlags.Instance | BindingFlags.NonPublic)
53 | .Invoke(passwordBox, new object[] { passwordBox.Password.Length, passwordBox.Password.Length });
54 | }
55 | ```
56 |
57 |
58 |
59 |
60 |
61 | WPF WeMove 自定义窗口样式设计2
62 |
63 | 1.使用WindowResizer类实现窗口的Dock样式
64 | 2.最大化、窗口化图标动画提示。
65 | 3.TextBox与PasswordBox控件光标焦点。
66 | 项目开源地址:https://github.com/mefdeamon/Desktop-WeMove
67 |
68 |
69 |
--------------------------------------------------------------------------------
/docs/tutorial/WeMove 错误提供与擦除.md:
--------------------------------------------------------------------------------
1 | # WeMove 错误提供与自动擦除
2 |
3 | 定义错误提示的UI
4 |
5 | ```xaml
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
16 |
17 |
18 | ```
19 |
20 | 定义绑定的属性
21 |
22 | ```c#
23 |
24 | private bool hasError;
25 |
26 | ///
27 | /// Has error then show the ErrorMessage
28 | ///
29 | public bool HasError
30 | {
31 | get { return hasError; }
32 | set { hasError = value; OnPropertyChanged(); }
33 | }
34 |
35 |
36 | private string errorMessage;
37 |
38 | ///
39 | /// the error message
40 | ///
41 | public string ErrorMessage
42 | {
43 | get { return errorMessage; }
44 | set { errorMessage = value; OnPropertyChanged(); }
45 | }
46 |
47 | ```
48 |
49 | 邮箱格式校验(正则表达式)
50 |
51 | ```c#
52 | public static class CommonHelper
53 | {
54 | ///
55 | /// 是邮箱
56 | ///
57 | ///
58 | ///
59 | public static bool IsEmail(this string source)
60 | {
61 | return Regex.IsMatch(source, @"^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$", RegexOptions.IgnoreCase);
62 | }
63 | }
64 | ```
65 |
66 | 消息自动擦除
67 |
68 | ```c#
69 | ///
70 | /// 延迟一段时间,擦除错误消息
71 | ///
72 | /// 延迟时间 单位:毫秒
73 | private void WipeErrorAffterMS(int ms)
74 | {
75 | Task.Run(() =>
76 | {
77 | Thread.Sleep(ms);
78 | HasError = false;
79 | ErrorMessage = "";
80 | });
81 | }
82 | ```
83 |
84 |
--------------------------------------------------------------------------------
/src/Melphily200329.WeMove/Deamon/App.xaml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/src/Melphily200329.WeMove/Deamon/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using Deamon.Models;
2 | using Melphi.Base;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Configuration;
6 | using System.Data;
7 | using System.Linq;
8 | using System.Threading.Tasks;
9 | using System.Windows;
10 |
11 | namespace Deamon
12 | {
13 | ///
14 | /// Interaction logic for App.xaml
15 | ///
16 | public partial class App : Application
17 | {
18 | protected override void OnStartup(StartupEventArgs e)
19 | {
20 | base.OnStartup(e);
21 |
22 | Language = System.Globalization.CultureInfo.CurrentCulture.IetfLanguageTag;
23 |
24 | // Language = "zh-CN";
25 |
26 | // Register modules into DI container
27 | ServiceProvider.LoadModule(new MainModule());
28 |
29 | // Load main view
30 | Views.Sign.SignWindow window = new Views.Sign.SignWindow();
31 | App.Current.MainWindow = window;
32 | App.Current.MainWindow.Show();
33 |
34 | }
35 |
36 |
37 | private static string language;
38 |
39 | public static string Language
40 | {
41 | get { return language; }
42 | set
43 | {
44 | if (language != value)
45 | {
46 | language = value;
47 |
48 | List dictionaryList = new List();
49 | foreach (ResourceDictionary dictionary in Application.Current.Resources.MergedDictionaries)
50 | {
51 | dictionaryList.Add(dictionary);
52 | }
53 | string requestedLanguage = string.Format(@"/UiCore/Styles/Languages/String.{0}.xaml", Language);
54 | ResourceDictionary resourceDictionary = dictionaryList.FirstOrDefault(d => d.Source.OriginalString.Equals(requestedLanguage));
55 | if (resourceDictionary == null)
56 | {
57 | requestedLanguage = @"/UiCore/Styles/Languages/String.zh-CN.xaml";
58 | resourceDictionary = dictionaryList.FirstOrDefault(d => d.Source.OriginalString.Equals(requestedLanguage));
59 | }
60 | if (resourceDictionary != null)
61 | {
62 | Application.Current.Resources.MergedDictionaries.Remove(resourceDictionary);
63 | Application.Current.Resources.MergedDictionaries.Add(resourceDictionary);
64 | }
65 |
66 |
67 |
68 |
69 | }
70 | }
71 | }
72 |
73 | }
74 | }
75 |
--------------------------------------------------------------------------------
/src/Melphily200329.WeMove/Deamon/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | [assembly: ThemeInfo(
4 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
5 | //(used if a resource is not found in the page,
6 | // or application resource dictionaries)
7 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
8 | //(used if a resource is not found in the page,
9 | // app, or any theme specific resource dictionaries)
10 | )]
11 |
--------------------------------------------------------------------------------
/src/Melphily200329.WeMove/Deamon/Deamon.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | WinExe
5 | netcoreapp3.1
6 | true
7 | wemove.ico
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 | System.Windows.Interactivity.dll
22 |
23 |
24 |
25 |
26 |
27 | Never
28 |
29 |
30 |
31 |
32 |
33 | Code
34 |
35 |
36 |
37 |
38 |
39 | Designer
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/src/Melphily200329.WeMove/Deamon/Deamon.csproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | false
5 |
6 |
7 |
8 | Designer
9 |
10 |
11 |
12 |
13 | Code
14 |
15 |
16 | Code
17 |
18 |
19 | Code
20 |
21 |
22 | Code
23 |
24 |
25 | Code
26 |
27 |
28 | Code
29 |
30 |
31 | Code
32 |
33 |
34 |
35 |
36 | Designer
37 |
38 |
39 | Designer
40 |
41 |
42 | Designer
43 |
44 |
45 | Designer
46 |
47 |
48 | Designer
49 |
50 |
51 | Designer
52 |
53 |
54 | Designer
55 |
56 |
57 | Designer
58 |
59 |
60 | Designer
61 |
62 |
63 | Designer
64 |
65 |
66 | Designer
67 |
68 |
69 | Designer
70 |
71 |
72 | Designer
73 |
74 |
75 | Designer
76 |
77 |
78 | Designer
79 |
80 |
81 | Designer
82 |
83 |
84 | Designer
85 |
86 |
87 |
--------------------------------------------------------------------------------
/src/Melphily200329.WeMove/Deamon/Models/MainModule.cs:
--------------------------------------------------------------------------------
1 | using Deamon.ViewModels;
2 | using Deamon.ViewModels.Sign;
3 | using Deamon.Views.Sign;
4 | using Melphi.Base;
5 | using Melphi.IconSet;
6 | using System;
7 | using System.Collections.Generic;
8 | using System.Text;
9 |
10 | namespace Deamon.Models
11 | {
12 | public class MainModule : IModule
13 | {
14 | ///
15 | /// Register module into DI container
16 | ///
17 | ///
18 | public void OnLoad(IBinder binder)
19 | {
20 |
21 | binder.Bind();
22 |
23 | binder.BindSingleton();
24 |
25 | binder.BindSingleton();
26 |
27 | binder.BindSingleton();
28 |
29 | binder.BindSingleton();
30 |
31 | binder.BindSingleton();
32 |
33 | binder.BindSingleton();
34 |
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/src/Melphily200329.WeMove/Deamon/ServiceLocator.cs:
--------------------------------------------------------------------------------
1 | using Deamon.ViewModels;
2 | using Deamon.ViewModels.Sign;
3 | using Melphi.Base;
4 | using Melphi.IconSet;
5 | using System;
6 | using System.Collections.Generic;
7 | using System.Text;
8 |
9 | namespace Deamon
10 | {
11 | public class ServiceLocator
12 | {
13 | public IIconSet IconSource => ServiceProvider.Get();
14 | public MaterialSet MaterialSet => ServiceProvider.Get();
15 |
16 |
17 | public MainViewModel MainViewModel => ServiceProvider.Get();
18 | public SignViewModel SignViewModel => ServiceProvider.Get();
19 | public SignInMailViewModel SignInMailViewModel => ServiceProvider.Get();
20 | public SignInPassViewModel SignInPassViewModel => ServiceProvider.Get();
21 | public SignUpViewModel SignUpViewModel => ServiceProvider.Get();
22 |
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/Melphily200329.WeMove/Deamon/System.Windows.Interactivity.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mefdeamon/Desktop-WeMove/b1ad5cffcdbba639416e0dd0b32f8c3b7688eadf/src/Melphily200329.WeMove/Deamon/System.Windows.Interactivity.dll
--------------------------------------------------------------------------------
/src/Melphily200329.WeMove/Deamon/Themes/DefaultStyles.xaml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | #FF053f4b
12 |
13 | #FF290736
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/src/Melphily200329.WeMove/Deamon/Themes/Generic.xaml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/src/Melphily200329.WeMove/Deamon/UiCore/AttachedProperties/BaseAttachedProperty.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using System.Windows;
5 |
6 | namespace Deamon.UiCore.AttachedProperties
7 | {
8 | ///
9 | /// A base attached property to replace the vanilla WPF attached property
10 | ///
11 | /// The parent class to be the attached property
12 | /// The type of this attached property
13 | public abstract class BaseAttachedProperty
14 | where TParent : new()
15 | {
16 | #region Public Events
17 |
18 | ///
19 | /// Fired when the value changes
20 | ///
21 | public event Action ValueChanged = (sender, e) => { };
22 |
23 | ///
24 | /// Fired when the value changes, even when the value is the same
25 | ///
26 | public event Action ValueUpdated = (sender, value) => { };
27 |
28 | #endregion
29 |
30 | #region Public Properties
31 |
32 | ///
33 | /// A singleton instance of our parent class
34 | ///
35 | public static TParent Instance { get; private set; } = new TParent();
36 |
37 | #endregion
38 |
39 | #region Attached Property Definitions
40 |
41 | ///
42 | /// The attached property for this class
43 | ///
44 | public static readonly DependencyProperty ValueProperty = DependencyProperty.RegisterAttached(
45 | "Value",
46 | typeof(TProperty),
47 | typeof(BaseAttachedProperty),
48 | new UIPropertyMetadata(
49 | default(TProperty),
50 | new PropertyChangedCallback(OnValuePropertyChanged),
51 | new CoerceValueCallback(OnValuePropertyUpdated)
52 | ));
53 |
54 | ///
55 | /// The callback event when the is changed
56 | ///
57 | /// The UI element that had it's property changed
58 | /// The arguments for the event
59 | private static void OnValuePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
60 | {
61 | // Call the parent function
62 | (Instance as BaseAttachedProperty)?.OnValueChanged(d, e);
63 |
64 | // Call event listeners
65 | (Instance as BaseAttachedProperty)?.ValueChanged(d, e);
66 | }
67 |
68 | ///
69 | /// The callback event when the is changed, even if it is the same value
70 | ///
71 | /// The UI element that had it's property changed
72 | /// The arguments for the event
73 | private static object OnValuePropertyUpdated(DependencyObject d, object value)
74 | {
75 | // Call the parent function
76 | (Instance as BaseAttachedProperty)?.OnValueUpdated(d, value);
77 |
78 | // Call event listeners
79 | (Instance as BaseAttachedProperty)?.ValueUpdated(d, value);
80 |
81 | // Return the value
82 | return value;
83 | }
84 |
85 | ///
86 | /// Gets the attached property
87 | ///
88 | /// The element to get the property from
89 | ///
90 | public static TProperty GetValue(DependencyObject d) => (TProperty)d.GetValue(ValueProperty);
91 |
92 | ///
93 | /// Sets the attached property
94 | ///
95 | /// The element to get the property from
96 | /// The value to set the property to
97 | public static void SetValue(DependencyObject d, TProperty value) => d.SetValue(ValueProperty, value);
98 |
99 | #endregion
100 |
101 | #region Event Methods
102 |
103 | ///
104 | /// The method that is called when any attached property of this type is changed
105 | ///
106 | /// The UI element that this property was changed for
107 | /// The arguments for this event
108 | public virtual void OnValueChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e) { }
109 |
110 | ///
111 | /// The method that is called when any attached property of this type is changed, even if the value is the same
112 | ///
113 | /// The UI element that this property was changed for
114 | /// The arguments for this event
115 | public virtual void OnValueUpdated(DependencyObject sender, object value) { }
116 |
117 | #endregion
118 | }
119 | }
120 |
--------------------------------------------------------------------------------
/src/Melphily200329.WeMove/Deamon/UiCore/AttachedProperties/IsBusyProperty.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace Deamon.UiCore.AttachedProperties
6 | {
7 | public class IsBusyProperty : BaseAttachedProperty
8 | {
9 |
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/Melphily200329.WeMove/Deamon/UiCore/AttachedProperties/IsFocusedProperty.cs:
--------------------------------------------------------------------------------
1 | #region Deamon
2 | // the app's classes of wemove project
3 | #endregion
4 |
5 | using System.Reflection;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Controls.Primitives;
9 |
10 | namespace Deamon.UiCore.AttachedProperties
11 | {
12 | ///
13 | /// Focuses (keyboard focus) this element on load
14 | ///
15 | public class IsFocusedProperty : BaseAttachedProperty
16 | {
17 | public override void OnValueChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
18 | {
19 | // If we don't have a control, return
20 | if (!(sender is Control control))
21 | return;
22 |
23 | // If TextBox has content default, set the cursor
24 | if (sender is TextBox textBox)
25 | {
26 | // Set the cursor at the end of the last character
27 | textBox.TextChanged += (s, e) => textBox.SelectionStart = textBox.Text.Length; ;
28 | }
29 |
30 | // If PasswordBox has content default, set the cursor
31 | if (sender is PasswordBox passwordBox)
32 | {
33 | // Set the cursor at the end of the last character
34 | passwordBox.PasswordChanged += (s, e) => passwordBox.GetType()
35 | .GetMethod("Select", BindingFlags.Instance | BindingFlags.NonPublic)
36 | .Invoke(passwordBox, new object[] { passwordBox.Password.Length, passwordBox.Password.Length });
37 | }
38 |
39 | // Focus this control once loaded
40 | control.Loaded += (s, se) => control.Focus();
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/src/Melphily200329.WeMove/Deamon/UiCore/AttachedProperties/IsMaximizedProperty.cs:
--------------------------------------------------------------------------------
1 | #region Deamon
2 | // the app's classes of wemove project
3 | #endregion
4 |
5 | namespace Deamon.UiCore.AttachedProperties
6 | {
7 | ///
8 | /// If true the window's state is Maximize
9 | /// If false the window's state isn't Maximize
10 | ///
11 | public class IsMaximizedProperty : BaseAttachedProperty
12 | {
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/Melphily200329.WeMove/Deamon/UiCore/AttachedProperties/PasswordProperties.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using System.Windows;
5 | using System.Windows.Controls;
6 |
7 | namespace Deamon.UiCore.AttachedProperties
8 | {
9 | public class BoundPasswordProperty : BaseAttachedProperty
10 | {
11 | public override void OnValueChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
12 | {
13 | PasswordBox box = sender as PasswordBox;
14 |
15 | if (box == null)
16 | {
17 | return;
18 | }
19 |
20 | box.PasswordChanged += Box_PasswordChanged;
21 |
22 | if (!UpdatingProperty.GetValue(sender))
23 | box.Password = e.NewValue.ToString();
24 |
25 | box.PasswordChanged -= Box_PasswordChanged;
26 | }
27 |
28 | private void Box_PasswordChanged(object sender, RoutedEventArgs e)
29 | {
30 | PasswordBox box = sender as PasswordBox;
31 |
32 | box.SetValue(UpdatingProperty.ValueProperty, true);
33 | box.SetValue(ValueProperty, box.Password);
34 | box.SetValue(UpdatingProperty.ValueProperty, false);
35 | }
36 | }
37 |
38 | public class NeedCaptureProperty : BaseAttachedProperty
39 | {
40 | public override void OnValueChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
41 | {
42 | PasswordBox box = sender as PasswordBox;
43 |
44 | if (box == null)
45 | {
46 | return;
47 | }
48 |
49 | if ((bool)e.OldValue)
50 | {
51 | box.PasswordChanged -= Box_PasswordChanged;
52 | }
53 |
54 | if ((bool)e.NewValue)
55 | {
56 | box.PasswordChanged += Box_PasswordChanged;
57 | HasPasswordProperty.SetValue(box);
58 | }
59 | }
60 |
61 | private void Box_PasswordChanged(object sender, RoutedEventArgs e)
62 | {
63 | PasswordBox box = sender as PasswordBox;
64 |
65 | box.SetValue(UpdatingProperty.ValueProperty, true);
66 | box.SetValue(BoundPasswordProperty.ValueProperty, box.Password);
67 | box.SetValue(UpdatingProperty.ValueProperty, false);
68 |
69 | HasPasswordProperty.SetValue(box);
70 | }
71 | }
72 |
73 | public class HasPasswordProperty : BaseAttachedProperty
74 | {
75 | public static void SetValue(DependencyObject sender)
76 | {
77 | SetValue(sender, (sender as PasswordBox).SecurePassword.Length > 0);
78 | }
79 | }
80 |
81 | public class UpdatingProperty : BaseAttachedProperty
82 | {
83 |
84 | }
85 | }
86 |
--------------------------------------------------------------------------------
/src/Melphily200329.WeMove/Deamon/UiCore/CommonHelper.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using System.Text.RegularExpressions;
5 |
6 | namespace Deamon.UiCore
7 | {
8 | public static class CommonHelper
9 | {
10 | ///
11 | /// 是邮箱
12 | ///
13 | ///
14 | ///
15 | public static bool IsEmail(this string source)
16 | {
17 | return Regex.IsMatch(source, @"^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$", RegexOptions.IgnoreCase);
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/Melphily200329.WeMove/Deamon/UiCore/Controls/CommandControl.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using System.Windows;
5 | using System.Windows.Controls;
6 | using System.Windows.Data;
7 | using System.Windows.Documents;
8 | using System.Windows.Input;
9 | using System.Windows.Media;
10 | using System.Windows.Media.Imaging;
11 | using System.Windows.Navigation;
12 | using System.Windows.Shapes;
13 |
14 | namespace Deamon.UiCore.Controls
15 | {
16 |
17 | public class CommandControl : ContentControl
18 | {
19 | static CommandControl()
20 | {
21 | DefaultStyleKeyProperty.OverrideMetadata(typeof(CommandControl), new FrameworkPropertyMetadata(typeof(CommandControl)));
22 | }
23 | public CommandControl()
24 | {
25 | MouseLeftButtonDown += CommandControlCC_MouseLeftButtonDown;
26 | }
27 |
28 | private void CommandControlCC_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
29 | {
30 | if (Command != null)
31 | {
32 | if (Command.CanExecute(CommandParameter))
33 | {
34 | Command.Execute(CommandParameter);
35 | }
36 | }
37 | }
38 |
39 | private void OnMouseLeftButtonDown(object sender, MouseButtonEventArgs mouseButtonEventArgs)
40 | {
41 | if (Command != null)
42 | {
43 | if (Command.CanExecute(CommandParameter))
44 | {
45 | Command.Execute(CommandParameter);
46 | }
47 | }
48 | }
49 |
50 | public static readonly DependencyProperty CommandProperty =
51 | DependencyProperty.Register("Command", typeof(ICommand),
52 | typeof(CommandControl),
53 | new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.None));
54 |
55 | public ICommand Command
56 | {
57 | get { return (ICommand)GetValue(CommandProperty); }
58 | set { SetValue(CommandProperty, value); }
59 | }
60 |
61 | public static readonly DependencyProperty CommandParameterProperty =
62 | DependencyProperty.Register("CommandParameter", typeof(object),
63 | typeof(CommandControl),
64 | new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.None));
65 |
66 | public object CommandParameter
67 | {
68 | get { return (object)GetValue(CommandParameterProperty); }
69 | set { SetValue(CommandParameterProperty, value); }
70 | }
71 | }
72 |
73 |
74 | }
75 |
--------------------------------------------------------------------------------
/src/Melphily200329.WeMove/Deamon/UiCore/Controls/IconButton.cs:
--------------------------------------------------------------------------------
1 | #region Deamon
2 | // the app's classes of wemove project
3 | #endregion
4 |
5 | using System.Windows;
6 | using System.Windows.Controls;
7 | using System.Windows.Media;
8 |
9 | namespace Deamon.UiCore.Controls
10 | {
11 | ///
12 | /// The button with a icon
13 | ///
14 | public class IconButton : Button
15 | {
16 | public IconButton()
17 | {
18 | DefaultStyleKey = typeof(IconButton);
19 | }
20 |
21 | ///
22 | /// The icon geometry data
23 | ///
24 | public Geometry IconData
25 | {
26 | get => (Geometry)GetValue(IconDataProperty);
27 | set => SetValue(IconDataProperty, value);
28 | }
29 |
30 | ///
31 | ///
32 | ///
33 | public static readonly DependencyProperty IconDataProperty = DependencyProperty.Register(nameof(IconData), typeof(Geometry), typeof(IconButton));
34 |
35 |
36 | ///
37 | /// Rotate Transform Angle
38 | ///
39 | public double RotateAngle
40 | {
41 | get { return (double)GetValue(RotateAngleProperty); }
42 | set { SetValue(RotateAngleProperty, value); }
43 | }
44 |
45 | ///
46 | ///
47 | ///
48 | public static readonly DependencyProperty RotateAngleProperty =
49 | DependencyProperty.Register(nameof(RotateAngle), typeof(double), typeof(IconButton), new PropertyMetadata(default(double)));
50 |
51 |
52 |
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/src/Melphily200329.WeMove/Deamon/UiCore/Styles/CheckBoxs.xaml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
63 |
64 |
--------------------------------------------------------------------------------
/src/Melphily200329.WeMove/Deamon/UiCore/Styles/IconButtons.xaml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
79 |
80 |
--------------------------------------------------------------------------------
/src/Melphily200329.WeMove/Deamon/UiCore/Styles/Languages/String.en-US.xaml:
--------------------------------------------------------------------------------
1 |
4 |
5 | Close
6 | Minimize
7 | Restore
8 | Maximum
9 | Enter email
10 | Enter password
11 | Remember me
12 | Next
13 | Create a new user
14 | Back Email verification
15 | Enter name
16 |
17 |
--------------------------------------------------------------------------------
/src/Melphily200329.WeMove/Deamon/UiCore/Styles/Languages/String.zh-CN.xaml:
--------------------------------------------------------------------------------
1 |
4 |
5 | 关闭
6 | 最小化
7 | 窗口化
8 | 最大化
9 | 请输入电子邮件
10 | 请输入密码
11 | 记住我
12 | 下一步
13 | 创建一个新用户
14 | 回到邮箱验证
15 | 请输入昵称
16 |
17 |
18 |
--------------------------------------------------------------------------------
/src/Melphily200329.WeMove/Deamon/UiCore/Styles/TextBoxs.xaml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
146 |
147 |
--------------------------------------------------------------------------------
/src/Melphily200329.WeMove/Deamon/UiCore/ValueConverters/BooleanToObjectConverter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using System.Windows.Data;
5 |
6 | namespace Deamon.UiCore.ValueConverters
7 | {
8 | ///
9 | /// 将布尔值转换成其他类型,需要提供两个 Object 类型的真值和假值
10 | ///
11 | public class BooleanToObjectConverter : IValueConverter
12 | {
13 | public object FalseValue { get; set; }
14 | public object TrueValue { get; set; }
15 |
16 | public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
17 | {
18 | // 没有参数的情况下是正向的,T-T F-F
19 | if (parameter == null)
20 | return Equals(value, true) ? TrueValue : FalseValue;
21 | // 有参数的情况下是反向的, T-F F-T
22 | else
23 | return Equals(value, true) ? FalseValue : TrueValue;
24 | }
25 |
26 | public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
27 | {
28 | return Equals(value, TrueValue) ? true : Equals(value, FalseValue) ? false : (bool?)null;
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/Melphily200329.WeMove/Deamon/UiCore/ValueConverters/ValueConverter.xaml:
--------------------------------------------------------------------------------
1 |
4 |
5 | Visible
6 | Collapsed
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/src/Melphily200329.WeMove/Deamon/ViewModels/MainViewModel.cs:
--------------------------------------------------------------------------------
1 | #region Deamon
2 | // the app's classes of wemove project
3 | #endregion
4 |
5 | using System.Windows;
6 |
7 | namespace Deamon.ViewModels
8 | {
9 | public class MainViewModel : BaseWindowModel
10 | {
11 |
12 | ///
13 | /// 默认构造函数
14 | ///
15 | public MainViewModel(Window window) : base(window)
16 | {
17 |
18 | }
19 |
20 |
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/Melphily200329.WeMove/Deamon/ViewModels/Sign/BaseSignInViewModel.cs:
--------------------------------------------------------------------------------
1 | #region Deamon
2 | // the app's classes of wemove project
3 | #endregion
4 |
5 | using Melphi.Base;
6 | using System.Threading.Tasks;
7 | using System.Windows.Input;
8 |
9 | namespace Deamon.ViewModels.Sign
10 | {
11 | ///
12 | /// The base class of sign in information verification
13 | ///
14 | public abstract class BaseSignInViewModel : NotifyPropertyChanged
15 | {
16 | private bool hasError = false;
17 |
18 | ///
19 | /// has a error occured
20 | ///
21 | public bool HasError
22 | {
23 | get { return hasError; }
24 | set { hasError = value; OnPropertyChanged(); }
25 | }
26 |
27 | private string errorMessage = "";
28 |
29 | ///
30 | /// the error message
31 | ///
32 | public string ErrorMessage
33 | {
34 | get { return errorMessage; }
35 | set { errorMessage = value; OnPropertyChanged(); }
36 | }
37 |
38 | private bool needRemember;
39 |
40 | ///
41 | /// Remember this input and fill in automatically next time
42 | ///
43 | public bool NeedRemember
44 | {
45 | get { return needRemember; }
46 | set { needRemember = value; OnPropertyChanged(); }
47 | }
48 |
49 | private bool canSign;
50 |
51 | ///
52 | /// Is ture U Can Sign In
53 | ///
54 | public bool CanSign
55 | {
56 | get { return canSign; }
57 | set { canSign = value; OnPropertyChanged(); }
58 | }
59 |
60 | private bool isSigning;
61 |
62 | ///
63 | /// Show the status of Sign Button is Running or not
64 | ///
65 | public bool IsSigning
66 | {
67 | get { return isSigning; }
68 | set { isSigning = value; OnPropertyChanged(); }
69 | }
70 |
71 | ///
72 | /// Validate the command
73 | ///
74 | public abstract ICommand SignCommand { get; set; }
75 |
76 | ///
77 | /// Skip to other (like SignUp or SignInEmail) page command
78 | ///
79 | public abstract ICommand GotoCommand { get; set; }
80 |
81 | ///
82 | /// Wait for a while, then erase the error message display
83 | ///
84 | /// The number of milliseconds to wait
85 | protected void WipeErrorAffterMS(int ms = 2000)
86 | {
87 | Task.Run(() =>
88 | {
89 | System.Threading.Thread.Sleep(ms);
90 | ErrorMessage = "";
91 | HasError = false;
92 | });
93 | }
94 | }
95 | }
96 |
--------------------------------------------------------------------------------
/src/Melphily200329.WeMove/Deamon/ViewModels/Sign/SignInMailViewModel.cs:
--------------------------------------------------------------------------------
1 | #region Deamon
2 | // the app's classes of wemove project
3 | #endregion
4 |
5 | using Deamon.UiCore;
6 | using Melphi.Base;
7 | using System;
8 | using System.Net.Http;
9 | using System.Text;
10 | using System.Text.Json;
11 | using System.Threading.Tasks;
12 | using System.Windows.Input;
13 | using static Deamon.ViewModels.Sign.SignUpViewModel;
14 |
15 | namespace Deamon.ViewModels.Sign
16 | {
17 | public class SignInMailViewModel : BaseSignInViewModel
18 | {
19 |
20 | ///
21 | /// Default constructor
22 | ///
23 | public SignInMailViewModel()
24 | {
25 | SignCommand = new RelayCommand(async () =>
26 | {
27 | await RunCommandAsync(() => IsSigning, async () =>
28 | {
29 | await Sign();
30 | });
31 | });
32 | GotoCommand = new RelayCommand(() =>
33 | {
34 | ServiceProvider.Get().CurrentViewType = SignViewType.SignUp;
35 | });
36 |
37 | Email = "mel@wem.com";
38 | }
39 |
40 | private string email;
41 |
42 | public string Email
43 | {
44 | get { return email; }
45 | set
46 | {
47 | email = value; OnPropertyChanged();
48 | CanSign = !string.IsNullOrWhiteSpace(email);
49 | }
50 | }
51 |
52 | public override ICommand SignCommand { get; set; }
53 | public override ICommand GotoCommand { get; set; }
54 |
55 | ///
56 | /// Email verification
57 | ///
58 | ///
59 | private async Task Sign()
60 | {
61 | // 输入邮箱格式校验
62 | if (!Email.IsEmail())
63 | {
64 | ErrorMessage = "错误!邮箱格式不正确,请重试!";
65 | HasError = true;
66 | WipeErrorAffterMS();
67 | return;
68 | }
69 |
70 | var http = "http://localhost:5000";
71 | var api = "/api/auth/sign-in-email";
72 | var requestUrl = http + api;
73 |
74 | using (var client = new HttpClient())
75 | {
76 | var postData = new
77 | {
78 | Email = email,
79 | Password = ""
80 | };
81 | var json = JsonSerializer.Serialize(postData);
82 | var content = new StringContent(json, Encoding.UTF8, "application/json");
83 | HttpResponseMessage response = null;
84 | try
85 | {
86 | response = await client.PostAsync(requestUrl, content);
87 | }
88 | catch (Exception ex)
89 | {
90 | ErrorMessage = ex.Message;
91 | HasError = true;
92 | WipeErrorAffterMS();
93 | return;
94 | }
95 |
96 | if (response.IsSuccessStatusCode)
97 | {
98 | App.Current.Dispatcher.Invoke(() => ServiceProvider.Get().CurrentViewType = SignViewType.SignInPass);
99 | }
100 | else
101 | {
102 | var contentString = await response.Content.ReadAsStringAsync();
103 | ApiResponse apiResponse = null;
104 | try
105 | {
106 | apiResponse = JsonSerializer.Deserialize(contentString);
107 | ErrorMessage = apiResponse == null ? "response content json deserialize error" : apiResponse.message;
108 | }
109 | catch (Exception ex)
110 | {
111 | ErrorMessage = ex.Message;
112 | }
113 |
114 | HasError = true;
115 | WipeErrorAffterMS();
116 | return;
117 | }
118 | }
119 | }
120 | }
121 |
122 | public class ApiResponse
123 | {
124 | public string message { get; set; }
125 | }
126 | }
127 |
--------------------------------------------------------------------------------
/src/Melphily200329.WeMove/Deamon/ViewModels/Sign/SignInPassViewModel.cs:
--------------------------------------------------------------------------------
1 | #region Deamon
2 | // the app's classes of wemove project
3 | #endregion
4 |
5 | using Melphi.Base;
6 | using System;
7 | using System.Net.Http;
8 | using System.Text.Json;
9 | using System.Text;
10 | using System.Threading.Tasks;
11 | using System.Windows;
12 | using System.Windows.Input;
13 |
14 | namespace Deamon.ViewModels.Sign
15 | {
16 | public class SignInPassViewModel : BaseSignInViewModel
17 | {
18 | ///
19 | /// Default constructor
20 | ///
21 | public SignInPassViewModel()
22 | {
23 | SignCommand = new RelayCommand(async () =>
24 | {
25 | await RunCommandAsync(() => IsSigning, async () =>
26 | {
27 | //App.Current.Dispatcher.Invoke(() => ServiceProvider.Get().CurrentView = new Views.Sign.SignLoadingView());
28 | await SignIn();
29 | });
30 | });
31 | GotoCommand = new RelayCommand(() =>
32 | {
33 | ServiceProvider.Get().CurrentViewType = SignViewType.SignInMail;
34 | });
35 |
36 | Password = "deamon";
37 | }
38 |
39 | private string password;
40 |
41 | ///
42 | /// Password
43 | ///
44 | public string Password
45 | {
46 | get { return password; }
47 | set
48 | {
49 | password = value; OnPropertyChanged();
50 | CanSign = !string.IsNullOrWhiteSpace(password);
51 | }
52 | }
53 |
54 | public override ICommand SignCommand { get; set; }
55 | public override ICommand GotoCommand { get; set; }
56 |
57 | ///
58 | /// Password verification
59 | ///
60 | ///
61 | private async Task SignIn()
62 | {
63 | if (password.Length < 6)
64 | {
65 | ErrorMessage = "错误!邮箱格式不正确,请重试!";
66 | HasError = true;
67 | WipeErrorAffterMS();
68 | return;
69 | }
70 |
71 | var http = "http://localhost:5000";
72 | var api = "/api/auth/sign-in-password";
73 | var requestUrl = http + api;
74 |
75 | using (var client = new HttpClient())
76 | {
77 | var postData = new
78 | {
79 | Email = ServiceProvider.Get().Email,
80 | Password = password
81 | };
82 | var json = JsonSerializer.Serialize(postData);
83 | var content = new StringContent(json, Encoding.UTF8, "application/json");
84 | HttpResponseMessage response = null;
85 | try
86 | {
87 | response = await client.PostAsync(requestUrl, content);
88 | }
89 | catch (Exception ex)
90 | {
91 | ErrorMessage = ex.Message;
92 | HasError = true;
93 | WipeErrorAffterMS();
94 | return;
95 | }
96 |
97 | if (response.IsSuccessStatusCode)
98 | {
99 | // start up main window
100 | App.Current.Dispatcher.Invoke(() =>
101 | {
102 | Window window = App.Current.MainWindow;
103 | App.Current.MainWindow = new Views.MainWindow();
104 | window.Close();
105 | App.Current.MainWindow.Show();
106 | });
107 | }
108 | else
109 | {
110 | var contentString = await response.Content.ReadAsStringAsync();
111 | ApiResponse apiResponse = null;
112 | try
113 | {
114 | apiResponse = JsonSerializer.Deserialize(contentString);
115 | ErrorMessage = apiResponse == null ? "response content json deserialize error" : apiResponse.message;
116 | }
117 | catch (Exception ex)
118 | {
119 | ErrorMessage = ex.Message;
120 | }
121 |
122 | HasError = true;
123 | WipeErrorAffterMS();
124 | return;
125 | }
126 | }
127 | }
128 |
129 | }
130 | }
131 |
--------------------------------------------------------------------------------
/src/Melphily200329.WeMove/Deamon/ViewModels/Sign/SignUpViewModel.cs:
--------------------------------------------------------------------------------
1 | #region Deamon
2 | // the app's classes of wemove project
3 | #endregion
4 |
5 | using Deamon.UiCore;
6 | using Melphi.Base;
7 | using System.Net.Http;
8 | using System.Text.Json;
9 | using System.Text;
10 | using System.Threading.Tasks;
11 | using System.Windows.Input;
12 | using System.Windows;
13 | using System;
14 |
15 | namespace Deamon.ViewModels.Sign
16 | {
17 | public class SignUpViewModel : BaseSignInViewModel
18 | {
19 |
20 | ///
21 | /// Default constructor
22 | ///
23 | public SignUpViewModel()
24 | {
25 | SignCommand = new RelayCommand(async () =>
26 | {
27 | await RunCommandAsync(() => IsSigning, async () =>
28 | {
29 | await Sign();
30 | });
31 | });
32 | GotoCommand = new RelayCommand(() =>
33 | {
34 | ServiceProvider.Get().CurrentViewType = SignViewType.SignInMail;
35 | });
36 |
37 | Email = "mel@wem.com";
38 |
39 | Username = "Lymehu";
40 | Password = "";
41 | }
42 |
43 | private string email;
44 |
45 | public string Email
46 | {
47 | get { return email; }
48 | set
49 | {
50 | email = value; OnPropertyChanged();
51 | CanSign = !string.IsNullOrWhiteSpace(email);
52 | }
53 | }
54 |
55 | private string password;
56 |
57 | ///
58 | /// Password
59 | ///
60 | public string Password
61 | {
62 | get { return password; }
63 | set
64 | {
65 | password = value; OnPropertyChanged();
66 | CanSign = !string.IsNullOrWhiteSpace(password);
67 | }
68 | }
69 |
70 |
71 | private string username;
72 |
73 | public string Username
74 | {
75 | get { return username; }
76 | set { Set(ref username, value); }
77 | }
78 |
79 |
80 |
81 | public override ICommand SignCommand { get; set; }
82 | public override ICommand GotoCommand { get; set; }
83 |
84 | ///
85 | /// Email verification
86 | ///
87 | ///
88 | private async Task Sign()
89 | {
90 | // 输入邮箱格式校验
91 | if (!Email.IsEmail())
92 | {
93 | ErrorMessage = "错误!邮箱格式不正确,请重试!";
94 | HasError = true;
95 | WipeErrorAffterMS();
96 | return;
97 | }
98 |
99 | var http = "http://localhost:5000";
100 | var api = "/api/auth/sign-up";
101 | var requestUrl = http + api;
102 |
103 | using (var client = new HttpClient())
104 | {
105 | var postData = new
106 | {
107 | Email = email,
108 | UserName = username,
109 | Password = password
110 | };
111 | var json = JsonSerializer.Serialize(postData);
112 | var content = new StringContent(json, Encoding.UTF8, "application/json");
113 | HttpResponseMessage response = null;
114 | try
115 | {
116 | response = await client.PostAsync(requestUrl, content);
117 | }
118 | catch (Exception ex)
119 | {
120 | ErrorMessage = ex.Message;
121 | HasError = true;
122 | WipeErrorAffterMS();
123 | return;
124 | }
125 |
126 | if (response.IsSuccessStatusCode)
127 | {
128 | // start up main window
129 | App.Current.Dispatcher.Invoke(() =>
130 | {
131 | Window window = App.Current.MainWindow;
132 | App.Current.MainWindow = new Views.MainWindow();
133 | window.Close();
134 | App.Current.MainWindow.Show();
135 | });
136 | }
137 | else
138 | {
139 | var contentString = await response.Content.ReadAsStringAsync();
140 | ApiResponse apiResponse = null;
141 | try
142 | {
143 | apiResponse = JsonSerializer.Deserialize(contentString);
144 | ErrorMessage = apiResponse == null ? "response content json deserialize error" : apiResponse.message;
145 | }
146 | catch (Exception ex)
147 | {
148 | ErrorMessage = ex.Message;
149 | }
150 |
151 | HasError = true;
152 | WipeErrorAffterMS();
153 | return;
154 | }
155 | }
156 | }
157 | }
158 | }
159 |
--------------------------------------------------------------------------------
/src/Melphily200329.WeMove/Deamon/ViewModels/Sign/SignViewModel.cs:
--------------------------------------------------------------------------------
1 | using Deamon.Views.Sign;
2 | using Melphi.Base;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Text;
6 | using System.Windows;
7 | using System.Windows.Input;
8 |
9 | namespace Deamon.ViewModels.Sign
10 | {
11 |
12 | public enum SignViewType
13 | {
14 | None,
15 | SignInMail,
16 | SignInPass,
17 | SignUp
18 | }
19 |
20 | public class SignViewModel : NotifyPropertyChanged
21 | {
22 |
23 | private SignViewType currentViewType;
24 |
25 | public SignViewType CurrentViewType
26 | {
27 | get { return currentViewType; }
28 | set
29 | {
30 | if (Set(ref currentViewType, value))
31 | {
32 | switch (currentViewType)
33 | {
34 | case SignViewType.SignInMail:
35 | CurrentView = ServiceProvider.Get();
36 | WindowHeight = 462;
37 | break;
38 | case SignViewType.SignInPass:
39 | CurrentView = ServiceProvider.Get();
40 | WindowHeight = 462;
41 | break;
42 | case SignViewType.SignUp:
43 | CurrentView = ServiceProvider.Get() ;
44 | WindowHeight = 562;
45 | break;
46 | default:
47 | break;
48 | }
49 | }
50 | }
51 | }
52 |
53 |
54 | ///
55 | /// 默认构造函数
56 | ///
57 | public SignViewModel()
58 | {
59 | MinimCommand = new RelayCommand(() =>
60 | {
61 | App.Current.MainWindow.WindowState = WindowState.Minimized;
62 | });
63 |
64 | CloseCommand = new RelayCommand(() =>
65 | {
66 | App.Current.MainWindow.Close();
67 | });
68 |
69 | CurrentViewType = SignViewType.SignInMail;
70 | }
71 |
72 | private FrameworkElement currentView;
73 |
74 | public FrameworkElement CurrentView
75 | {
76 | get { return currentView; }
77 | private set { currentView = value; OnPropertyChanged(); }
78 | }
79 |
80 |
81 | private double windowHeight = 462;
82 |
83 | public double WindowHeight
84 | {
85 | get { return windowHeight; }
86 | set { Set(ref windowHeight, value); }
87 | }
88 |
89 | public ICommand MinimCommand { get; private set; }
90 | public ICommand CloseCommand { get; private set; }
91 |
92 |
93 | }
94 | }
95 |
--------------------------------------------------------------------------------
/src/Melphily200329.WeMove/Deamon/Views/MainWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using Deamon.ViewModels;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 | using System.Windows.Controls;
9 | using System.Windows.Data;
10 | using System.Windows.Documents;
11 | using System.Windows.Input;
12 | using System.Windows.Media;
13 | using System.Windows.Media.Imaging;
14 | using System.Windows.Navigation;
15 | using System.Windows.Shapes;
16 |
17 | namespace Deamon.Views
18 | {
19 | ///
20 | /// Interaction logic for MainWindow.xaml
21 | ///
22 | public partial class MainWindow : Window
23 | {
24 | public MainWindow()
25 | {
26 | InitializeComponent();
27 |
28 | DataContext = new MainViewModel(this);
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/Melphily200329.WeMove/Deamon/Views/SearchView.xaml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 |
15 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
41 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
71 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
85 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
--------------------------------------------------------------------------------
/src/Melphily200329.WeMove/Deamon/Views/SearchView.xaml.cs:
--------------------------------------------------------------------------------
1 | using Deamon.Models;
2 | using Melphi.Base;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Collections.ObjectModel;
6 | using System.Linq;
7 | using System.Reflection;
8 | using System.Text;
9 | using System.Windows;
10 | using System.Windows.Controls;
11 |
12 | namespace Deamon.Views
13 | {
14 | ///
15 | /// SearchView.xaml 的交互逻辑
16 | ///
17 | public partial class SearchView : UserControl
18 | {
19 | public SearchView()
20 | {
21 | InitializeComponent();
22 | DataContext = new SearchViewModel();
23 | }
24 | }
25 | public class IconModel
26 | {
27 | public string IconName { get; set; }
28 |
29 | public string IconData { get; set; }
30 | }
31 |
32 | public class SearchViewModel : NotifyPropertyChanged
33 | {
34 | ///
35 | /// 本地服务对象
36 | ///
37 | ServiceLocator Locator = new ServiceLocator();
38 |
39 | ///
40 | /// 默认构造函数
41 | ///
42 | public SearchViewModel()
43 | {
44 | SearchCommand = new RelayCommand(() =>
45 | {
46 | MessageBox.Show(SearchText);
47 | });
48 |
49 | ChooseCommand = new RelayCommand(t =>
50 | {
51 | SelectedIcon = t;
52 | });
53 |
54 |
55 |
56 | // 初始化数据源
57 | var list = FindDititsInfo(Locator.IconSource);
58 | OriginalIcons = list;
59 |
60 | // 初始化界面
61 | SearchText = "";
62 | }
63 |
64 | ///
65 | /// 原始数据
66 | ///
67 | IEnumerable OriginalIcons;
68 |
69 |
70 | private string searchText;
71 |
72 | ///
73 | /// 当前搜索文本
74 | ///
75 | public string SearchText
76 | {
77 | get { return searchText; }
78 | set
79 | {
80 | searchText = value;
81 | RaisePropertyChanged(nameof(SearchText));
82 | OnSearchTextChanged();
83 | }
84 | }
85 |
86 | ///
87 | /// 当搜索文本发生变化时,修改搜索匹配的图标集合
88 | ///
89 | private void OnSearchTextChanged()
90 | {
91 | if (string.IsNullOrWhiteSpace(SearchText))
92 | {
93 | SearchedIcons = new ObservableCollection(OriginalIcons);
94 | return;
95 | }
96 |
97 | // 根据输入字符,检索原始数据中匹配的图标,并更新界面的绑定数据源
98 | SearchedIcons = new ObservableCollection(OriginalIcons.Where(t => t.IconName.ToLowerInvariant().Contains(SearchText.ToLowerInvariant())));
99 | }
100 |
101 |
102 | private ObservableCollection searchedIcons;
103 |
104 | ///
105 | /// 当前搜索匹配的图标集合
106 | ///
107 | public ObservableCollection SearchedIcons
108 |
109 | {
110 | get { return searchedIcons; }
111 | set
112 | {
113 | Set(ref searchedIcons, value);
114 | }
115 | }
116 |
117 | private IconModel selectedIcon;
118 |
119 | ///
120 | /// 当前选中的图标
121 | ///
122 | public IconModel SelectedIcon
123 | {
124 | get { return selectedIcon; }
125 | set { selectedIcon = value; OnPropertyChanged(); }
126 | }
127 |
128 |
129 | ///
130 | /// 搜索命令
131 | ///
132 | public RelayCommand SearchCommand { get; private set; }
133 |
134 |
135 | ///
136 | /// 选中命令
137 | ///
138 | public RelayCommand ChooseCommand { get; private set; }
139 |
140 |
141 |
142 |
143 | ///
144 | /// 获取 model 对象中的属性信息
145 | ///
146 | /// 对象类型
147 | /// 对象
148 | ///
149 | List FindDititsInfo(T model)
150 | {
151 | List icons = new List();
152 | var newType = model.GetType();
153 | foreach (var item in newType.GetRuntimeProperties())
154 | {
155 | IconModel icon = new IconModel();
156 | icon.IconName = item.Name;
157 | icon.IconData = item.GetValue(model).ToString();
158 | icons.Add(icon);
159 | }
160 | return icons;
161 | }
162 |
163 | }
164 | }
165 |
--------------------------------------------------------------------------------
/src/Melphily200329.WeMove/Deamon/Views/Sign/AnimatableBaseView.cs:
--------------------------------------------------------------------------------
1 | using Deamon.UiCore.Util;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows.Controls;
7 |
8 | namespace Deamon.Views.Sign
9 | {
10 | public class AnimatableBaseView : UserControl
11 | {
12 |
13 | public AnimationDirection LoadedAnimateDirection { get; set; } = AnimationDirection.FromLeft;
14 |
15 | public AnimationDirection UnLoadAnimateDirection { get; set; } = AnimationDirection.ToRight;
16 |
17 | public bool ShouldAnimatedOut { get; set; } = false;
18 |
19 | public AnimatableBaseView()
20 | {
21 | Loaded += AnimatableBaseView_Loaded;
22 | }
23 |
24 | private async void AnimatableBaseView_Loaded(object sender, System.Windows.RoutedEventArgs e)
25 | {
26 | if (ShouldAnimatedOut)
27 | await AddAnimationOut();
28 | else
29 | await AddAnimationIn();
30 | }
31 |
32 | private async Task AddAnimationIn()
33 | {
34 | await this.SlideAndFadeInAsync(LoadedAnimateDirection);
35 | }
36 |
37 | private async Task AddAnimationOut()
38 | {
39 | await this.SlideAndFadeOutAsync(UnLoadAnimateDirection);
40 | }
41 | }
42 |
43 |
44 | public enum AnimationDirection
45 | {
46 | None,
47 | FromLeft,
48 | FromRight,
49 | ToLeft,
50 | ToRight
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/src/Melphily200329.WeMove/Deamon/Views/Sign/SignHost.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/src/Melphily200329.WeMove/Deamon/Views/Sign/SignHost.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using System.Threading.Tasks;
5 | using System.Windows;
6 | using System.Windows.Controls;
7 | using System.Windows.Data;
8 | using System.Windows.Documents;
9 | using System.Windows.Input;
10 | using System.Windows.Media;
11 | using System.Windows.Media.Imaging;
12 | using System.Windows.Navigation;
13 | using System.Windows.Shapes;
14 |
15 | namespace Deamon.Views.Sign
16 | {
17 | ///
18 | /// SignHost.xaml 的交互逻辑
19 | ///
20 | public partial class SignHost : UserControl
21 | {
22 | public SignHost()
23 | {
24 | InitializeComponent();
25 | }
26 |
27 |
28 | public FrameworkElement CurrentViewContent
29 | {
30 | get { return (FrameworkElement)GetValue(CurrentViewContentProperty); }
31 | set { SetValue(CurrentViewContentProperty, value); }
32 | }
33 |
34 | // Using a DependencyProperty as the backing store for CurrentViewContent. This enables animation, styling, binding, etc...
35 | public static readonly DependencyProperty CurrentViewContentProperty =
36 | DependencyProperty.Register("CurrentViewContent", typeof(FrameworkElement), typeof(SignHost), new UIPropertyMetadata(default(FrameworkElement), null, CurrentViewPropertyChanged));
37 |
38 | private static object CurrentViewPropertyChanged(DependencyObject d, object baseValue)
39 | {
40 | var oldFrame = (d as SignHost).OldFrame;
41 | var newFrame = (d as SignHost).NewFrame;
42 |
43 | var oldFrameContent = oldFrame.Content;
44 | var newFrameContent = newFrame.Content;
45 |
46 | if (newFrameContent is AnimatableBaseView animatableBaseView)
47 | {
48 | animatableBaseView.ShouldAnimatedOut = true;
49 | oldFrame.Content = newFrameContent;
50 | newFrame.Content = null;
51 | }
52 | // First time
53 | else
54 | {
55 | newFrame.Content = baseValue;
56 | return baseValue;
57 | }
58 |
59 |
60 | Task.Delay((int)(300)).ContinueWith((t) =>
61 | {
62 | // set new content
63 | Application.Current.Dispatcher.Invoke(() =>newFrame.Content = baseValue);
64 | });
65 |
66 | return baseValue;
67 | }
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/src/Melphily200329.WeMove/Deamon/Views/Sign/SignInMailView.xaml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
29 |
30 |
31 |
32 |
33 |
34 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
--------------------------------------------------------------------------------
/src/Melphily200329.WeMove/Deamon/Views/Sign/SignInMailView.xaml.cs:
--------------------------------------------------------------------------------
1 | using Deamon.UiCore.Util;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace Deamon.Views.Sign
17 | {
18 | ///
19 | /// SignInMailView.xaml 的交互逻辑
20 | ///
21 | public partial class SignInMailView : AnimatableBaseView
22 | {
23 | public SignInMailView()
24 | {
25 | InitializeComponent();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/Melphily200329.WeMove/Deamon/Views/Sign/SignInPassView.xaml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
29 |
30 |
31 |
32 |
33 |
34 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
--------------------------------------------------------------------------------
/src/Melphily200329.WeMove/Deamon/Views/Sign/SignInPassView.xaml.cs:
--------------------------------------------------------------------------------
1 | using Deamon.UiCore.Util;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace Deamon.Views.Sign
17 | {
18 | ///
19 | /// SignInPassView.xaml 的交互逻辑
20 | ///
21 | public partial class SignInPassView : AnimatableBaseView
22 | {
23 | public SignInPassView()
24 | {
25 | InitializeComponent();
26 | }
27 | }
28 | }
--------------------------------------------------------------------------------
/src/Melphily200329.WeMove/Deamon/Views/Sign/SignLoadingView.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
--------------------------------------------------------------------------------
/src/Melphily200329.WeMove/Deamon/Views/Sign/SignLoadingView.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using System.Windows;
5 | using System.Windows.Controls;
6 | using System.Windows.Data;
7 | using System.Windows.Documents;
8 | using System.Windows.Input;
9 | using System.Windows.Media;
10 | using System.Windows.Media.Imaging;
11 | using System.Windows.Navigation;
12 | using System.Windows.Shapes;
13 |
14 | namespace Deamon.Views.Sign
15 | {
16 | ///
17 | /// SignLoadingView.xaml 的交互逻辑
18 | ///
19 | public partial class SignLoadingView : AnimatableBaseView
20 | {
21 | public SignLoadingView()
22 | {
23 | InitializeComponent();
24 | LoadedAnimateDirection = AnimationDirection.None;
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/Melphily200329.WeMove/Deamon/Views/Sign/SignUpView.xaml:
--------------------------------------------------------------------------------
1 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
36 |
37 |
38 |
39 |
40 |
41 |
45 |
46 |
47 |
48 |
49 |
52 |
56 |
57 |
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 |
--------------------------------------------------------------------------------
/src/Melphily200329.WeMove/Deamon/Views/Sign/SignUpView.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using System.Windows;
5 | using System.Windows.Controls;
6 | using System.Windows.Data;
7 | using System.Windows.Documents;
8 | using System.Windows.Input;
9 | using System.Windows.Media;
10 | using System.Windows.Media.Imaging;
11 | using System.Windows.Navigation;
12 | using System.Windows.Shapes;
13 |
14 | namespace Deamon.Views.Sign
15 | {
16 | ///
17 | /// SignUpView.xaml 的交互逻辑
18 | ///
19 | public partial class SignUpView : AnimatableBaseView
20 | {
21 | public SignUpView()
22 | {
23 | InitializeComponent();
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/Melphily200329.WeMove/Deamon/Views/Sign/SignWindow.xaml:
--------------------------------------------------------------------------------
1 |
14 |
15 |
16 |
17 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
--------------------------------------------------------------------------------
/src/Melphily200329.WeMove/Deamon/Views/Sign/SignWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using System.Windows;
5 | using System.Windows.Controls;
6 | using System.Windows.Data;
7 | using System.Windows.Documents;
8 | using System.Windows.Input;
9 | using System.Windows.Media;
10 | using System.Windows.Media.Imaging;
11 | using System.Windows.Shapes;
12 |
13 | namespace Deamon.Views.Sign
14 | {
15 | ///
16 | /// SignWindow.xaml 的交互逻辑
17 | ///
18 | public partial class SignWindow : Window
19 | {
20 | public SignWindow()
21 | {
22 | InitializeComponent();
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/Melphily200329.WeMove/Deamon/wemove.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mefdeamon/Desktop-WeMove/b1ad5cffcdbba639416e0dd0b32f8c3b7688eadf/src/Melphily200329.WeMove/Deamon/wemove.ico
--------------------------------------------------------------------------------
/src/Melphily200329.WeMove/MeiOrm/BaseSqlService.cs:
--------------------------------------------------------------------------------
1 | using Dapper;
2 | using MySql.Data.MySqlClient;
3 | using System;
4 | using System.Data;
5 |
6 | namespace MeiOrm
7 | {
8 | public abstract class BaseSqlService
9 | {
10 | protected readonly string dbName = "db_name";
11 | public readonly SqlConnectionConfig sqlCon;
12 | protected readonly string _connectionString;
13 | protected BaseSqlService(string dbName, SqlConnectionConfig sqlCon)
14 | {
15 | this.dbName = dbName;
16 | this.sqlCon = sqlCon;
17 | this._connectionString = sqlCon.ToString();
18 | }
19 |
20 | public T QueryFirstOrDefault(string sql, object? param = null, IDbTransaction? transaction = null, int? commandTimeout = null, CommandType? commandType = null)
21 | {
22 | using (var connection = new MySqlConnection(_connectionString))
23 | {
24 | return connection.QueryFirstOrDefault(sql, param,transaction,commandTimeout, commandType);
25 | }
26 | }
27 |
28 | public OperationResult Insert(string sql,T entity) where T : class
29 | {
30 | try
31 | {
32 | using (var connection = new MySqlConnection(_connectionString))
33 | {
34 | var affectedRows = connection.Execute(sql, entity);
35 |
36 | return new OperationResult
37 | {
38 | Success = affectedRows == 1,
39 | Message = affectedRows == 1 ? "insert successful" : $"affected rows: {affectedRows}"
40 | };
41 | }
42 | }
43 | catch (MySqlException mysqlEx)
44 | {
45 | return new OperationResult { Success = false, Message = $"mysql exception: {mysqlEx.Message}" };
46 | }
47 | catch (Exception ex)
48 | {
49 | return new OperationResult { Success = false, Message = $"other exception: {ex.Message}" };
50 | }
51 | }
52 | }
53 | }
--------------------------------------------------------------------------------
/src/Melphily200329.WeMove/MeiOrm/MeiOrm.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netstandard2.0
5 | latest
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/src/Melphily200329.WeMove/MeiOrm/OperationResult.cs:
--------------------------------------------------------------------------------
1 | namespace MeiOrm
2 | {
3 | public class OperationResult
4 | {
5 | public bool Success { get; set; }
6 | public string? Message { get; set; }
7 | }
8 | }
--------------------------------------------------------------------------------
/src/Melphily200329.WeMove/MeiOrm/SqlConnectionConfig.cs:
--------------------------------------------------------------------------------
1 | namespace MeiOrm
2 | {
3 | ///
4 | /// 数据库连接信息配置
5 | ///
6 | public class SqlConnectionConfig
7 | {
8 | private string server = "127.0.0.1";
9 | public string Server
10 | {
11 | get { return server; }
12 | set { server = value; }
13 | }
14 |
15 | private string userid = "root";
16 | public string Userid
17 | {
18 | get { return userid; }
19 | set { userid = value; }
20 | }
21 |
22 | private string port = "3306";
23 |
24 | public string Port
25 | {
26 | get { return port; }
27 | set { port = value; }
28 | }
29 |
30 |
31 | private string password = "meicreted@2024";
32 | public string Password
33 | {
34 | get { return password; }
35 | set { password = value; }
36 | }
37 |
38 | private string database = "db";
39 |
40 | public string Database
41 | {
42 | get { return database; }
43 | set { database = value; }
44 | }
45 |
46 | ///
47 | /// 获取数据库连接字符串
48 | ///
49 | ///
50 | public override string ToString()
51 | {
52 | return $"server = {server}; port={port}; userid = {userid}; password = {password}; database = {database};Charset=utf8; persistsecurityinfo = True;";
53 | }
54 | }
55 | }
--------------------------------------------------------------------------------
/src/Melphily200329.WeMove/Melphi.Base/Binder.cs:
--------------------------------------------------------------------------------
1 | using Ninject.Modules;
2 | using System.Collections.Generic;
3 |
4 | namespace Melphi.Base
5 | {
6 |
7 | public class Binder : NinjectModule, IBinder
8 | {
9 | private readonly IModule module;
10 |
11 | public Binder(IModule module)
12 | {
13 | this.module = module;
14 | }
15 |
16 | ///
17 | /// Binding of singleton type.
18 | ///
19 | /// The singleton type
20 | public void BindSingleton()
21 | {
22 | Bind().ToSelf().InSingletonScope();
23 | }
24 |
25 | ///
26 | /// Binding a specified implementation type to the service interface it inherits.
27 | ///
28 | /// the specified service type (generally it's an Interface)
29 | /// the specified implementation type (generally it inherits from the specified service)
30 | ///
31 | public void Bind(bool singleton = true) where TTarget : TFrom
32 | {
33 | var binding = Bind().To();
34 |
35 | if (singleton)
36 | binding.InSingletonScope();
37 | }
38 |
39 | ///
40 | /// Gets an instance of the specified service
41 | ///
42 | /// The service to resolve
43 | /// An instance of the service
44 | public T Get() => ServiceProvider.Get();
45 |
46 | public override void Load()
47 | {
48 | module.OnLoad(this);
49 | }
50 | }
51 |
52 | }
--------------------------------------------------------------------------------
/src/Melphily200329.WeMove/Melphi.Base/ExpressionHelpers.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq.Expressions;
4 | using System.Reflection;
5 | using System.Text;
6 |
7 | namespace Melphi.Base
8 | {
9 |
10 | ///
11 | /// A helper for expressions
12 | ///
13 | public static class ExpressionHelpers
14 | {
15 | ///
16 | /// Compiles an expression and gets the functions return value
17 | ///
18 | /// The type of return value
19 | /// The expression to compile
20 | ///
21 | public static T GetPropertyValue(this Expression> lambda)
22 | {
23 | return lambda.Compile().Invoke();
24 | }
25 |
26 | ///
27 | /// Sets the underlying properties value to the given value
28 | /// from an expression that contains the property
29 | ///
30 | /// The type of value to set
31 | /// The expression
32 | /// The value to set the property to
33 | public static void SetPropertyValue(this Expression> lambda, T value)
34 | {
35 | // Converts a lambda () => some.Property, to some.Property
36 | var expression = (lambda as LambdaExpression).Body as MemberExpression;
37 |
38 | // Get the property information so we can set it
39 | var propertyInfo = (PropertyInfo)expression.Member;
40 | var target = System.Linq.Expressions.Expression.Lambda(expression.Expression).Compile().DynamicInvoke();
41 |
42 | // Set the property value
43 | propertyInfo.SetValue(target, value);
44 | }
45 |
46 | }
47 |
48 | }
49 |
--------------------------------------------------------------------------------
/src/Melphily200329.WeMove/Melphi.Base/IBinder.cs:
--------------------------------------------------------------------------------
1 | namespace Melphi.Base
2 | {
3 |
4 | public interface IBinder
5 | {
6 | ///
7 | /// Binding of singleton type.
8 | ///
9 | /// The singleton type
10 | void BindSingleton();
11 |
12 | ///
13 | /// Binding a specified implementation type to the service interface it inherits.
14 | ///
15 | /// the specified service type (generally it's an Interface)
16 | /// the specified implementation type (generally it inherits from the specified service)
17 | ///
18 | void Bind(bool Singleton = true) where TTarget : TFrom;
19 |
20 | ///
21 | /// Gets an instance of the specified service
22 | ///
23 | /// The service to resolve
24 | /// An instance of the service
25 | T Get();
26 | }
27 |
28 | }
--------------------------------------------------------------------------------
/src/Melphily200329.WeMove/Melphi.Base/IModule.cs:
--------------------------------------------------------------------------------
1 | namespace Melphi.Base
2 | {
3 | ///
4 | /// The module will register into kernel
5 | ///
6 | public interface IModule
7 | {
8 | void OnLoad(IBinder binder);
9 | }
10 | }
--------------------------------------------------------------------------------
/src/Melphily200329.WeMove/Melphi.Base/Melphi.Base.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netstandard2.0
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/src/Melphily200329.WeMove/Melphi.Base/NotifyPropertyChanged.cs:
--------------------------------------------------------------------------------
1 | #region Melphi.Base
2 | // The base class of WPF desktop software products power by melphily
3 | #endregion
4 |
5 | using System;
6 | using System.Collections.Generic;
7 | using System.ComponentModel;
8 | using System.Linq.Expressions;
9 | using System.Runtime.CompilerServices;
10 | using System.Threading.Tasks;
11 |
12 | namespace Melphi.Base
13 | {
14 | ///
15 | /// A base class for objects of which the properties must be observable.
16 | ///
17 | public class NotifyPropertyChanged : INotifyPropertyChanged
18 | {
19 | ///
20 | /// Occurs after a property value changes.
21 | ///
22 | public event PropertyChangedEventHandler PropertyChanged = (sender, e) => { };
23 |
24 | ///
25 | /// Verifies that a property name exists in this ViewModel.
26 | /// This method can be called before the property is used, for instance before calling RaisePropertyChanged.
27 | /// It avoids errors when a property name is changed but some places are missed.
28 | ///
29 | /// (optional) The name of the property that changed.
30 | protected void RaisePropertyChanged(string propertyName)
31 | {
32 | PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
33 | }
34 |
35 | ///
36 | /// Raises the PropertyChanged event if needed.
37 | ///
38 | /// (optional) The name of the property that changed.
39 | public void OnPropertyChanged([CallerMemberName] string propertyName = null)
40 | {
41 | RaisePropertyChanged(propertyName);
42 | }
43 |
44 | ///
45 | /// Assigns a new value to the property.
46 | /// Then, raises the PropertyChanged event if needed.
47 | ///
48 | /// The type of the property that changed.
49 | /// The field storing the property's value.
50 | /// The property's value after the change occurred.
51 | /// (optional) The name of the property that changed.
52 | ///
53 | protected bool Set(ref T field, T Value, [CallerMemberName] string PropertyName = null)
54 | {
55 | if (EqualityComparer.Default.Equals(field, Value))
56 | return false;
57 |
58 | field = Value;
59 |
60 | RaisePropertyChanged(PropertyName);
61 |
62 | return true;
63 | }
64 |
65 | ///
66 | /// Raises all of propertys PropertyChanged event if needed.
67 | ///
68 | protected void RaiseAllChanged()
69 | {
70 | RaisePropertyChanged("");
71 | }
72 |
73 |
74 | protected object mPropertyValueCheckLock = new object();
75 |
76 | protected async Task RunCommandAsync(Expression> updatingFlag, Func action)
77 | {
78 | // Lock to ensure single access to check
79 | lock (mPropertyValueCheckLock)
80 | {
81 | // Check if the flag property is true (meaning the function is already running)
82 | if (updatingFlag.GetPropertyValue())
83 | return;
84 |
85 | // Set the property flag to true to indicate we are running
86 | updatingFlag.SetPropertyValue(true);
87 | }
88 |
89 | try
90 | {
91 | // Run the passed in action
92 | await action();
93 | }
94 | finally
95 | {
96 | // Set the property flag back to false now it's finished
97 | updatingFlag.SetPropertyValue(false);
98 | }
99 | }
100 | }
101 | }
102 |
--------------------------------------------------------------------------------
/src/Melphily200329.WeMove/Melphi.Base/RelayCommand.cs:
--------------------------------------------------------------------------------
1 | #region Melphi.Base
2 | // The base class of WPF desktop software products power by melphily
3 | #endregion
4 |
5 | using System;
6 | using System.Windows.Input;
7 |
8 | namespace Melphi.Base
9 | {
10 | // Remark:
11 | // If you are using this class in WPF4.5 or above, you need to use the GalaSoft.MvvmLight.CommandWpf
12 | // namespace (instead of GalaSoft.MvvmLight.Command). This will enable (or restore)
13 | // the CommandManager class which handles automatic enabling/disabling of controls
14 | // based on the CanExecute delegate.
15 |
16 | ///
17 | /// A generic command whose sole purpose is to relay its functionality to other objects by invoking delegates.
18 | /// The default return value for the CanExecute method is 'true'.
19 | /// This class allows you to accept command parameters in the Execute and CanExecute callback methods.
20 | ///
21 | /// The type of the command parameter.
22 | public class RelayCommand : ICommand
23 | {
24 | ///
25 | /// The execution logic.
26 | ///
27 | private Action mExecute;
28 |
29 | ///
30 | /// The execution status logic.
31 | ///
32 | private Func mCanExecute;
33 |
34 | ///
35 | /// Initializes a new instance of the RelayCommand class that can always execute.
36 | ///
37 | /// Exception:
38 | /// T:System.ArgumentNullException:
39 | /// If the execute argument is null.
40 | ///
41 | /// The execution logic. IMPORTANT: If the action causes a closure, you must set keepTargetAlive to true to avoid side effects.
42 | /// If true, the target of the Action will be kept as a hard reference, which might cause a memory leak. You should only set this parameter to true if the action is causing a closure. See http://galasoft.ch/s/mvvmweakaction.
43 | public RelayCommand(Action execute, bool keepTargetAlive = false)
44 | {
45 | // TODO: Check the T Type
46 |
47 | this.mExecute = execute;
48 | }
49 |
50 | ///
51 | /// Initializes a new instance of the RelayCommand class.
52 | ///
53 | /// Exception:
54 | /// T:System.ArgumentNullException:
55 | /// If the execute argument is null.
56 | ///
57 | /// The execution logic. IMPORTANT: If the action causes a closure, you must set keepTargetAlive to true to avoid side effects.
58 | /// The execution status logic. IMPORTANT: If the func causes a closure, you must set keepTargetAlive to true to avoid side effects.
59 | /// If true, the target of the Action will be kept as a hard reference, which might cause a memory leak. You should only set this parameter to true if the action is causing a closure.
60 | public RelayCommand(Action execute, Func canExecute, bool keepTargetAlive = false)
61 | {
62 | // TODO: Check the T Type
63 |
64 | this.mExecute = execute;
65 | this.mCanExecute = canExecute;
66 | }
67 |
68 | ///
69 | /// Occurs when changes occur that affect whether the command should execute.
70 | ///
71 | public event EventHandler CanExecuteChanged = (sender, e) => { };
72 |
73 | ///
74 | /// Defines the method that determines whether the command can execute in its current state.
75 | ///
76 | /// Data used by the command. If the command does not require data to be passed,this object can be set to a null reference
77 | /// true if this command can be executed; otherwise, false.
78 | public bool CanExecute(object parameter)
79 | {
80 | if (mCanExecute != null)
81 | return mCanExecute.Invoke((T)parameter);
82 | else
83 | return true;
84 | }
85 |
86 | ///
87 | /// Defines the method to be called when the command is invoked.
88 | ///
89 | /// Data used by the command. If the command does not require data to be passed,this object can be set to a null reference
90 | public virtual void Execute(object parameter)
91 | {
92 | mExecute.Invoke((T)parameter);
93 | }
94 |
95 | ///
96 | /// Raises the CanExecuteChanged event.
97 | ///
98 | public void RaiseCanExecuteChanged()
99 | {
100 | CanExecuteChanged(this, null);
101 | }
102 | }
103 |
104 |
105 | // Remark:
106 | // If you are using this class in WPF4.5 or above, you need to use the GalaSoft.MvvmLight.CommandWpf
107 | // namespace (instead of GalaSoft.MvvmLight.Command). This will enable (or restore)
108 | // the CommandManager class which handles automatic enabling/disabling of controls
109 | // based on the CanExecute delegate.
110 |
111 | ///
112 | /// A command whose sole purpose is to relay its functionality to other objects by invoking delegates.
113 | /// The default return value for the CanExecute method is 'true'.
114 | /// This class does not allow you to accept command parameters in the Execute and CanExecute callback methods.
115 | ///
116 | public class RelayCommand : ICommand
117 | {
118 |
119 | ///
120 | /// The execution logic.
121 | ///
122 | private Action mExecute;
123 |
124 | ///
125 | /// The execution status logic.
126 | ///
127 | private Func mCanExecute;
128 |
129 | ///
130 | /// Initializes a new instance of the RelayCommand class that can always execute.
131 | ///
132 | /// Exception:
133 | /// T:System.ArgumentNullException:
134 | /// If the execute argument is null.
135 | ///
136 | /// The execution logic. IMPORTANT: If the action causes a closure, you must set keepTargetAlive to true to avoid side effects.
137 | /// If true, the target of the Action will be kept as a hard reference, which might cause a memory leak. You should only set this parameter to true if the action is causing a closure.
138 | public RelayCommand(Action execute, bool keepTargetAlive = false)
139 | {
140 | this.mExecute = execute;
141 | }
142 |
143 | ///
144 | /// Initializes a new instance of the RelayCommand class.
145 | ///
146 | /// Exception:
147 | /// T:System.ArgumentNullException:
148 | /// If the execute argument is null.
149 | ///
150 | /// The execution logic. IMPORTANT: If the action causes a closure, you must set keepTargetAlive to true to avoid side effects.
151 | /// The execution status logic. IMPORTANT: If the func causes a closure, you must set keepTargetAlive to true to avoid side effects.
152 | /// If true, the target of the Action will be kept as a hard reference, which might cause a memory leak. You should only set this parameter to true if the action is causing a closures.
153 | public RelayCommand(Action execute, Func canExecute, bool keepTargetAlive = false)
154 | {
155 | this.mExecute = execute;
156 | this.mCanExecute = canExecute;
157 | }
158 |
159 | ///
160 | /// Occurs when changes occur that affect whether the command should execute.
161 | ///
162 | public event EventHandler CanExecuteChanged = (sender, e) => { };
163 |
164 | ///
165 | /// Defines the method that determines whether the command can execute in its current state.
166 | ///
167 | /// This parameter will always be ignored.
168 | /// true if this command can be executed; otherwise, false.
169 | public bool CanExecute(object parameter)
170 | {
171 | if (mCanExecute != null)
172 | return this.mCanExecute.Invoke();
173 | else
174 | return true;
175 | }
176 |
177 | ///
178 | /// Defines the method to be called when the command is invoked.
179 | ///
180 | /// This parameter will always be ignored.
181 | public virtual void Execute(object parameter)
182 | {
183 | this.mExecute.Invoke();
184 | }
185 |
186 | ///
187 | /// Raises the CanExecuteChanged event.
188 | ///
189 | public void RaiseCanExecuteChanged()
190 | {
191 | CanExecuteChanged.Invoke(this, null);
192 | }
193 | }
194 |
195 | }
196 |
--------------------------------------------------------------------------------
/src/Melphily200329.WeMove/Melphi.Base/ServiceProvider.cs:
--------------------------------------------------------------------------------
1 | using Ninject;
2 | using Ninject.Modules;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Text;
6 |
7 | namespace Melphi.Base
8 | {
9 | public class ServiceProvider
10 | {
11 | static IKernel Kernel { get; } = new StandardKernel();
12 |
13 |
14 | public static void LoadModule(IModule module)
15 | {
16 | Kernel.Load(new Binder(module));
17 | }
18 | public static T Get() => Kernel.Get();
19 | }
20 |
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/src/Melphily200329.WeMove/Melphi.Core/Melphi.Core.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netstandard2.1
5 |
6 |
7 |
8 |
9 | MySql.Data.dll
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/src/Melphily200329.WeMove/Melphi.Core/MySql.Data.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mefdeamon/Desktop-WeMove/b1ad5cffcdbba639416e0dd0b32f8c3b7688eadf/src/Melphily200329.WeMove/Melphi.Core/MySql.Data.dll
--------------------------------------------------------------------------------
/src/Melphily200329.WeMove/Melphi.Core/MySqlDatabaseEntity.cs:
--------------------------------------------------------------------------------
1 | using MySql.Data.MySqlClient;
2 | using System;
3 | using System.Data;
4 | using System.Text;
5 |
6 | namespace Melphi.Core
7 | {
8 | public class MySqlDatabaseEntity
9 | {
10 | private string dbConnStr;
11 | private MySqlConnection dbConn = null;
12 |
13 |
14 | public MySqlDatabaseEntity(string connectionString)
15 | {
16 | dbConnStr = connectionString;
17 | dbConn = new MySqlConnection(dbConnStr);
18 | }
19 |
20 | ~MySqlDatabaseEntity()
21 | {
22 | Close();
23 | }
24 |
25 | public void Open()
26 | {
27 | dbConn.Open();
28 | }
29 |
30 | public void Close()
31 | {
32 | dbConn.Close();
33 | }
34 |
35 | public DataSet ExecuteSelect(string sql)
36 | {
37 | var mycom = dbConn.CreateCommand();
38 | mycom.CommandText = sql;
39 | MySqlDataAdapter adap = new MySqlDataAdapter(mycom);
40 | DataSet ds = new DataSet();
41 | adap.Fill(ds);
42 | return ds;
43 | }
44 |
45 | ///
46 | /// Execute Non Query SQL statement
47 | ///
48 | ///
49 | ///
50 | public int ExecuteNonQuery(string sql)
51 | {
52 | var mycom = dbConn.CreateCommand();
53 | mycom.CommandText = sql;
54 |
55 | return mycom.ExecuteNonQuery();
56 | }
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/src/Melphily200329.WeMove/Melphi.IconSet/FdoiIconSet.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace Melphi.IconSet
6 | {
7 | ///
8 | /// IconFont 平台上 Fdoi(作者) 的图标集
9 | ///
10 | public class FdoiIconSet : IIconSet
11 | {
12 | public string AllowLeft => "M350.08 417.92l208 208a48 48 0 1 0 67.84-67.84L451.84 384l174.08-174.08a48 48 0 1 0-67.84-67.84l-208 208a47.9 47.9 0 0 0 0 67.84z";
13 |
14 | public string AllowRight => "M673.92 350.08l-208-208a48 48 0 1 0-67.84 67.84L572.16 384 398.08 558.08a48 48 0 1 0 67.84 67.84l208-208a47.9 47.9 0 0 0 0-67.84z";
15 |
16 | public string AllowUp => "M545.92 545.92l208-208a48 48 0 1 0-67.84-67.84L512 444.16 337.92 270.08a48 48 0 1 0-67.84 67.84l208 208a47.9 47.9 0 0 0 67.84 0z";
17 |
18 | public string AllowDown => "M478.08 222.08l-208 208a48 48 0 1 0 67.84 67.84L512 323.84l174.08 174.08a48 48 0 1 0 67.84-67.84l-208-208a47.9 47.9 0 0 0-67.84 0z";
19 |
20 | public string Person => "F1 M764.35 87.29l-504.7-1.79c-25.65-0.09-46.65 22.5-42.57 47.91a300.16 300.16 0 0 0 12.63 50.39 123.68 123.68 0 0 0 8.89 20.34 148.56 148.56 0 0 0 59.81 61.59 615 615 0 0 0 91.44 41.06 44.23 44.23 0 0 1 28.66 33.3 151.09 151.09 0 0 1-2.19 67.91c-1.55 5.84-7 13.76-11.27 18a150.1 150.1 0 0 0-40.72 75 19.34 19.34 0 0 0-0.31 3 15 15 0 0 0 14.88 15 3.3 3.3 0 0 1 3.28 3.15 379.4 379.4 0 0 1-2.41 50.24c-6.95 58.13 38.39 115.45 96.33 123.8a242.8 242.8 0 0 0 67.47 0.24c58-7.94 103.74-64.94 97.21-123.11a378 378 0 0 1-2-50.26 3.28 3.28 0 0 1 3.3-3.12 19.43 19.43 0 0 0 3-0.29 14.85 14.85 0 0 0 11.71-17.58 150.06 150.06 0 0 0-40.18-75.24c-4.24-4.3-9.64-12.25-11.15-18.1a151.31 151.31 0 0 1-1.71-68 44.24 44.24 0 0 1 28.91-33.1 615.28 615.28 0 0 0 91.72-40.41 148.47 148.47 0 0 0 60.25-61.16 122.82 122.82 0 0 0 9-20.28 299.74 299.74 0 0 0 13-50.3c4.19-25.33-16.57-48.1-42.28-48.19z";
21 |
22 | public string Build => "F1 M789.67 246.12a96.08 96.08 0 0 1-17.42 17.42L609 390.94a99.9 99.9 0 0 0-35.34 102.52c1.5 6.47 3 12.94 4 19.9 4 27.37-3.48 55.74-20.9 77.14a248.58 248.58 0 0 1-166.21 92.06c-13.93 1.5-26.38-8.46-27.87-21.9-0.5-8 2-15.42 7.47-20.4l92.06-92.56-23.89-90.08-90.07-23.88-92.56 92.06a24.05 24.05 0 0 1-34.83 0c-5.47-5-8-12.44-7.46-20.4a248.58 248.58 0 0 1 92.06-166.22c21.4-17.41 49.76-24.88 77.14-20.9 7 1 13.43 2.49 19.9 4A99.9 99.9 0 0 0 505 286.93L632.41 123.7c33.84-43.29 96.55-51.25 139.84-17.41s51.26 96.54 17.42 139.83zM711 142.25a42.67 42.67 0 1 0 42.67 42.66A42.79 42.79 0 0 0 711 142.25z";
23 |
24 | public string Edit => "F1 M369.24 152.41l-92.77-30.92a21.33 21.33 0 0 0-27 27l30.92 92.77A213.3 213.3 0 0 0 332 324.63l316.68 316.73a85.34 85.34 0 0 0 120.68 0 85.34 85.34 0 0 0 0-120.68L452.63 203.95a213.3 213.3 0 0 0-83.39-51.54z";
25 |
26 | public string FullScreen => "M400 64H240a47.94 47.94 0 0 0-48 48V272a48 48 0 0 0 96 0v-112h112a48 48 0 0 0 0-96z m0 544H288v-112a48 48 0 0 0-96 0V656a47.94 47.94 0 0 0 48 48h160a48 48 0 0 0 0-96z m432-496a47.94 47.94 0 0 0-48-48H624a48 48 0 0 0 0 96h112V272a48 48 0 0 0 96 0z m0 384a48 48 0 0 0-96 0V608H624a48 48 0 0 0 0 96h160a47.94 47.94 0 0 0 48-48z";
27 |
28 | public string FullScreenExit => "M400 320H240a48 48 0 0 1 0-96h112v-112a48 48 0 0 1 96 0V272a47.94 47.94 0 0 1-48 48zM400 704a47.94 47.94 0 0 1-48-48v-112H240a48 48 0 0 1 0-96h160a47.94 47.94 0 0 1 48 48V656a47.94 47.94 0 0 1-48 48zM784 320H624a47.94 47.94 0 0 1-48-48v-160a48 48 0 0 1 96 0V224h112a48 48 0 0 1 0 96zM624 448h160a48 48 0 0 1 0 96H672V656a48 48 0 0 1-96 0v-160a47.94 47.94 0 0 1 48-48z";
29 |
30 | public string MuteVolumeLow => "M503 674.24a49.88 49.88 0 0 0 25 7 47.94 47.94 0 0 0 48-48v-222.68L384.32 602.24z m295-644.16a47.71 47.71 0 0 0-67.84 0L576 184.32v-49.6a49.88 49.88 0 0 0-7-25 47.88 47.88 0 0 0-65.92-16L288 224a159.84 159.84 0 0 0-148.16 99.84c-33.28 81.92 6.08 175.36 88 208.32l-73.6 73.92a48 48 0 0 0 67.84 67.84l576-576a47.71 47.71 0 0 0 0-67.84z";
31 |
32 | public string MuteVolumeMedium => "M642.24 511.68c23 12.8 52.48 4.8 65.28-18.56a223.63 223.63 0 0 0 1.6-215.68l-73.6 73.28a127.84 127.84 0 0 1-11.84 95.68 48.18 48.18 0 0 0 18.56 65.28zM503 674.24a49.88 49.88 0 0 0 25 7 47.94 47.94 0 0 0 48-48v-222.68L384.32 602.24z m295-644.16a47.71 47.71 0 0 0-67.84 0L576 184.32v-49.6a49.88 49.88 0 0 0-7-25 47.88 47.88 0 0 0-65.92-16L288 224a159.84 159.84 0 0 0-148.16 99.84c-33.28 81.92 6.08 175.36 88 208.32l-73.6 73.92a48 48 0 0 0 67.84 67.84l576-576a47.71 47.71 0 0 0 0-67.84z";
33 |
34 | public string MuteVolumeHigh => "M642.24 511.68c23 12.8 52.48 4.8 65.28-18.56a223.63 223.63 0 0 0 1.6-215.68l-73.6 73.28a127.84 127.84 0 0 1-11.84 95.68 48.18 48.18 0 0 0 18.56 65.28zM503 674.24a49.88 49.88 0 0 0 25 7 47.94 47.94 0 0 0 48-48v-222.68L384.32 602.24z m295-644.16a47.71 47.71 0 0 0-67.84 0L576 184.32v-49.6a49.88 49.88 0 0 0-7-25 47.88 47.88 0 0 0-65.92-16L288 224a159.84 159.84 0 0 0-148.16 99.84c-33.28 81.92 6.08 175.36 88 208.32l-73.6 73.92a48 48 0 0 0 67.84 67.84l576-576a47.71 47.71 0 0 0 0-67.84z m27 131.52l-69.12 69.12a288.06 288.06 0 0 1-13.12 325.76c-16 21.12-11.52 51.2 9.6 67.2s51.2 11.52 67.2-9.6A384.21 384.21 0 0 0 825 161.6z" ;
35 |
36 | public string VolumeLow => "M576 134.72a49.88 49.88 0 0 0-7-25 47.88 47.88 0 0 0-65.92-16L288 224a160 160 0 0 0 0 320l215 130.24a49.88 49.88 0 0 0 25 7 47.94 47.94 0 0 0 48-48z";
37 |
38 | public string VolumeMedium => "M576 134.72a49.88 49.88 0 0 0-7-25 47.88 47.88 0 0 0-65.92-16L288 224a160 160 0 0 0 0 320l215 130.24a49.88 49.88 0 0 0 25 7 47.94 47.94 0 0 0 48-48z m66.24 121.6a48.18 48.18 0 0 0-18.56 65.28 127.45 127.45 0 0 1 0 124.8 48.18 48.18 0 0 0 18.56 65.28c23 12.8 52.48 4.8 65.28-18.56a222.74 222.74 0 0 0 0-218.24c-12.8-23.36-42.24-31.36-65.28-18.56z";
39 |
40 | public string VolumeHigh => "M576 134.72a49.88 49.88 0 0 0-7-25 47.88 47.88 0 0 0-65.92-16L288 224a160 160 0 0 0 0 320l215 130.24a49.88 49.88 0 0 0 25 7 47.94 47.94 0 0 0 48-48z m66.24 121.6a48.18 48.18 0 0 0-18.56 65.28 127.45 127.45 0 0 1 0 124.8 48.18 48.18 0 0 0 18.56 65.28c23 12.8 52.48 4.8 65.28-18.56a222.74 222.74 0 0 0 0-218.24c-12.8-23.36-42.24-31.36-65.28-18.56z m177.28-102.4c-16-21.12-46.08-25.6-67.2-9.6s-25.6 46.08-9.6 67.2a288 288 0 0 1 0 345c-16 21.12-11.52 51.2 9.6 67.2s51.2 11.52 67.2-9.6a384 384 0 0 0 0-460.2z" ;
41 |
42 | public string Close => "M753.92 209.92a48 48 0 1 0-67.84-67.84L512 316.16 337.92 142.08a48 48 0 1 0-67.84 67.84L444.16 384 270.08 558.08a48 48 0 1 0 67.84 67.84L512 451.84l174.08 174.08a48 48 0 1 0 67.84-67.84L579.84 384z";
43 |
44 | public string Menu => "M806.16 432H217.84a48 48 0 1 1 0-95.94h588.32a48 48 0 1 1 0 95.94zM217.84 544.06h588.32a48 48 0 1 1 0 95.94H217.84a48 48 0 1 1 0-95.94zM806.16 223.94H217.84a48 48 0 1 1 0-95.94h588.32a48 48 0 1 1 0 95.94z";
45 |
46 | public string Play => "M746.88 423.68l-318.23 184c-30.5 17.62-68.65-4.39-68.65-39.62v-368.12c0-35.23 38.15-57.24 68.65-39.61l318.23 184c30.63 17.58 30.63 61.76 0 79.35z";
47 |
48 | public string Pause => "M448 241a64 64 0 0 0-128 0V527a64 64 0 0 0 128 0z m256 0a64.32 64.32 0 0 0-128.64 0V527A64.32 64.32 0 0 0 704 527z";
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/src/Melphily200329.WeMove/Melphi.IconSet/IIconSet.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Melphi.IconSet
4 | {
5 | public interface IIconSet
6 | {
7 | string AllowLeft { get; }
8 | string AllowRight { get; }
9 | string AllowUp { get; }
10 | string AllowDown { get; }
11 | string Person { get; }
12 | string Build { get; }
13 | string Edit { get; }
14 | string FullScreen { get; }
15 | string FullScreenExit { get; }
16 | string MuteVolumeLow { get; }
17 | string MuteVolumeMedium { get; }
18 | string MuteVolumeHigh { get; }
19 | string VolumeLow { get; }
20 | string VolumeMedium { get; }
21 | string VolumeHigh { get; }
22 | string Close { get; }
23 | string Menu { get; }
24 | string Play { get; }
25 | string Pause { get; }
26 |
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/Melphily200329.WeMove/Melphi.IconSet/Melphi.IconSet.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netstandard2.0
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/src/Melphily200329.WeMove/Melphi.WebApi/Melphi.WebApi.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net6.0
5 | enable
6 | enable
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/src/Melphily200329.WeMove/Melphi.WebApi/Program.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mefdeamon/Desktop-WeMove/b1ad5cffcdbba639416e0dd0b32f8c3b7688eadf/src/Melphily200329.WeMove/Melphi.WebApi/Program.cs
--------------------------------------------------------------------------------
/src/Melphily200329.WeMove/Melphi.WebApi/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://json.schemastore.org/launchsettings.json",
3 | "iisSettings": {
4 | "windowsAuthentication": false,
5 | "anonymousAuthentication": true,
6 | "iisExpress": {
7 | "applicationUrl": "http://localhost:50446",
8 | "sslPort": 0
9 | }
10 | },
11 | "profiles": {
12 | "Melphi.WebApi": {
13 | "commandName": "Project",
14 | "dotnetRunMessages": true,
15 | "launchBrowser": true,
16 | "launchUrl": "api/auth",
17 | "applicationUrl": "http://localhost:5279",
18 | "environmentVariables": {
19 | "ASPNETCORE_ENVIRONMENT": "Development"
20 | }
21 | },
22 | "IIS Express": {
23 | "commandName": "IISExpress",
24 | "launchBrowser": true,
25 | "launchUrl": "api/auth",
26 | "environmentVariables": {
27 | "ASPNETCORE_ENVIRONMENT": "Development"
28 | }
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/Melphily200329.WeMove/Melphi.WebApi/WemoveDbService.cs:
--------------------------------------------------------------------------------
1 | using MeiOrm;
2 |
3 | namespace Melphi.WebApi
4 | {
5 | public class WemoveDbService : BaseSqlService
6 | {
7 | public WemoveDbService() :
8 | base("wemove",
9 | new MeiOrm.SqlConnectionConfig()
10 | {
11 | Password = "meicreated@2024",
12 | Database = "wemove"
13 | }
14 | )
15 | {
16 |
17 | }
18 | }
19 |
20 | public class user_info
21 | {
22 | public int Id { get; set; }
23 | public string? UserName { get; set; }
24 |
25 | public string? Email { get; set; }
26 |
27 | public string? Password { get; set; }
28 |
29 | public DateTime CreateDate { get; set; }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/Melphily200329.WeMove/Melphi.WebApi/appsettings.Development.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Information",
5 | "Microsoft.AspNetCore": "Warning"
6 | }
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/src/Melphily200329.WeMove/Melphi.WebApi/appsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Information",
5 | "Microsoft.AspNetCore": "Warning"
6 | }
7 | },
8 | "AllowedHosts": "*"
9 | }
10 |
--------------------------------------------------------------------------------
/src/Melphily200329.WeMove/Melphi.WebApi/wemove_db_sql.txt:
--------------------------------------------------------------------------------
1 | CREATE TABLE `user_info` (
2 | `Id` int NOT NULL AUTO_INCREMENT,
3 | `UserName` varchar(255) DEFAULT NULL COMMENT '用户名',
4 | `Email` varchar(255) NOT NULL DEFAULT '' COMMENT '邮箱',
5 | `Password` varchar(255) NOT NULL DEFAULT '' COMMENT '密码',
6 | `CreateDate` date DEFAULT '2020-07-16' COMMENT '创建日期',
7 | PRIMARY KEY (`Id`)
8 | ) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb3 COMMENT='用户信息表'
--------------------------------------------------------------------------------
/src/Melphily200329.WeMove/Melphily200329.WeMove.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.8.34309.116
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Deamon", "Deamon\Deamon.csproj", "{5CAC6629-5DE3-404B-ACA5-203C8BE60FD7}"
7 | EndProject
8 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Melphi.IconSet", "Melphi.IconSet\Melphi.IconSet.csproj", "{B9857818-5002-41BE-A89A-28D7E8179F05}"
9 | EndProject
10 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Melphi.Base", "Melphi.Base\Melphi.Base.csproj", "{1C8C2C08-8053-424F-8F4D-91909B88FEB4}"
11 | EndProject
12 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Melphi.Core", "Melphi.Core\Melphi.Core.csproj", "{ED311DA1-01EE-4489-AD4C-E29789512EEB}"
13 | EndProject
14 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MeiOrm", "MeiOrm\MeiOrm.csproj", "{E3C2CCB1-2F83-4C2C-B118-3E7B897B309A}"
15 | EndProject
16 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Melphi.WebApi", "Melphi.WebApi\Melphi.WebApi.csproj", "{1B519249-F9EB-4A1D-AF65-590F15D6A07B}"
17 | EndProject
18 | Global
19 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
20 | Debug|Any CPU = Debug|Any CPU
21 | Release|Any CPU = Release|Any CPU
22 | EndGlobalSection
23 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
24 | {5CAC6629-5DE3-404B-ACA5-203C8BE60FD7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
25 | {5CAC6629-5DE3-404B-ACA5-203C8BE60FD7}.Debug|Any CPU.Build.0 = Debug|Any CPU
26 | {5CAC6629-5DE3-404B-ACA5-203C8BE60FD7}.Release|Any CPU.ActiveCfg = Release|Any CPU
27 | {5CAC6629-5DE3-404B-ACA5-203C8BE60FD7}.Release|Any CPU.Build.0 = Release|Any CPU
28 | {B9857818-5002-41BE-A89A-28D7E8179F05}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
29 | {B9857818-5002-41BE-A89A-28D7E8179F05}.Debug|Any CPU.Build.0 = Debug|Any CPU
30 | {B9857818-5002-41BE-A89A-28D7E8179F05}.Release|Any CPU.ActiveCfg = Release|Any CPU
31 | {B9857818-5002-41BE-A89A-28D7E8179F05}.Release|Any CPU.Build.0 = Release|Any CPU
32 | {1C8C2C08-8053-424F-8F4D-91909B88FEB4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
33 | {1C8C2C08-8053-424F-8F4D-91909B88FEB4}.Debug|Any CPU.Build.0 = Debug|Any CPU
34 | {1C8C2C08-8053-424F-8F4D-91909B88FEB4}.Release|Any CPU.ActiveCfg = Release|Any CPU
35 | {1C8C2C08-8053-424F-8F4D-91909B88FEB4}.Release|Any CPU.Build.0 = Release|Any CPU
36 | {ED311DA1-01EE-4489-AD4C-E29789512EEB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
37 | {ED311DA1-01EE-4489-AD4C-E29789512EEB}.Debug|Any CPU.Build.0 = Debug|Any CPU
38 | {ED311DA1-01EE-4489-AD4C-E29789512EEB}.Release|Any CPU.ActiveCfg = Release|Any CPU
39 | {ED311DA1-01EE-4489-AD4C-E29789512EEB}.Release|Any CPU.Build.0 = Release|Any CPU
40 | {E3C2CCB1-2F83-4C2C-B118-3E7B897B309A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
41 | {E3C2CCB1-2F83-4C2C-B118-3E7B897B309A}.Debug|Any CPU.Build.0 = Debug|Any CPU
42 | {E3C2CCB1-2F83-4C2C-B118-3E7B897B309A}.Release|Any CPU.ActiveCfg = Release|Any CPU
43 | {E3C2CCB1-2F83-4C2C-B118-3E7B897B309A}.Release|Any CPU.Build.0 = Release|Any CPU
44 | {1B519249-F9EB-4A1D-AF65-590F15D6A07B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
45 | {1B519249-F9EB-4A1D-AF65-590F15D6A07B}.Debug|Any CPU.Build.0 = Debug|Any CPU
46 | {1B519249-F9EB-4A1D-AF65-590F15D6A07B}.Release|Any CPU.ActiveCfg = Release|Any CPU
47 | {1B519249-F9EB-4A1D-AF65-590F15D6A07B}.Release|Any CPU.Build.0 = Release|Any CPU
48 | EndGlobalSection
49 | GlobalSection(SolutionProperties) = preSolution
50 | HideSolutionNode = FALSE
51 | EndGlobalSection
52 | GlobalSection(ExtensibilityGlobals) = postSolution
53 | SolutionGuid = {54359D3A-9E37-4843-8045-6B22AE6715F7}
54 | EndGlobalSection
55 | EndGlobal
56 |
--------------------------------------------------------------------------------