我想知道如何在UniformGrid中爲WPF顯示網格線。我知道在普通網格中很容易設置網格線,但是我發現UniformGrid不能像普通網格那樣設置網格線。給代碼和xaml提供一個簡單的例子是很好的,因爲我想在編程方面更加靈活。謝謝!如何在代碼/ xaml中爲WPF顯示UniformGrid中的網格線?
// LOGIN PAGE
//gameType is input by users.If gameType =3, it will form 3x3 uniform grid in GAMEPLAY PAGE
GamePlay main = new GamePlay(gameType, playerNum);
App.Current.MainWindow = main;
this.Close();
main.Show();
// GAMEPLAY PAGE
// Form the required grid, I can form the grid correctly, but I want grid line to make it more clear
考慮在'UniformGrid'單元格中使用'Rectangle'作爲根元素。請參閱[this](http://wrb.home.xs4all.nl/Articles_2011/Article_WPFUniformGrid_01.htm)教程 – dvvrd 2012-08-15 07:49:13