AppListView.xaml 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. <localView:UserControlBase x:Class="VocabManager.View.AppListView"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  5. xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
  6. xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions"
  7. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  8. mc:Ignorable="d"
  9. FontFamily="{StaticResource PhoneFontFamilyNormal}"
  10. FontSize="{StaticResource PhoneFontSizeNormal}"
  11. Foreground="{StaticResource PhoneForegroundBrush}"
  12. xmlns:local="clr-namespace:VocabManager"
  13. xmlns:localView="clr-namespace:VocabManager.View"
  14. d:DesignHeight="800" d:DesignWidth="480">
  15. <Grid x:Name="LayoutRoot">
  16. <Grid.Resources>
  17. <Style TargetType="ListBoxItem">
  18. <Setter Property="Padding" Value="3" />
  19. <Setter Property="HorizontalContentAlignment" Value="Stretch" />
  20. <Setter Property="VerticalContentAlignment" Value="Top" />
  21. <Setter Property="Background" Value="Transparent" />
  22. <Setter Property="BorderThickness" Value="1"/>
  23. <Setter Property="TabNavigation" Value="Local" />
  24. <Setter Property="Template">
  25. <Setter.Value>
  26. <ControlTemplate TargetType="ListBoxItem">
  27. <Grid Background="{TemplateBinding Background}">
  28. <VisualStateManager.VisualStateGroups>
  29. <VisualStateGroup x:Name="CommonStates">
  30. <VisualState x:Name="Normal" />
  31. <VisualState x:Name="MouseOver">
  32. <Storyboard>
  33. <DoubleAnimation Storyboard.TargetName="fillColor" Storyboard.TargetProperty="Opacity" Duration="0" To=".35"/>
  34. </Storyboard>
  35. </VisualState>
  36. <VisualState x:Name="Disabled">
  37. <Storyboard>
  38. <DoubleAnimation Storyboard.TargetName="contentPresenter" Storyboard.TargetProperty="Opacity" Duration="0" To=".55" />
  39. </Storyboard>
  40. </VisualState>
  41. </VisualStateGroup>
  42. <VisualStateGroup x:Name="SelectionStates">
  43. <VisualState x:Name="Unselected" />
  44. <VisualState x:Name="Selected">
  45. <Storyboard>
  46. <DoubleAnimation Storyboard.TargetName="fillColor2" Storyboard.TargetProperty="Opacity" Duration="0" To=".75"/>
  47. </Storyboard>
  48. </VisualState>
  49. </VisualStateGroup>
  50. <VisualStateGroup x:Name="FocusStates">
  51. <VisualState x:Name="Focused">
  52. <Storyboard>
  53. <ObjectAnimationUsingKeyFrames Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Visibility" Duration="0">
  54. <DiscreteObjectKeyFrame KeyTime="0">
  55. <DiscreteObjectKeyFrame.Value>
  56. <Visibility>Visible</Visibility>
  57. </DiscreteObjectKeyFrame.Value>
  58. </DiscreteObjectKeyFrame>
  59. </ObjectAnimationUsingKeyFrames>
  60. </Storyboard>
  61. </VisualState>
  62. <VisualState x:Name="Unfocused"/>
  63. </VisualStateGroup>
  64. </VisualStateManager.VisualStateGroups>
  65. <Rectangle x:Name="fillColor" Opacity="0" Fill="#FFBADDE9" IsHitTestVisible="False" RadiusX="1" RadiusY="1"/>
  66. <Rectangle x:Name="fillColor2" Opacity="0" Fill="#FFBADDE9" IsHitTestVisible="False" RadiusX="1" RadiusY="1"/>
  67. <ContentPresenter
  68. x:Name="contentPresenter"
  69. Content="{TemplateBinding Content}"
  70. ContentTemplate="{TemplateBinding ContentTemplate}"
  71. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  72. Margin="{TemplateBinding Padding}"/>
  73. <Rectangle x:Name="FocusVisualElement" Stroke="#FF6DBDD1" StrokeThickness="1" Visibility="Collapsed" RadiusX="1" RadiusY="1" />
  74. </Grid>
  75. </ControlTemplate>
  76. </Setter.Value>
  77. </Setter>
  78. </Style>
  79. </Grid.Resources>
  80. <Grid.RowDefinitions>
  81. <RowDefinition Height="auto"></RowDefinition>
  82. <RowDefinition></RowDefinition>
  83. </Grid.RowDefinitions>
  84. <ContentControl Style="{StaticResource TitleStyle}" Content="Decks"></ContentControl>
  85. <ListBox Grid.Row="1" ItemsSource="{Binding Path=Decks}" HorizontalAlignment="Stretch"
  86. VerticalContentAlignment="Stretch"
  87. HorizontalContentAlignment="Stretch" >
  88. <ListBox.ItemTemplate>
  89. <DataTemplate>
  90. <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch" x:Name="ContentContainer">
  91. <Border HorizontalAlignment="Stretch" VerticalAlignment="Stretch" BorderBrush="Black" Margin="1" Background="#FF34577E" Opacity="0.3" ></Border>
  92. <Border HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="8" BorderBrush="white" BorderThickness="1" Background="Transparent" CornerRadius="8" >
  93. <StackPanel Orientation="Vertical">
  94. <TextBlock TextWrapping="Wrap" HorizontalAlignment="Center" Text="{Binding Path=Name}" FontSize="30" Foreground="White" />
  95. <TextBlock Padding="4" TextWrapping="Wrap" Name="descriptionTB" HorizontalAlignment="Left" Text="{Binding Path=Description}"
  96. FontSize="20" Foreground="Black" VerticalAlignment="Center" >
  97. </TextBlock>
  98. </StackPanel>
  99. </Border>
  100. <!--<Border BorderThickness="3" BorderBrush="LightBlue" Background="DarkGray" Padding="2">
  101. <StackPanel>
  102. <TextBlock Text="{Binding Path=Name}"></TextBlock>
  103. <TextBlock Text="{Binding Path=Description}"></TextBlock>
  104. </StackPanel>
  105. </Border>-->
  106. </Grid>
  107. </DataTemplate>
  108. </ListBox.ItemTemplate>
  109. </ListBox>
  110. </Grid>
  111. </localView:UserControlBase>