From 2e364df4f62841b9caea4bbae30399bce413513d Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Mon, 12 Dec 2016 18:07:35 +0100 Subject: [PATCH] YEB --- BookAStar/BookAStar/Helpers/UserHelpers.cs | 16 ++++++- .../Pages/EstimatePages/BookQueriesPage.xaml | 45 ++++++++++--------- .../EstimatePages/BookQueriesPage.xaml.cs | 4 +- .../Pages/EstimatePages/BookQueryPage.xaml | 12 +++-- .../Pages/EstimatePages/BookQueryPage.xaml.cs | 14 ++++-- .../Pages/UserProfile/AccountChooserPage.xaml | 13 +++--- .../Pages/UserProfile/DashboardPage.xaml | 4 +- BookAStar/BookAStar/Strings.Designer.cs | 36 +++++++++++++++ BookAStar/BookAStar/Strings.resx | 12 +++++ .../BookQueriesViewModel.cs | 12 +++-- .../EstimateAndBilling/BookQueryViewModel.cs | 18 +++++++- .../ViewModels/Messaging/UserViewModel.cs | 18 ++++++++ 12 files changed, 161 insertions(+), 43 deletions(-) diff --git a/BookAStar/BookAStar/Helpers/UserHelpers.cs b/BookAStar/BookAStar/Helpers/UserHelpers.cs index e3344fc2..d98a436f 100644 --- a/BookAStar/BookAStar/Helpers/UserHelpers.cs +++ b/BookAStar/BookAStar/Helpers/UserHelpers.cs @@ -21,6 +21,20 @@ namespace BookAStar.Helpers return result; } + public static ImageSource SmallAvatar(string avatarPath, string username) + { + return avatarPath == null ? + ImageSource.FromResource("BookAStar.Images.Users.icon_user.png") : + ImageSource.FromUri(new Uri($"{Constants.YavscHomeUrl}/Avatars/{username}.s.png")); + } + + public static ImageSource ExtraSmallAvatar(string avatarPath, string username) + { + return avatarPath == null ? + ImageSource.FromResource("BookAStar.Images.Users.icon_user.png") : + ImageSource.FromUri(new Uri($"{Constants.YavscHomeUrl}/Avatars/{username}.xs.png")); + } + public static HttpClient CreateJsonClient() { return CreateJsonClient(MainSettings.CurrentUser.YavscTokens.AccessToken); @@ -36,8 +50,6 @@ namespace BookAStar.Helpers return client; } - - /// /// Uploads the given stream to /// /api/fs, in order to be saved under the given file name diff --git a/BookAStar/BookAStar/Pages/EstimatePages/BookQueriesPage.xaml b/BookAStar/BookAStar/Pages/EstimatePages/BookQueriesPage.xaml index f0478691..968ed222 100644 --- a/BookAStar/BookAStar/Pages/EstimatePages/BookQueriesPage.xaml +++ b/BookAStar/BookAStar/Pages/EstimatePages/BookQueriesPage.xaml @@ -30,29 +30,34 @@ - + ItemsSource="{Binding Queries}" x:Name="list" ItemTapped="OnViewDetail" HasUnevenRows="true" + SeparatorVisibility="Default" SeparatorColor="Black"> + - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + diff --git a/BookAStar/BookAStar/Pages/EstimatePages/BookQueriesPage.xaml.cs b/BookAStar/BookAStar/Pages/EstimatePages/BookQueriesPage.xaml.cs index 56febae2..3cfb96f4 100644 --- a/BookAStar/BookAStar/Pages/EstimatePages/BookQueriesPage.xaml.cs +++ b/BookAStar/BookAStar/Pages/EstimatePages/BookQueriesPage.xaml.cs @@ -26,8 +26,8 @@ namespace BookAStar.Pages private void OnViewDetail(object sender, ItemTappedEventArgs e) { - BookQueryData data = e.Item as BookQueryData; - App.NavigationService.NavigateTo(true,data); + var item = e.Item as BookQueryViewModel; + App.NavigationService.NavigateTo(true,item); } } } diff --git a/BookAStar/BookAStar/Pages/EstimatePages/BookQueryPage.xaml b/BookAStar/BookAStar/Pages/EstimatePages/BookQueryPage.xaml index 819bdb67..fa6e5825 100644 --- a/BookAStar/BookAStar/Pages/EstimatePages/BookQueryPage.xaml +++ b/BookAStar/BookAStar/Pages/EstimatePages/BookQueryPage.xaml @@ -19,20 +19,24 @@ - + -