Skip to content

Commit ca46125

Browse files
committed
Add campaign view template
1 parent f0b2845 commit ca46125

2 files changed

Lines changed: 95 additions & 0 deletions

File tree

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<ContentView
3+
xmlns="http://xamarin.com/schemas/2014/forms"
4+
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
5+
xmlns:ffimageloading="clr-namespace:FFImageLoading.Forms;assembly=FFImageLoading.Forms"
6+
xmlns:controls="clr-namespace:eShopOnContainers.Core.Controls;assembly=eShopOnContainers.Core"
7+
x:Class="eShopOnContainers.Core.Views.Templates.CampaignTemplate">
8+
<ContentView.Resources>
9+
<ResourceDictionary>
10+
11+
<Style x:Key="CampaignNameStyle"
12+
TargetType="{x:Type Label}">
13+
<Setter Property="FontFamily"
14+
Value="{StaticResource MontserratRegular}" />
15+
<Setter Property="FontSize"
16+
Value="{StaticResource LargeSize}" />
17+
<Setter Property="HorizontalOptions"
18+
Value="Center" />
19+
<Setter Property="Margin"
20+
Value="0, 12, 0, 6" />
21+
</Style>
22+
23+
<Style x:Key="MoreDetailsButtonStyle"
24+
TargetType="{x:Type Grid}">
25+
<Setter Property="HeightRequest"
26+
Value="42" />
27+
<Setter Property="WidthRequest"
28+
Value="42" />
29+
<Setter Property="HorizontalOptions"
30+
Value="Center" />
31+
<Setter Property="VerticalOptions"
32+
Value="End" />
33+
<Setter Property="Margin"
34+
Value="0,0,0,24" />
35+
</Style>
36+
37+
<Style x:Key="AddImageStyle"
38+
TargetType="{x:Type Image}">
39+
<Setter Property="HeightRequest"
40+
Value="24" />
41+
<Setter Property="WidthRequest"
42+
Value="24" />
43+
</Style>
44+
45+
</ResourceDictionary>
46+
</ContentView.Resources>
47+
<ContentView.Content>
48+
<Grid
49+
BackgroundColor="{StaticResource BackgroundColor}"
50+
Padding="0"
51+
Margin="0">
52+
<Grid.RowDefinitions>
53+
<RowDefinition Height="250" />
54+
<RowDefinition Height="Auto" />
55+
</Grid.RowDefinitions>
56+
<!-- IMAGE -->
57+
<ffimageloading:CachedImage
58+
Grid.Row="0"
59+
Source="{Binding PictureUri}"
60+
Aspect="AspectFill">
61+
<ffimageloading:CachedImage.LoadingPlaceholder>
62+
<OnPlatform
63+
x:TypeArguments="ImageSource"
64+
iOS="default_campaign"
65+
Android="default_campaign"
66+
WinPhone="Assets/default_campaign.png"/>
67+
</ffimageloading:CachedImage.LoadingPlaceholder>
68+
<ffimageloading:CachedImage.ErrorPlaceholder>
69+
<OnPlatform
70+
x:TypeArguments="ImageSource"
71+
iOS="noimage"
72+
Android="noimage"
73+
WinPhone="Assets/noimage.png"/>
74+
</ffimageloading:CachedImage.ErrorPlaceholder>
75+
</ffimageloading:CachedImage>
76+
<!-- NAME -->
77+
<Label
78+
Grid.Row="1"
79+
Text="{Binding Name, Converter={StaticResource ToUpperConverter}}"
80+
Style="{StaticResource CampaignNameStyle}"/>
81+
</Grid>
82+
</ContentView.Content>
83+
</ContentView>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
using Xamarin.Forms;
2+
3+
namespace eShopOnContainers.Core.Views.Templates
4+
{
5+
public partial class CampaignTemplate : ContentView
6+
{
7+
public CampaignTemplate()
8+
{
9+
InitializeComponent();
10+
}
11+
}
12+
}

0 commit comments

Comments
 (0)