Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
174 lines (162 sloc) 9 KB
<!-- Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. -->
<!-- See LICENSE in the project root for license information -->
<views:MvxWindowsPage
x:Class="XamarinNativePropertyManager.UWP.Views.GroupsView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:views="using:MvvmCross.WindowsUWP.Views"
xmlns:controls="using:XamarinNativePropertyManager.UWP.Controls"
mc:Ignorable="d">
<views:MvxWindowsPage.Transitions>
<TransitionCollection>
<NavigationThemeTransition>
<NavigationThemeTransition.DefaultNavigationTransitionInfo>
<ContinuumNavigationTransitionInfo/>
</NavigationThemeTransition.DefaultNavigationTransitionInfo>
</NavigationThemeTransition>
</TransitionCollection>
</views:MvxWindowsPage.Transitions>
<views:MvxWindowsPage.Resources>
<Style x:Key="ListViewStyle" TargetType="ListView">
<Setter Property="IsItemClickEnabled" Value="True"/>
<Setter Property="VerticalAlignment" Value="Top"/>
<Setter Property="SelectionMode" Value="None"/>
<Setter Property="Margin" Value="0,70,0,0"/>
<Setter Property="IsMultiSelectCheckBoxEnabled" Value="False"/>
<Setter Property="ItemContainerStyle">
<Setter.Value>
<Style TargetType="ListViewItem">
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
<Setter Property="Margin" Value="0"/>
<Setter Property="Padding" Value="0"/>
</Style>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="GridViewStyle" TargetType="GridView">
<Setter Property="IsItemClickEnabled" Value="True"/>
<Setter Property="SelectionMode" Value="None"/>
<Setter Property="VerticalAlignment" Value="Top"/>
<Setter Property="Margin" Value="0,155,0,0"/>
<Setter Property="IsMultiSelectCheckBoxEnabled" Value="False"/>
<Setter Property="ItemContainerStyle">
<Setter.Value>
<Style TargetType="GridViewItem">
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
<Setter Property="Margin" Value="0"/>
<Setter Property="Padding" Value="0"/>
</Style>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="TitleTextBlockStyle" TargetType="TextBlock"
BasedOn="{StaticResource PageTitleTextBlock}">
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="VerticalAlignment" Value="Top"/>
<Setter Property="Margin" Value="0,15,0,0"/>
<Setter Property="FontWeight" Value="Light"/>
<Setter Property="FontSize" Value="24"/>
</Style>
</views:MvxWindowsPage.Resources>
<Grid Style="{StaticResource PageRootGridStyle}">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup>
<VisualState x:Name="Normal">
<VisualState.Setters>
<Setter Target="SearchBox.HorizontalAlignment" Value="Center"></Setter>
<Setter Target="SearchBox.Width" Value="340"></Setter>
<Setter Target="SearchBox.Margin" Value="0,75,0,0"></Setter>
<Setter Target="SlimGridView.Visibility" Value="Collapsed"></Setter>
<Setter Target="NormalGridView.Visibility" Value="Visible"></Setter>
<Setter Target="TitleTextBlock.Visibility" Value="Visible"></Setter>
<Setter Target="AddPropertyButton.Visibility" Value="Visible"></Setter>
</VisualState.Setters>
<VisualState.StateTriggers>
<AdaptiveTrigger MinWindowWidth="700"></AdaptiveTrigger>
</VisualState.StateTriggers>
</VisualState>
<VisualState x:Name="Slim">
<VisualState.Setters>
<Setter Target="SearchBox.HorizontalAlignment" Value="Stretch"></Setter>
<Setter Target="SlimGridView.Visibility" Value="Visible"></Setter>
<Setter Target="NormalGridView.Visibility" Value="Collapsed"></Setter>
<Setter Target="TitleTextBlock.Visibility" Value="Collapsed"></Setter>
<Setter Target="AddPropertyButton.Visibility" Value="Collapsed"></Setter>
</VisualState.Setters>
<VisualState.StateTriggers>
<AdaptiveTrigger MinWindowWidth="0"></AdaptiveTrigger>
</VisualState.StateTriggers>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<!--SearchBox-->
<SearchBox x:Name="SearchBox" HorizontalAlignment="Stretch"
VerticalAlignment="Top" Margin="15,20,15,0" PlaceholderText="Find a property"
QueryText="{Binding Query, Mode=TwoWay}" Style="{StaticResource AccentSearchBoxStyle}"
QuerySubmitted="OnQuerySubmitted"/>
<!--Slim Grid View-->
<ListView x:Name="SlimGridView" Grid.Row="1" ItemsSource="{Binding FilteredGroups}"
Style="{StaticResource ListViewStyle}"
ItemClick="OnItemClick">
<ListView.ItemTemplate>
<DataTemplate>
<controls:TileListViewItem Header="{Binding DisplayName}"
Text="{Binding Mail}" Icon="&#xE913;" IconSize="26"
TileBackground="{StaticResource AccentColorBrush}"
TileForeground="White"
IsHitTestVisible="False"/>
</DataTemplate>
</ListView.ItemTemplate>
<ListView.HeaderTemplate>
<DataTemplate>
<controls:TileListViewItem Header="Add a property"
Icon="&#xE948;" IconSize="18"
TileBackground="LightGray"
TileForeground="Black"
Tapped="OnAddPropertyItemTapped"/>
</DataTemplate>
</ListView.HeaderTemplate>
<ListView.ItemsPanel>
<ItemsPanelTemplate>
<ItemsStackPanel Orientation="Vertical" HorizontalAlignment="Stretch"/>
</ItemsPanelTemplate>
</ListView.ItemsPanel>
</ListView>
<TextBlock x:Name="TitleTextBlock" Style="{StaticResource TitleTextBlockStyle}"
Text="Property Manager"/>
<controls:PointerTextBlock x:Name="AddPropertyButton" Text="Add a property" Foreground="{StaticResource AccentColorBrush}"
Margin="0,125,0,0" Tapped="OnAddPropertyItemTapped"
HorizontalAlignment="Center"
VerticalAlignment="Top"/>
<!--Normal Grid View-->
<GridView x:Name="NormalGridView" ItemsSource="{Binding FilteredGroups}"
Style="{StaticResource GridViewStyle}"
ItemClick="OnItemClick">
<GridView.ItemTemplate>
<DataTemplate>
<Grid Width="175" Height="175" Margin="15">
<StackPanel Orientation="Vertical"
HorizontalAlignment="Center"
VerticalAlignment="Center">
<TextBlock Text="&#xE913;"
Style="{StaticResource GridIconTextBlock}"
Margin="0,0,0,10"/>
<TextBlock Text="{Binding DisplayName}"
Style="{StaticResource CenteredBodyTextBlock}"/>
<TextBlock Text="{Binding Mail}"
Style="{StaticResource CenteredFadedBodyTextBlock}"/>
</StackPanel>
</Grid>
</DataTemplate>
</GridView.ItemTemplate>
<GridView.ItemsPanel>
<ItemsPanelTemplate>
<ItemsWrapGrid Orientation="Horizontal" VerticalAlignment="Center"
HorizontalAlignment="Center" MaximumRowsOrColumns="4"/>
</ItemsPanelTemplate>
</GridView.ItemsPanel>
</GridView>
</Grid>
</views:MvxWindowsPage>