Advertisement
Guest User

Untitled

a guest
Apr 24th, 2014
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.79 KB | None | 0 0
  1. <phone:LongListSelector Name="peopleLongListSelector"
  2. ItemsSource="{Binding ComponentData}"
  3. GroupHeaderTemplate="{StaticResource LongListSelectorGroupHeaderTemmplate}"
  4. ItemTemplate="{StaticResource LongListSelectorItemTemplate}"
  5. HideEmptyGroups ="true"
  6. IsGroupingEnabled ="true"
  7. LayoutMode="List">
  8. </phone:LongListSelector>
  9.  
  10.  
  11.  
  12.  
  13. <DataTemplate x:Key="LongListSelectorGroupHeaderTemmplate">
  14. <Border Background="Transparent" Padding="5">
  15. <Border Background="{StaticResource PhoneAccentBrush}" BorderBrush="{StaticResource PhoneAccentBrush}" BorderThickness="2"
  16. Width="62" Height="62" Margin="0,0,18,0"
  17. HorizontalAlignment="Left">
  18. <TextBlock Text="{Binding Name}"
  19. Foreground="{StaticResource PhoneForegroundBrush}"
  20. FontSize="48"
  21. Padding="6"
  22. FontFamily="{StaticResource PhoneFontFamilySemiLight}"
  23. HorizontalAlignment="Left"
  24. VerticalAlignment="Center"/>
  25. </Border>
  26. </Border>
  27. </DataTemplate>
  28.  
  29. <DataTemplate x:Key="LongListSelectorItemTemplate">
  30. <StackPanel Orientation="Horizontal" Margin="4,4">
  31. <Image Width="62" Height="62" Source="{Binding Image}" VerticalAlignment="Top" Margin="0,0,15,0"/>
  32. <TextBlock Text="{Binding Name}" Style="{StaticResource PhoneTextLargeStyle}" VerticalAlignment="Center" HorizontalAlignment="Left"/>
  33. </StackPanel>
  34. </DataTemplate>
  35.  
  36. public class Component
  37. {
  38. public string Guid {get; set;}
  39. public string Name{get; set;}
  40. public Item[] Items{get; set;}
  41. }
  42.  
  43.  
  44.  
  45. public class Item
  46. {
  47. public string Title{get; set;}
  48. public string Subtitle{get; set;}
  49. public string Date{get; set;}
  50. }
  51.  
  52. public class MainLstViewModel : BaseViewModel
  53. {
  54. private Component[] ComponentData;
  55. public MainLstViewModel()
  56. {
  57. ComponentData = Proxy.GetDataAsync();
  58. }
  59. }
  60.  
  61. <phone:LongListSelector Name="peopleLongListSelector"
  62. ItemsSource="{Binding ComponentData}"
  63. GroupHeaderTemplate="{StaticResource LongListSelectorGroupHeaderTemmplate}"
  64. ItemTemplate="{StaticResource LongListSelectorItemTemplate}"
  65. HideEmptyGroups ="true"
  66. IsGroupingEnabled ="true"
  67. LayoutMode="List">
  68. </phone:LongListSelector>
  69. <DataTemplate x:Key="LongListSelectorGroupHeaderTemmplate">
  70. <Border Background="Transparent" Padding="5">
  71. <Border Background="{StaticResource PhoneAccentBrush}" BorderBrush="{StaticResource PhoneAccentBrush}" BorderThickness="2"
  72. Width="62" Height="62" Margin="0,0,18,0"
  73. HorizontalAlignment="Left">
  74. <TextBlock Text="{Binding Name}"
  75. Foreground="{StaticResource PhoneForegroundBrush}"
  76. FontSize="48"
  77. Padding="6"
  78. FontFamily="{StaticResource PhoneFontFamilySemiLight}"
  79. HorizontalAlignment="Left"
  80. VerticalAlignment="Center"/>
  81. </Border>
  82. </Border>
  83. </DataTemplate>
  84. <DataTemplate x:Key="LongListSelectorItemTemplate">
  85. <StackPanel Orientation="Horizontal" Margin="4,4">
  86.  
  87. <TextBlock Text="{Binding Name}" Style="{StaticResource PhoneTextLargeStyle}" VerticalAlignment="Center" HorizontalAlignment="Left"/>
  88. <TextBlock Text="{Binding Subtitle}" Style="{StaticResource PhoneTextLargeStyle}" VerticalAlignment="Center" HorizontalAlignment="Left"/>
  89. <TextBlock Text="{Binding Date}" Style="{StaticResource PhoneTextLargeStyle}" VerticalAlignment="Center" HorizontalAlignment="Left"/>
  90. </StackPanel>
  91. </DataTemplate>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement