练手WPF(二)——2048游戏的简易实现(上)
原文: 练手WPF(二)——2048游戏的简易实现(上) 1、创建游戏界面 编辑MainWindow.xaml,修改代码如下: < Window.Resources > < Style TargetType ="Label" > < Setter Property ="Height" Value ="105" /> < Setter Property ="Width" Value ="105" /> < Setter Property ="HorizontalContentAlignment" Value ="Center" /> < Setter Property ="VerticalContentAlignment" Value ="Center" /> < Setter Property ="FontWeight" Value ="Bold" /> < Setter Property ="Opacity" Value ="0.7" /> </ Style > < Style TargetType ="Rectangle" > < Setter Property ="Width" Value ="105" /> < Setter Property ="Height" Value ="105" /> < Setter Property ="Fill" Value ="