Advertisement
Guest User

Untitled

a guest
Jul 18th, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.80 KB | None | 0 0
  1. <ContentPage.Resources>
  2. <Style x:Key="BasicLabel" TargetType="Label">
  3. <Setter Property="FontSize" Value="Micro"/>
  4. <Setter Property="TextColor" Value="Black"/>
  5. <Setter Property="VerticalOptions" Value="Center"/>
  6. </Style>
  7.  
  8. <Style x:Key="StatLabel" BasedOn="{StaticResource BasicLabel}" TargetType="Label">
  9. <Setter Property="HorizontalOptions" Value="Start"/>
  10. </Style>
  11.  
  12. <Style x:Key="StatValueLabel" BasedOn="{StaticResource BasicLabel}" TargetType="Label">
  13. <Setter Property="HorizontalOptions" Value="End"/>
  14. <Setter Property="Margin" Value="0,0,2,0"/>
  15. </Style>
  16.  
  17. <Style x:Key="StatValueBox" TargetType="BoxView">
  18. <Setter Property="Margin" Value="1"/>
  19. <Setter Property="HeightRequest" Value="10"/>
  20. <Setter Property="VerticalOptions" Value="Center"/>
  21. <Setter Property="HorizontalOptions" Value="Start"/>
  22. </Style>
  23. </ContentPage.Resources>
  24.  
  25. <ContentPage.Content>
  26. <StackLayout Margin="20">
  27. <ActivityIndicator Color="Blue"
  28. IsVisible="{Binding IsLoading}"
  29. IsRunning="{Binding IsLoading}"
  30. IsEnabled="{Binding IsLoading}"/>
  31.  
  32. <CollectionView ItemsSource="{Binding PokemonList}" x:Name="collectionView">
  33. <CollectionView.ItemTemplate>
  34. <DataTemplate>
  35. <Grid VerticalOptions="Center" Padding="10,10,0,10">
  36. <Grid.ColumnDefinitions>
  37. <ColumnDefinition Width="Auto"/>
  38. <ColumnDefinition Width="Auto"/>
  39. </Grid.ColumnDefinitions>
  40. <Grid.RowDefinitions>
  41. <RowDefinition Height="130"/>
  42. </Grid.RowDefinitions>
  43. <Frame HasShadow="True" Padding="5">
  44. <Grid BackgroundColor="#F9FFBC">
  45. <Grid.RowDefinitions>
  46. <RowDefinition Height="Auto"/>
  47. <RowDefinition Height="Auto"/>
  48. <RowDefinition Height="Auto"/>
  49. <RowDefinition Height="Auto"/>
  50. <RowDefinition Height="Auto"/>
  51. <RowDefinition Height="Auto"/>
  52. </Grid.RowDefinitions>
  53. <Grid.ColumnDefinitions>
  54. <ColumnDefinition Width="Auto"/>
  55. <ColumnDefinition Width="60"/>
  56. <ColumnDefinition Width="100"/>
  57. <ColumnDefinition Width="20"/>
  58. </Grid.ColumnDefinitions>
  59.  
  60. <Image Grid.Row="0"
  61. Grid.Column="0"
  62. Grid.RowSpan="4"
  63. Source="{Binding ImageURL}"
  64. WidthRequest="60"
  65. HeightRequest="60"
  66. HorizontalOptions="Center"
  67. Aspect="AspectFit" />
  68.  
  69. <Label Grid.Row="4"
  70. Grid.Column="0"
  71. Text="{Binding name.english}"
  72. FontAttributes="Bold"
  73. HorizontalOptions="Center"
  74. FontSize="Micro"
  75. TextColor="Blue"/>
  76.  
  77. <Label Grid.Row="5"
  78. Grid.Column="0"
  79. Text="{Binding Types}"
  80. FontAttributes="Italic"
  81. HorizontalOptions="Center"
  82. TextColor="#606060"
  83. FontSize="Micro"
  84. VerticalOptions="Start"/>
  85.  
  86. <Label Grid.Row="0"
  87. Grid.Column="1"
  88. Text="HP"
  89. Style="{StaticResource StatLabel}"/>
  90.  
  91. <BoxView Grid.Row="0"
  92. Grid.Column="2"
  93. Color="#A5FF82"
  94. WidthRequest="{Binding HP}"
  95. Style="{StaticResource StatValueBox}"/>
  96.  
  97. <Label Grid.Row="0"
  98. Grid.Column="3"
  99. Text="{Binding _base.HP}"
  100. Style="{StaticResource StatValueLabel}"/>
  101.  
  102. <Label Grid.Row="1"
  103. Grid.Column="1"
  104. Text="Attack"
  105. Style="{StaticResource StatLabel}"/>
  106.  
  107. <BoxView Grid.Row="1"
  108. Grid.Column="2"
  109. Color="#A32F2F"
  110. WidthRequest="{Binding Attack}"
  111. Style="{StaticResource StatValueBox}"/>
  112.  
  113. <Label Grid.Row="1"
  114. Grid.Column="3"
  115. Text="{Binding _base.Attack}"
  116. Style="{StaticResource StatValueLabel}"/>
  117.  
  118. <Label Grid.Row="2"
  119. Grid.Column="1"
  120. Text="Defense"
  121. Style="{StaticResource StatLabel}"/>
  122.  
  123. <BoxView Grid.Row="2"
  124. Grid.Column="2"
  125. Color="#47B7C1"
  126. WidthRequest="{Binding Defense}"
  127. Style="{StaticResource StatValueBox}"/>
  128.  
  129. <Label Grid.Row="2"
  130. Grid.Column="3"
  131. Text="{Binding _base.Defense}"
  132. Style="{StaticResource StatValueLabel}"/>
  133.  
  134. <Label Grid.Row="3"
  135. Grid.Column="1"
  136. Text="Sp. Attack"
  137. Style="{StaticResource StatLabel}"/>
  138.  
  139. <BoxView Grid.Row="3"
  140. Grid.Column="2"
  141. Color="#EACA15"
  142. WidthRequest="{Binding SpAttack}"
  143. Style="{StaticResource StatValueBox}"/>
  144.  
  145. <Label Grid.Row="3"
  146. Grid.Column="3"
  147. Text="{Binding _base.SpAttack}"
  148. Style="{StaticResource StatValueLabel}"/>
  149.  
  150. <Label Grid.Row="4"
  151. Grid.Column="1"
  152. Text="Sp. Defense"
  153. Style="{StaticResource StatLabel}"/>
  154.  
  155. <BoxView Grid.Row="4"
  156. Grid.Column="2"
  157. Color="#FF6811"
  158. WidthRequest="{Binding SpDefense}"
  159. Style="{StaticResource StatValueBox}"/>
  160.  
  161. <Label Grid.Row="4"
  162. Grid.Column="3"
  163. Text="{Binding _base.SpDefense}"
  164. Style="{StaticResource StatValueLabel}"/>
  165.  
  166. <Label Grid.Row="5"
  167. Grid.Column="1"
  168. Text="Speed"
  169. Style="{StaticResource StatLabel}"/>
  170.  
  171. <BoxView Grid.Row="5"
  172. Grid.Column="2"
  173. Color="#D693B4"
  174. WidthRequest="{Binding Speed}"
  175. Style="{StaticResource StatValueBox}"/>
  176.  
  177. <Label Grid.Row="5"
  178. Grid.Column="3"
  179. Text="{Binding _base.Speed}"
  180. Style="{StaticResource StatValueLabel}"/>
  181.  
  182. </Grid>
  183. </Frame>
  184. </Grid>
  185. </DataTemplate>
  186. </CollectionView.ItemTemplate>
  187. </CollectionView>
  188. </StackLayout>
  189.  
  190. </ContentPage.Content>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement