summaryrefslogtreecommitdiff
path: root/PagesGallery/PagesGallery/App.xaml
diff options
context:
space:
mode:
Diffstat (limited to 'PagesGallery/PagesGallery/App.xaml')
-rw-r--r--PagesGallery/PagesGallery/App.xaml74
1 files changed, 74 insertions, 0 deletions
diff --git a/PagesGallery/PagesGallery/App.xaml b/PagesGallery/PagesGallery/App.xaml
new file mode 100644
index 00000000..18a5e0f3
--- /dev/null
+++ b/PagesGallery/PagesGallery/App.xaml
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<Application xmlns="http://xamarin.com/schemas/2014/forms"
+ xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
+ xmlns:local="clr-namespace:PagesGallery"
+ xmlns:p="clr-namespace:Xamarin.Forms.Pages;assembly=Xamarin.Forms.Pages"
+ x:Class="PagesGallery.App">
+ <Application.Resources>
+ <ResourceDictionary>
+
+ <local:CapitalizationConverter x:Key="capitalizeConverter" />
+
+ <Style x:Key="EventPageStyle" TargetType="p:DataPage">
+ <Setter Property="ControlTemplate">
+ <ControlTemplate>
+ <p:ListDataPageControl />
+ </ControlTemplate>
+ </Setter>
+ </Style>
+
+ <Style Class="Speakers" ApplyToDerivedTypes="True" CanCascade="True" TargetType="p:DataPage" BasedOn="{StaticResource EventPageStyle}" />
+
+ <Style x:Key="DetailPageStyle" TargetType="p:DataPage">
+ <Setter Property="ControlTemplate">
+ <ControlTemplate>
+ <StackLayout Spacing="0">
+ <ContentPresenter />
+ <ListView ItemsSource="{TemplateBinding Data}" ItemTemplate="{TemplateBinding DefaultItemTemplate}" HasUnevenRows="true" />
+ </StackLayout>
+ </ControlTemplate>
+ </Setter>
+ </Style>
+
+ <Style TargetType="p:HeroImage">
+ <Setter Property="ControlTemplate">
+ <ControlTemplate>
+ <Grid BackgroundColor="Black" HeightRequest="300">
+ <Grid.RowDefinitions>
+ <RowDefinition Height="4*" />
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="*" />
+ </Grid.RowDefinitions>
+ <Image Grid.RowSpan="4" Source="{TemplateBinding ImageSource}" Aspect="{TemplateBinding Aspect}" Opacity="0.6" />
+ <Label Grid.Row="1" Margin="25,0,0,0" Text="{TemplateBinding Text}" FontSize="25" TextColor="White" />
+ <Label Grid.Row="2" Margin="25,0,0,0" Text="{TemplateBinding Detail}" FontSize="20" TextColor="White" />
+ </Grid>
+ </ControlTemplate>
+ </Setter>
+ </Style>
+
+ <DataTemplate x:Key="DetailCell">
+ <ViewCell IsEnabled="false">
+ <StackLayout Padding="15,5,5,5">
+ <Label Text="{Binding Name, Converter={StaticResource capitalizeConverter}}" FontSize="16" />
+ <Label Text="{Binding Value}" FontSize="14" TextColor="#444" LineBreakMode="WordWrap" />
+ </StackLayout>
+ </ViewCell>
+ </DataTemplate>
+
+ <DataTemplate x:Key="SpeakerDetailTemplate">
+ <local:EventDetailsPage Title="Speaker Details" DataSource="{Binding Value}" Style="{StaticResource DetailPageStyle}" DefaultItemTemplate="{StaticResource DetailCell}" >
+ <p:HeroImage Aspect="Fill" Text="{p:DataSourceBinding name}" Detail="{p:DataSourceBinding email}" ImageSource="{p:DataSourceBinding picture}" DataSource="{Binding Value}" />
+ </local:EventDetailsPage>
+ </DataTemplate>
+
+ <DataTemplate x:Key="EventDetailTemplate">
+ <local:EventDetailsPage Title="Event Details" DataSource="{Binding Value}" Style="{StaticResource DetailPageStyle}" DefaultItemTemplate="{StaticResource DetailCell}" >
+ <p:HeroImage Aspect="Fill" Text="{p:DataSourceBinding name}" Detail="{p:DataSourceBinding presenter}" ImageSource="{p:DataSourceBinding picture}" DataSource="{Binding Value}" />
+ </local:EventDetailsPage>
+ </DataTemplate>
+
+ </ResourceDictionary>
+ </Application.Resources>
+</Application> \ No newline at end of file