The content you requested has been removed. Ask a question. Quick access. Search related threads. Remove From My Forums. Answered by:. Archived Forums. Sign in to vote. ObjectModel; using System. AlternationIndex properties enable you to specify the appearance for two or more alternating item containers. For example, you can specify alternating background colors for every third item in an ItemsControl.
The ItemsControl. AlternationIndex is assigned to each item container in the ItemsControl. AlternationIndex begins at 0, increments until it is AlternationCount minus 1, and then restarts at 0. For example, if AlternationCount is 3 and there are seven items in the ItemsControl , the following table lists the ItemsControl. AlternationIndex for each item. There are several methods you can use to specify different appearances for the alternating item containers.
One method is to bind properties of the items container to the ItemsControl. You can then use an AlternationConverter to specify which value should be applied to the item container that has a certain ItemsControl.
AlternationIndex value. Privacy policy. Thank you. Microsoft makes no warranties, express or implied, with respect to the information provided here. The following example creates a TreeView that is bound to data that is three levels deep, and each item is displayed in a TextBlock.
The TextBlock objects in the first level have the same property values, the TextBlock objects in the second level use alternating values for the FontStyle property, and the TextBlock objects in the third level use alternating values for the Background property.
AlternationIndex for the TreeViewItem objects in the second level alternates between 0 and 1. AlternationIndex to an alternating FontStyle. The AlternationCount and ItemsControl. AlternationIndex properties enable you to specify the appearance for two or more alternating item containers. For example, you can specify alternating background colors for every third item in an ItemsControl. The ItemsControl.
AlternationIndex is assigned to each item container in the ItemsControl.
0コメント