Brad Smith has made an nice List control for mediacenter
i have some customized
Mcml xmlns=“http://schemas.microsoft.com/2008/mcml“
xmlns:cor=“assembly://MsCorLib/System“
xmlns:coll=“assembly://MsCorLib/System.Collections“
xmlns:btn=“<!–Path to Button.mcml–>“
xmlns:code=“<!–Path to the assembly containing the ListSelection class–>“
xmlns:me=“Me“>
<!–simple list of buttons, reports the selected item and its index–>
<UI Name=“List“>
<Locals>
<!–passed to list items, holds the selected item and its index–>
<code:ListSelection Name=“Selection“ />
</Locals>
<Properties>
<!–data source to create the list items from–>
<coll:IList Name=“IList“ IList=“$Required“ />
<!–command invoked on the selected item when clicked–>
<ICommand Name=“Command“ ICommand=“$Required“ />
<!–selected item–>
<cor:Object Name=“SelectedItem“ Object=“null“ />
<!–index of the selected item–>
<cor:Int32 Name=“SelectedIndex“ Int32=“-1″ />
<!–set scroller orientation to Vertical or Horizontal default is Vertical but can be override–>
<Orientation Name=“Orientation“ Orientation=“Vertical“/>
<!–set the MaximumSize of the List–>
<Size Name=“ListSize“ Size=“400,300″ />
<!–Set Spacing for Layout–>
<Size Name=“Spacing“ Size=“0,0″/>
<!–Set Numer of Columns for GridLayout–>
<cor:Int32 Name=“Columns“ Int32=“0″/>
<!–Set Number of Rows for GridLayout–>
<cor:Int32 Name=“Rows“ Int32=“0″/>
</Properties>
<Rules>
<Default Target=“[Scroller.Orientation]“ Value=“[Orientation]“/>
<Binding Source=“[Rows]“ Target=“[Repeater.Layout!GridLayout.Rows]“/>
<Binding Source=“[Columns]“ Target=“[Repeater.Layout!GridLayout.Columns]“/>
<Binding Source=“[Spacing]“ Target=“[Repeater.Layout!GridLayout.Spacing]“/>
<Binding Source=“[Orientation]“ Target=“[Repeater.Layout!GridLayout.Orientation]“/>
<!–bind selection to properties–>
<Binding Source=“[Selection.Index]“ Target=“[SelectedIndex]“ />
<Binding Source=“[Selection.Item]“ Target=“[SelectedItem]“ />
</Rules>
<Content>
<!–Scrolls the repeater data–>
<Scroller Name=“Scroller“ FadeSize=“10″ MaximumSize=“[ListSize]“ >
<Children>
<!–repeats the content for each item in the data source–>
<Repeater Name=“Repeater“ Source=“[IList]“ >
<Content>
<!–list item requires details about the current item and must be able to update the selection–>
<me:ListItem Index=“[RepeatedItemIndex]“ Item=“[RepeatedItem]“ SelectionHolder=“[Selection]“>
<Command>
<!–invokes the main command while providing a unique description for each item–>
<InvokeCommand Description=“[RepeatedItem.ToString]“ Target=“[Command.Invoke]“ />
</Command>
</me:ListItem>
</Content>
</Repeater>
</Children>
</Scroller>
</Content>
</UI>
<!–UI element for each item in a list, extends the Button–>
<UI Name=“ListItem“ BaseUI=“btn:Button“>
<Properties>
<!–reference to the list’s selection–>
<code:ListSelection Name=“SelectionHolder“ ListSelection=“$Required“ />
<!–data source item (and its index) that was used to create the list item–>
<Index Name=“Index“ Index=“$Required“ />
<cor:Object Name=“Item“ Object=“$Required“ />
</Properties>
<Rules>
<!–updates the list’s selection when the list item receives keyboard/mouse focus–>
<Condition Source=“[Input.KeyFocus]“ SourceValue=“true“>
<Actions>
<Set Target=“[SelectionHolder.Index]“ Value=“[Index.Value]“ />
<Set Target=“[SelectionHolder.Item]“ Value=“[Item]“ />
</Actions>
</Condition>
</Rules>
</UI>
</Mcml>
with this changes can we set optional Scroller /Repeater Orientation , Numer of Rows, Numer of Columns, Size of the list control and the spacing of items