fix basic bindings
continuous-integration/drone/push Build is passing Details

master
Maxime BATISTA 2 years ago
parent 00056c4aa2
commit 7777304ef3

@ -25,7 +25,9 @@
HeightRequest="65"/>
</Border>
<Label Style="{StaticResource h1}" x:Name="ProfilePictureName"/>
<Label
Style="{StaticResource h1}"
Text="{Binding User.Name}"/>
</FlexLayout>
<Grid
ColumnDefinitions="*,Auto"
@ -89,8 +91,7 @@
JustifyContent="SpaceBetween"
AlignItems="Center"
Margin="20,0,20,20"
HeightRequest="30"
>
HeightRequest="30">
<Label
Text="Recommended for you"
Style="{StaticResource h2}"/>

@ -7,15 +7,16 @@ using LocalEndpoint;
public partial class HomePage : ContentPage
{
public HomePage(Account account, IUserNotifier notifier, IEndpoint endpoint)
{
InitializeComponent();
InitializeComponent();
BindingContext = account;
IRecipesService service = endpoint.RecipesService;
IAccountRecipesPreferences preferences = service.GetPreferencesOf(account);
//TODO this code can be factorised
void PushRecipe(Layout layout, RecipeInfo info)
{
layout.Children.Add(new RecipeView(info, () =>
@ -29,7 +30,6 @@ public partial class HomePage : ContentPage
preferences.GetRecommendedRecipes().ForEach(recipe => PushRecipe(RecommendedList, recipe));
ProfilePictureImage.Source = ImageSource.FromUri(account.User.ProfilePicture);
ProfilePictureName.Text = account.User.Name;
}

@ -20,6 +20,7 @@
<Label
x:Name="ProfileName"
Text="{Binding Account.User.Name}"
Grid.Column="1"
FontSize="24"
VerticalTextAlignment="Center"

@ -7,12 +7,14 @@ public partial class MorePage : ContentPage
{
private readonly MorePageController controller;
private Account Account { get; init; }
public MorePage(Account account, MorePageController controller)
{
Account = account;
BindingContext = this;
InitializeComponent();
ProfileImage.Source = ImageSource.FromUri(account.User.ProfilePicture);
ProfileName.Text = account.User.Name;
this.controller = controller;
}

@ -50,9 +50,7 @@
HorizontalOptions="Center"
Stroke="{StaticResource BackgroundPrimary}"
BackgroundColor="{StaticResource BackgroundSecondary}">
<ImageButton
Grid.Row="0"
Source="default_profile_picture.png"/>
<ImageButton x:Name="ProfilePicture"/>
</Border>
<Label
@ -60,7 +58,7 @@
FontSize="30"
HorizontalOptions="Center"
TextColor="{StaticResource TextColorPrimary}"
Text="%Profile_Name%"
Text="{Binding Account.User.Name}"
FontFamily="PoppinsBold"/>
<Label
Grid.Row="2"
@ -88,7 +86,7 @@
Style="{StaticResource SecondaryBorderShadow}">
<Entry
Style="{StaticResource UserInput}"
Text="%Profile_Name%"
Text="{Binding User.Name}"
Placeholder="Place your name here"/>
</Border>
@ -103,7 +101,7 @@
Style="{StaticResource SecondaryBorderShadow}">
<Entry
Style="{StaticResource UserInput}"
Text="%Profile_Mail%"
Text="{Binding Email}"
Placeholder="Place your email address here"/>
</Border>
<Border
@ -118,9 +116,6 @@
Text="Change My Password"
Clicked="ChangeMyPasswordClicked"/>
</Border>
</Grid>

@ -4,9 +4,14 @@ namespace ShoopNCook.Pages;
public partial class ProfilePage : ContentPage
{
public ProfilePage(Account account)
{
BindingContext = account;
InitializeComponent();
ProfilePicture.Source = ImageSource.FromUri(account.User.ProfilePicture);
}
private async void OnBackButtonClicked(object sender, EventArgs e)
{

@ -63,8 +63,8 @@
<Label
Style="{StaticResource Small}"
Text="{Binding Recipe.Info.CookTimeMins, StringFormat='Cooking time: {0} mins'}"/>
<!--Energy-->
<!--Energy-->
<Label
Style="{StaticResource Small}"
Text="{Binding Recipe.Info.CalPerPers, StringFormat='Energy: {0}/pers'}"/>

Loading…
Cancel
Save