WPF-MVVM井字棋游戏2012.12.31

WPF-MVVM 结构的井字棋游戏,UI 界面清爽,结构分层也挺清晰,适合想练手 MVVM 的同学看看。View 就是 UI,ViewModel 把 Command 和数据做了桥接,Model 负责数据逻辑,代码不算复杂,逻辑也比较好懂。

WPF 做交互界面还挺顺手的,配合 MVVM 能把界面和逻辑分得干净。这份源码里ViewModel写得还不错,命令绑定用得比较到位,比如玩家点击格子,就能通过绑定触发逻辑,响应也快。

比较适合 WPF 新手熟悉 MVVM 怎么走流程,比如你想搞一个回合制的小项目,这个井字棋逻辑简单但流程齐全,正好练练:初始化、绑定、事件、状态更新,一个都不少。

哦对,里面没用太多样式装饰,所以看起来偏基础。但其实也好,干净、纯粹,方便你自己再扩展,比如加个悔棋、计分板什么的,都挺好加。

如果你最近在学WPF或者想搞懂MVVM怎么套进项目里,不妨下载看看,改改逻辑、换换皮肤,也算一次小实战。

zip
CSWPFMVVMPractice_09a9e04f-3921-4676-a378-f62c26d85021.zip 预估大小:65个文件
folder
CSWPFMVVMPractice_09a9e04f-3921-4676-a378-f62c26d85021 文件夹
file
CSWPFMVVMPractice.vssscc 256B
file
CSWPFMVVMPractice.sln 941B
folder
CSWPFMVVMPractice 文件夹
file
MainWindowResources.xaml 5KB
file
CSWPFMVVMPractice.csproj 8KB
file
App.xaml 271B
folder
obj 文件夹
folder
Debug 文件夹
file
App.g.i.cs 2KB
file
GeneratedInternalTypeHelper.g.cs 7B
file
GeneratedInternalTypeHelper.g.i.cs 3KB
file
CSWPFMVVMPractice_MarkupCompile.i.cache 364B
folder
TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs 文件夹
file
App.g.cs 2KB
file
CSWPFMVVMPractice.Properties.Resources.resources 180B
file
CSWPFMVVMPractice_MarkupCompile.lref 322B
file
CSWPFMVVMPractice.application 2KB
file
CSWPFMVVMPractice.csproj.GenerateResource.Cache 917B
file
CSWPFMVVMPractice_MarkupCompile.i.lref 324B
file
DesignTimeResolveAssemblyReferencesInput.cache 7KB
file
CSWPFMVVMPractice.g.resources 27KB
file
MainWindow.g.cs 3KB
folder
TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs 文件夹
file
MainWindowResources.baml 4KB
file
CSWPFMVVMPractice.csproj.FileListAbsolute.txt 2KB
folder
TempPE 文件夹
file
CSWPFMVVMPractice_Content.g.cs 519B
file
CSWPFMVVMPractice.pdb 70KB
file
CSWPFMVVMPractice_Content.g.i.cs 519B
folder
TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs 文件夹
file
CSWPFMVVMPractice.exe.manifest 4KB
file
CSWPFMVVMPractice_MarkupCompile.cache 365B
file
CSWPFMVVMPractice.exe 45KB
file
MainWindow.g.i.cs 3KB
file
MainWindow.baml 2KB
file
RelayCommand.cs 2KB
file
IntToBoolValueConverter.cs 2KB
file
App.xaml.cs 2KB
folder
Model 文件夹
file
PlayerMove.cs 3KB
file
Cell.cs 2KB
folder
ViewModel 文件夹
file
TicTacToeViewModel.cs 13KB
file
app.config 144B
folder
Documentation 文件夹
folder
ReadMe_files 文件夹
file
colorschememapping.xml 314B
file
image001.png 19KB
file
item0005.xml 218B
file
filelist.xml 304B
file
props006.xml 341B
file
themedata.thmx 3KB
file
ReadMe.htm 58KB
file
CSWPFMVVMPractice.csproj.vspscc 257B
file
MainWindow.xaml 2KB
folder
Properties 文件夹
file
Resources.resx 5KB
file
Settings.settings 201B
file
AssemblyInfo.cs 2KB
file
Settings.Designer.cs 1KB
file
Resources.Designer.cs 3KB
file
MainWindow.xaml.cs 230B
folder
AttachedBehavior 文件夹
file
ChangeDimensionBehavior.cs 3KB
file
GameOverBehavior.cs 3KB
file
ShutdownBehavior.cs 4KB
folder
Debug 文件夹
file
CSWPFMVVMPractice.vshost.exe 22KB
file
CSWPFMVVMPractice.exe.config 144B
file
CSWPFMVVMPractice.application 2KB
file
CSWPFMVVMPractice.vshost.exe.manifest 4KB
file
CSWPFMVVMPractice.vshost.application 2KB
file
CSWPFMVVMPractice.pdb 70KB
file
CSWPFMVVMPractice.exe.manifest 4KB
file
CSWPFMVVMPractice.exe 45KB
file
CSWPFMVVMPractice.vshost.exe.config 144B
...
zip 文件大小:180.81KB