こと:私はこのようなループのためにVisibiltyを変更したい編集チャンピオンのXAML 6値と同様の私のXAMLファイルでは、私が持っている
<TextBlock Name="Player0" Visibility="Hidden" Text="Player 0" />
<TextBlock Name="Player1" Visibility="Hidden" Text="Player 1" />
...
しかし:
for (int i = 0; i<6; i++)
{
String test = "Player" + i;
test.Visibility = Visibility.Visible;
}
しかし、それを動作しません。
誰かが私を助けることができますか?
1でしょう[バインド](https://msdn.microsoft.com/en-us/library/ms752347.aspx) 'ItemsControl'オブジェクトのリストにアイテムの可視性をそれらのオブジェクトのプロパティにバインドし、そのプロパティを変更するだけです。 [データテンプレート](https://msdn.microsoft.com/en-us/library/ms742521(v = vs.100).aspx)も参照してください。 –