|
6 | 6 | xmlns:models="clr-namespace:ArcGIS.Samples.Shared.Models"
|
7 | 7 | xmlns:viewModels="clr-namespace:ArcGIS.ViewModels"
|
8 | 8 | Title="{Binding SelectedCategory}"
|
9 |
| - Shell.FlyoutBehavior="Flyout" |
10 |
| - x:DataType="viewModels:CategoryViewModel"> |
| 9 | + x:DataType="viewModels:CategoryViewModel" |
| 10 | + Shell.FlyoutBehavior="Flyout"> |
| 11 | + |
| 12 | + <ContentPage.Resources> |
| 13 | + <converters:SampleToBitmapConverter x:Key="SampleToBitmapConverter" /> |
| 14 | + <converters:BoolToFavoriteGlyphConverter x:Key="BoolToFavoriteGlyphConverter" /> |
| 15 | + <Style x:Key="AndroidStyle" TargetType="CollectionView"> |
| 16 | + <Setter Property="VisualStateManager.VisualStateGroups"> |
| 17 | + <VisualStateGroupList> |
| 18 | + <VisualStateGroup> |
| 19 | + <VisualState x:Name="Horizontal"> |
| 20 | + <VisualState.StateTriggers> |
| 21 | + <OrientationStateTrigger Orientation="Landscape" /> |
| 22 | + </VisualState.StateTriggers> |
| 23 | + <VisualState.Setters> |
| 24 | + <Setter Property="ItemsLayout" Value="{OnIdiom Phone='VerticalGrid, 2', Tablet='VerticalGrid, 3'}" /> |
| 25 | + </VisualState.Setters> |
| 26 | + </VisualState> |
| 27 | + <VisualState x:Name="Vertical"> |
| 28 | + <VisualState.StateTriggers> |
| 29 | + <OrientationStateTrigger Orientation="Portrait" /> |
| 30 | + </VisualState.StateTriggers> |
| 31 | + <VisualState.Setters> |
| 32 | + <Setter Property="ItemsLayout" Value="{OnIdiom Phone='VerticalGrid, 1', Tablet='VerticalGrid, 2'}" /> |
| 33 | + </VisualState.Setters> |
| 34 | + </VisualState> |
| 35 | + </VisualStateGroup> |
| 36 | + </VisualStateGroupList> |
| 37 | + </Setter> |
| 38 | + </Style> |
| 39 | + </ContentPage.Resources> |
11 | 40 |
|
12 | 41 | <ContentPage.ToolbarItems>
|
13 | 42 | <ToolbarItem Clicked="SearchClicked"
|
|
20 | 49 | IconImageSource="feedback.png"
|
21 | 50 | Text="Feedback" />
|
22 | 51 | </ContentPage.ToolbarItems>
|
23 |
| - <ContentPage.Resources> |
24 |
| - <converters:SampleToBitmapConverter x:Key="SampleToBitmapConverter" /> |
25 |
| - <converters:BoolToFavoriteGlyphConverter x:Key="BoolToFavoriteGlyphConverter" /> |
26 |
| - </ContentPage.Resources> |
| 52 | + |
27 | 53 | <CollectionView x:Name="SamplesCollection"
|
28 | 54 | BackgroundColor="Transparent"
|
29 | 55 | ItemsSource="{Binding SamplesItems}">
|
30 | 56 | <CollectionView.ItemsLayout>
|
31 | 57 | <GridItemsLayout x:Name="SamplesGridItemsLayout"
|
32 | 58 | HorizontalItemSpacing="5"
|
33 | 59 | Orientation="Vertical"
|
34 |
| - Span="{OnPlatform Default=4, |
35 |
| - iOS=1, |
36 |
| - Android=1}" |
37 | 60 | VerticalItemSpacing="5" />
|
38 | 61 | </CollectionView.ItemsLayout>
|
39 | 62 | <CollectionView.ItemTemplate>
|
40 | 63 | <DataTemplate x:DataType="viewModels:SampleViewModel">
|
41 |
| - <Border StrokeThickness="{OnPlatform Default=0, Android=1}"> |
| 64 | + <Border Margin="{OnPlatform Default=0, Android=5}" StrokeThickness="{OnPlatform Default=0, Android=1}"> |
42 | 65 | <Border.GestureRecognizers>
|
43 | 66 | <PointerGestureRecognizer PointerEntered="PointerGestureRecognizer_PointerEntered" />
|
44 | 67 | <PointerGestureRecognizer PointerExited="PointerGestureRecognizer_PointerExited" />
|
|
58 | 81 |
|
59 | 82 | <Button x:Name="FavoriteButton"
|
60 | 83 | Grid.Row="0"
|
| 84 | + Margin="{OnPlatform Default=0, |
| 85 | + WinUI='-1'}" |
61 | 86 | Padding="2"
|
62 | 87 | Background="#A52F2F2F"
|
63 | 88 | Command="{Binding Source={RelativeSource AncestorType={x:Type viewModels:CategoryViewModel}}, Path=UpdateFavoriteCommand}"
|
|
0 commit comments