Added IdentityServer integration
Updated Basket service
This commit is contained in:
parent
42f3537441
commit
48a727539b
@ -0,0 +1,49 @@
|
||||
using System.Windows.Input;
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace eShopOnContainers.Core.Behaviors
|
||||
{
|
||||
public class WebViewNavigationBehavior : Behavior<WebView>
|
||||
{
|
||||
private VisualElement _element;
|
||||
|
||||
public static readonly BindableProperty NavigateCommandProperty =
|
||||
BindableProperty.Create("NavigateCommand", typeof(ICommand),
|
||||
typeof(WebViewNavigationBehavior), default(ICommand),
|
||||
BindingMode.OneWay, null);
|
||||
|
||||
public ICommand NavigateCommand
|
||||
{
|
||||
get { return (ICommand)GetValue(NavigateCommandProperty); }
|
||||
set { SetValue(NavigateCommandProperty, value); }
|
||||
}
|
||||
|
||||
protected override void OnAttachedTo(WebView bindable)
|
||||
{
|
||||
_element = bindable;
|
||||
bindable.Navigating += OnWebViewNavigating;
|
||||
bindable.BindingContextChanged += OnBindingContextChanged;
|
||||
}
|
||||
|
||||
protected override void OnDetachingFrom(WebView bindable)
|
||||
{
|
||||
_element = null;
|
||||
BindingContext = null;
|
||||
bindable.Navigating -= OnWebViewNavigating;
|
||||
bindable.BindingContextChanged -= OnBindingContextChanged;
|
||||
}
|
||||
|
||||
private void OnBindingContextChanged(object sender, System.EventArgs e)
|
||||
{
|
||||
BindingContext = _element?.BindingContext;
|
||||
}
|
||||
|
||||
private void OnWebViewNavigating(object sender, WebNavigatingEventArgs e)
|
||||
{
|
||||
if (NavigateCommand != null && NavigateCommand.CanExecute(e.Url))
|
||||
{
|
||||
NavigateCommand.Execute(e.Url);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,11 +1,53 @@
|
||||
namespace eShopOnContainers.Core
|
||||
{
|
||||
public static class GlobalSetting
|
||||
public class GlobalSetting
|
||||
{
|
||||
public const string RegisterWebsite = "http://104.40.62.65/Account/Register";
|
||||
private string _baseEndpoint;
|
||||
private static readonly GlobalSetting _instance = new GlobalSetting();
|
||||
|
||||
public const string CatalogEndpoint = "http://104.40.62.65:5101/";
|
||||
public GlobalSetting()
|
||||
{
|
||||
BaseEndpoint = "http://104.40.62.65";
|
||||
}
|
||||
|
||||
public const string BasketEndpoint = "http://104.40.62.65:5103/";
|
||||
public static GlobalSetting Instance
|
||||
{
|
||||
get { return _instance; }
|
||||
}
|
||||
|
||||
public string BaseEndpoint
|
||||
{
|
||||
get { return _baseEndpoint; }
|
||||
set
|
||||
{
|
||||
_baseEndpoint = value;
|
||||
UpdateEndpoint(_baseEndpoint);
|
||||
}
|
||||
}
|
||||
|
||||
public string RegisterWebsite { get; set; }
|
||||
|
||||
public string CatalogEndpoint { get; set; }
|
||||
|
||||
public string OrdersEndpoint { get; set; }
|
||||
|
||||
public string BasketEndpoint { get; set; }
|
||||
|
||||
public string IdentityEndpoint { get; set; }
|
||||
|
||||
public string LogoutEndpoint { get; set; }
|
||||
|
||||
public string IdentityCallback { get; set; }
|
||||
|
||||
private void UpdateEndpoint(string baseEndpoint)
|
||||
{
|
||||
RegisterWebsite = string.Format("{0}/Account/Register", baseEndpoint);
|
||||
CatalogEndpoint = string.Format("{0}:5101", baseEndpoint);
|
||||
OrdersEndpoint = string.Format("{0}:5102", baseEndpoint);
|
||||
BasketEndpoint = string.Format("{0}:5103", baseEndpoint);
|
||||
IdentityEndpoint = string.Format("{0}:5105/connect/authorize", baseEndpoint);
|
||||
LogoutEndpoint = string.Format("{0}:5105/connect/endsession", baseEndpoint);
|
||||
IdentityCallback = "http://eshopxamarin/callback.html";
|
||||
}
|
||||
}
|
||||
}
|
@ -7,7 +7,7 @@ namespace eShopOnContainers.Core.Helpers
|
||||
public static ObservableCollection<int> GetNumericList(int count = 100)
|
||||
{
|
||||
var result = new ObservableCollection<int>();
|
||||
for (int i = 0; i < count; i++)
|
||||
for (int i = 1; i < count; i++)
|
||||
{
|
||||
result.Add(i);
|
||||
}
|
||||
|
@ -0,0 +1,41 @@
|
||||
using Plugin.Settings;
|
||||
using Plugin.Settings.Abstractions;
|
||||
|
||||
namespace eShopOnContainers.Core.Helpers
|
||||
{
|
||||
/// <summary>
|
||||
/// This is the Settings static class that can be used in your Core solution or in any
|
||||
/// of your client applications. All settings are laid out the same exact way with getters
|
||||
/// and setters.
|
||||
/// </summary>
|
||||
public static class Settings
|
||||
{
|
||||
private static ISettings AppSettings
|
||||
{
|
||||
get
|
||||
{
|
||||
return CrossSettings.Current;
|
||||
}
|
||||
}
|
||||
|
||||
#region Setting Constants
|
||||
|
||||
private const string AccessToken = "access_token";
|
||||
private static readonly string AccessTokenDefault = string.Empty;
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
public static string AuthAccessToken
|
||||
{
|
||||
get
|
||||
{
|
||||
return AppSettings.GetValueOrDefault<string>(AccessToken, AccessTokenDefault);
|
||||
}
|
||||
set
|
||||
{
|
||||
AppSettings.AddOrUpdateValue<string>(AccessToken, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -67,11 +67,14 @@ namespace eShopOnContainers.Core.Models.Basket
|
||||
get { return _quantity; }
|
||||
set
|
||||
{
|
||||
_quantity = value;
|
||||
RaisePropertyChanged(() => Quantity);
|
||||
RaisePropertyChanged(() => Total);
|
||||
if (_quantity != value)
|
||||
{
|
||||
_quantity = value;
|
||||
RaisePropertyChanged(() => Quantity);
|
||||
RaisePropertyChanged(() => Total);
|
||||
|
||||
MessagingCenter.Send(this, MessengerKeys.UpdateProduct);
|
||||
MessagingCenter.Send(this, MessengerKeys.UpdateProduct);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,8 @@
|
||||
namespace eShopOnContainers.Core.Models.Orders
|
||||
{
|
||||
public class CardType
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
}
|
||||
}
|
@ -3,7 +3,6 @@ using eShopOnContainers.Core.ViewModels.Base;
|
||||
using eShopOnContainers.ViewModels.Base;
|
||||
using System;
|
||||
using System.Collections.ObjectModel;
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace eShopOnContainers.Core.Models.Orders
|
||||
{
|
||||
@ -71,8 +70,6 @@ namespace eShopOnContainers.Core.Models.Orders
|
||||
_quantity = value;
|
||||
RaisePropertyChanged(() => Quantity);
|
||||
RaisePropertyChanged(() => Total);
|
||||
|
||||
MessagingCenter.Send(this, MessengerKeys.UpdateProduct);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,7 @@
|
||||
namespace eShopOnContainers.Core.Models.User
|
||||
{
|
||||
public class LogoutParameter
|
||||
{
|
||||
public bool Logout { get; set; }
|
||||
}
|
||||
}
|
@ -2,7 +2,6 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Xamarin.Forms;
|
||||
using System;
|
||||
|
||||
namespace eShopOnContainers.Core.Services.Basket
|
||||
{
|
||||
@ -18,11 +17,11 @@ namespace eShopOnContainers.Core.Services.Basket
|
||||
}
|
||||
};
|
||||
|
||||
public async Task<CustomerBasket> GetBasketAsync(string guidUser)
|
||||
public async Task<CustomerBasket> GetBasketAsync(string guidUser, string token)
|
||||
{
|
||||
await Task.Delay(500);
|
||||
|
||||
if(string.IsNullOrEmpty(guidUser))
|
||||
if(string.IsNullOrEmpty(guidUser) || string.IsNullOrEmpty(token))
|
||||
{
|
||||
return new CustomerBasket();
|
||||
}
|
||||
@ -38,5 +37,15 @@ namespace eShopOnContainers.Core.Services.Basket
|
||||
|
||||
return MockCustomBasket;
|
||||
}
|
||||
|
||||
public async Task ClearBasketAsync(string guidUser)
|
||||
{
|
||||
await Task.Delay(500);
|
||||
|
||||
if (!string.IsNullOrEmpty(guidUser))
|
||||
{
|
||||
MockCustomBasket.Items.Clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -14,18 +14,18 @@ namespace eShopOnContainers.Core.Services.Basket
|
||||
_requestProvider = requestProvider;
|
||||
}
|
||||
|
||||
public async Task<CustomerBasket> GetBasketAsync(string guidUser)
|
||||
public async Task<CustomerBasket> GetBasketAsync(string guidUser, string token)
|
||||
{
|
||||
try
|
||||
{
|
||||
UriBuilder builder = new UriBuilder(GlobalSetting.BasketEndpoint);
|
||||
UriBuilder builder = new UriBuilder(GlobalSetting.Instance.BasketEndpoint);
|
||||
|
||||
builder.Path = guidUser;
|
||||
|
||||
string uri = builder.ToString();
|
||||
|
||||
CustomerBasket basket =
|
||||
await _requestProvider.GetAsync<CustomerBasket>(uri);
|
||||
await _requestProvider.GetAsync<CustomerBasket>(uri, token);
|
||||
|
||||
return basket;
|
||||
}
|
||||
@ -41,7 +41,7 @@ namespace eShopOnContainers.Core.Services.Basket
|
||||
|
||||
public async Task<CustomerBasket> UpdateBasketAsync(CustomerBasket customerBasket)
|
||||
{
|
||||
UriBuilder builder = new UriBuilder(GlobalSetting.BasketEndpoint);
|
||||
UriBuilder builder = new UriBuilder(GlobalSetting.Instance.BasketEndpoint);
|
||||
|
||||
string uri = builder.ToString();
|
||||
|
||||
@ -49,5 +49,16 @@ namespace eShopOnContainers.Core.Services.Basket
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public async Task ClearBasketAsync(string guidUser)
|
||||
{
|
||||
UriBuilder builder = new UriBuilder(GlobalSetting.Instance.BasketEndpoint);
|
||||
|
||||
builder.Path = guidUser;
|
||||
|
||||
string uri = builder.ToString();
|
||||
|
||||
await _requestProvider.DeleteAsync(uri);
|
||||
}
|
||||
}
|
||||
}
|
@ -5,7 +5,8 @@ namespace eShopOnContainers.Core.Services.Basket
|
||||
{
|
||||
public interface IBasketService
|
||||
{
|
||||
Task<CustomerBasket> GetBasketAsync(string guidUser);
|
||||
Task<CustomerBasket> GetBasketAsync(string guidUser, string token);
|
||||
Task<CustomerBasket> UpdateBasketAsync(CustomerBasket customerBasket);
|
||||
Task ClearBasketAsync(string guidUser);
|
||||
}
|
||||
}
|
@ -19,30 +19,44 @@ namespace eShopOnContainers.Core.Services.Catalog
|
||||
|
||||
public async Task<ObservableCollection<CatalogItem>> FilterAsync(int catalogBrandId, int catalogTypeId)
|
||||
{
|
||||
UriBuilder builder = new UriBuilder(GlobalSetting.CatalogEndpoint);
|
||||
try
|
||||
{
|
||||
UriBuilder builder = new UriBuilder(GlobalSetting.Instance.CatalogEndpoint);
|
||||
|
||||
builder.Path = string.Format("api/v1/catalog/items/type/{0}/brand/{1}", catalogTypeId, catalogBrandId);
|
||||
builder.Path = string.Format("api/v1/catalog/items/type/{0}/brand/{1}", catalogTypeId, catalogBrandId);
|
||||
|
||||
string uri = builder.ToString();
|
||||
string uri = builder.ToString();
|
||||
|
||||
CatalogRoot catalog =
|
||||
await _requestProvider.GetAsync<CatalogRoot>(uri);
|
||||
CatalogRoot catalog =
|
||||
await _requestProvider.GetAsync<CatalogRoot>(uri);
|
||||
|
||||
return catalog?.Data?.ToObservableCollection();
|
||||
return catalog?.Data?.ToObservableCollection();
|
||||
}
|
||||
catch
|
||||
{
|
||||
return new ObservableCollection<CatalogItem>();
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<ObservableCollection<CatalogItem>> GetCatalogAsync()
|
||||
{
|
||||
UriBuilder builder = new UriBuilder(GlobalSetting.CatalogEndpoint);
|
||||
try
|
||||
{
|
||||
UriBuilder builder = new UriBuilder(GlobalSetting.Instance.CatalogEndpoint);
|
||||
|
||||
builder.Path = "api/v1/catalog/items";
|
||||
builder.Path = "api/v1/catalog/items";
|
||||
|
||||
string uri = builder.ToString();
|
||||
string uri = builder.ToString();
|
||||
|
||||
CatalogRoot catalog =
|
||||
await _requestProvider.GetAsync<CatalogRoot>(uri);
|
||||
CatalogRoot catalog =
|
||||
await _requestProvider.GetAsync<CatalogRoot>(uri);
|
||||
|
||||
return catalog?.Data?.ToObservableCollection();
|
||||
return catalog?.Data?.ToObservableCollection();
|
||||
}
|
||||
catch
|
||||
{
|
||||
return new ObservableCollection<CatalogItem>();
|
||||
}
|
||||
}
|
||||
|
||||
public Task<CatalogItem> GetCatalogItemAsync(string id)
|
||||
@ -52,30 +66,44 @@ namespace eShopOnContainers.Core.Services.Catalog
|
||||
|
||||
public async Task<ObservableCollection<CatalogBrand>> GetCatalogBrandAsync()
|
||||
{
|
||||
UriBuilder builder = new UriBuilder(GlobalSetting.CatalogEndpoint);
|
||||
try
|
||||
{
|
||||
UriBuilder builder = new UriBuilder(GlobalSetting.Instance.CatalogEndpoint);
|
||||
|
||||
builder.Path = "api/v1/catalog/catalogbrands";
|
||||
builder.Path = "api/v1/catalog/catalogbrands";
|
||||
|
||||
string uri = builder.ToString();
|
||||
string uri = builder.ToString();
|
||||
|
||||
IEnumerable<CatalogBrand> brands =
|
||||
await _requestProvider.GetAsync<IEnumerable<CatalogBrand>>(uri);
|
||||
IEnumerable<CatalogBrand> brands =
|
||||
await _requestProvider.GetAsync<IEnumerable<CatalogBrand>>(uri);
|
||||
|
||||
return brands?.ToObservableCollection();
|
||||
return brands?.ToObservableCollection();
|
||||
}
|
||||
catch
|
||||
{
|
||||
return new ObservableCollection<CatalogBrand>();
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<ObservableCollection<CatalogType>> GetCatalogTypeAsync()
|
||||
{
|
||||
UriBuilder builder = new UriBuilder(GlobalSetting.CatalogEndpoint);
|
||||
try
|
||||
{
|
||||
UriBuilder builder = new UriBuilder(GlobalSetting.Instance.CatalogEndpoint);
|
||||
|
||||
builder.Path = "api/v1/catalog/catalogtypes";
|
||||
builder.Path = "api/v1/catalog/catalogtypes";
|
||||
|
||||
string uri = builder.ToString();
|
||||
string uri = builder.ToString();
|
||||
|
||||
IEnumerable<CatalogType> types =
|
||||
await _requestProvider.GetAsync<IEnumerable<CatalogType>>(uri);
|
||||
IEnumerable<CatalogType> types =
|
||||
await _requestProvider.GetAsync<IEnumerable<CatalogType>>(uri);
|
||||
|
||||
return types?.ToObservableCollection();
|
||||
return types?.ToObservableCollection();
|
||||
}
|
||||
catch
|
||||
{
|
||||
return new ObservableCollection<CatalogType>();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,9 @@
|
||||
namespace eShopOnContainers.Core.Services.Identity
|
||||
{
|
||||
public interface IIdentityService
|
||||
{
|
||||
string CreateAuthorizeRequest();
|
||||
string CreateLogoutRequest(string token);
|
||||
string DecodeToken(string token);
|
||||
}
|
||||
}
|
@ -0,0 +1,69 @@
|
||||
using IdentityModel.Client;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace eShopOnContainers.Core.Services.Identity
|
||||
{
|
||||
public class IdentityService : IIdentityService
|
||||
{
|
||||
public string CreateAuthorizeRequest()
|
||||
{
|
||||
// Create URI to authorize endpoint
|
||||
var authorizeRequest =
|
||||
new AuthorizeRequest(GlobalSetting.Instance.IdentityEndpoint);
|
||||
|
||||
// Dictionary with values for the authorize request
|
||||
var dic = new Dictionary<string, string>();
|
||||
dic.Add("client_id", "xamarin");
|
||||
dic.Add("response_type", "id_token token");
|
||||
dic.Add("scope", "openid profile basket");
|
||||
|
||||
dic.Add("redirect_uri", GlobalSetting.Instance.IdentityCallback);
|
||||
dic.Add("nonce", Guid.NewGuid().ToString("N"));
|
||||
|
||||
// Add CSRF token to protect against cross-site request forgery attacks.
|
||||
var currentCSRFToken = Guid.NewGuid().ToString("N");
|
||||
dic.Add("state", currentCSRFToken);
|
||||
|
||||
var authorizeUri = authorizeRequest.Create(dic);
|
||||
|
||||
return authorizeUri;
|
||||
}
|
||||
|
||||
public string CreateLogoutRequest(string token)
|
||||
{
|
||||
return string.Format("{0}?id_token_hint={1}&post_logout_redirect_uri={2}",
|
||||
GlobalSetting.Instance.LogoutEndpoint,
|
||||
token,
|
||||
GlobalSetting.Instance.IdentityCallback);
|
||||
}
|
||||
|
||||
public string DecodeToken(string token)
|
||||
{
|
||||
var parts = token.Split('.');
|
||||
|
||||
string partToConvert = parts[1];
|
||||
partToConvert = partToConvert.Replace('-', '+');
|
||||
partToConvert = partToConvert.Replace('_', '/');
|
||||
switch (partToConvert.Length % 4)
|
||||
{
|
||||
case 0:
|
||||
break;
|
||||
case 2:
|
||||
partToConvert += "==";
|
||||
break;
|
||||
case 3:
|
||||
partToConvert += "=";
|
||||
break;
|
||||
}
|
||||
|
||||
var partAsBytes = Convert.FromBase64String(partToConvert);
|
||||
var partAsUTF8String = Encoding.UTF8.GetString(partAsBytes, 0, partAsBytes.Count());
|
||||
|
||||
return JObject.Parse(partAsUTF8String).ToString();
|
||||
}
|
||||
}
|
||||
}
|
@ -1,4 +1,5 @@
|
||||
using eShopOnContainers.Core.ViewModels;
|
||||
using eShopOnContainers.Core.Helpers;
|
||||
using eShopOnContainers.Core.ViewModels;
|
||||
using eShopOnContainers.Core.Views;
|
||||
using eShopOnContainers.ViewModels.Base;
|
||||
using System;
|
||||
@ -29,7 +30,10 @@ namespace eShopOnContainers.Services
|
||||
|
||||
public Task InitializeAsync()
|
||||
{
|
||||
return NavigateToAsync<LoginViewModel>();
|
||||
if(string.IsNullOrEmpty(Settings.AuthAccessToken))
|
||||
return NavigateToAsync<LoginViewModel>();
|
||||
else
|
||||
return NavigateToAsync<MainViewModel>();
|
||||
}
|
||||
|
||||
public Task NavigateToAsync<TViewModel>() where TViewModel : ViewModelBase
|
||||
@ -67,7 +71,7 @@ namespace eShopOnContainers.Services
|
||||
|
||||
public virtual Task RemoveLastFromBackStackAsync()
|
||||
{
|
||||
var mainPage = CurrentApplication.MainPage as CustomNavigationPage;
|
||||
var mainPage = CurrentApplication.MainPage as CustomNavigationView;
|
||||
|
||||
if (mainPage != null)
|
||||
{
|
||||
@ -80,7 +84,7 @@ namespace eShopOnContainers.Services
|
||||
|
||||
public virtual Task RemoveBackStackAsync()
|
||||
{
|
||||
var mainPage = CurrentApplication.MainPage as CustomNavigationPage;
|
||||
var mainPage = CurrentApplication.MainPage as CustomNavigationView;
|
||||
|
||||
if (mainPage != null)
|
||||
{
|
||||
@ -100,11 +104,11 @@ namespace eShopOnContainers.Services
|
||||
|
||||
if (page is LoginView)
|
||||
{
|
||||
CurrentApplication.MainPage = new CustomNavigationPage(page);
|
||||
CurrentApplication.MainPage = new CustomNavigationView(page);
|
||||
}
|
||||
else
|
||||
{
|
||||
var navigationPage = CurrentApplication.MainPage as CustomNavigationPage;
|
||||
var navigationPage = CurrentApplication.MainPage as CustomNavigationView;
|
||||
|
||||
if (navigationPage != null)
|
||||
{
|
||||
@ -112,7 +116,7 @@ namespace eShopOnContainers.Services
|
||||
}
|
||||
else
|
||||
{
|
||||
CurrentApplication.MainPage = new CustomNavigationPage(page);
|
||||
CurrentApplication.MainPage = new CustomNavigationView(page);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,13 @@
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace eShopOnContainers.Core.Services.Order
|
||||
{
|
||||
public interface IOrderService
|
||||
{
|
||||
Task CreateOrderAsync(Models.Orders.Order newOrder);
|
||||
Task<ObservableCollection<Models.Orders.Order>> GetOrdersAsync();
|
||||
Task<Models.Orders.Order> GetOrderAsync(int orderId);
|
||||
Task<ObservableCollection<Models.Orders.CardType>> GetCardTypesAsync();
|
||||
}
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
using eShopOnContainers.Core.Extensions;
|
||||
using eShopOnContainers.Core.Models.Orders;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace eShopOnContainers.Core.Services.Order
|
||||
{
|
||||
public class OrderMockService : IOrderService
|
||||
{
|
||||
private List<Models.Orders.Order> MockOrders = new List<Models.Orders.Order>()
|
||||
{
|
||||
new Models.Orders.Order { SequenceNumber = 123, Total = 56.40M, OrderDate = DateTime.Now, Status = OrderStatus.Delivered, OrderItems = MockOrderItems },
|
||||
new Models.Orders.Order { SequenceNumber = 132, Total = 56.40M, OrderDate = DateTime.Now, Status = OrderStatus.Delivered, OrderItems = MockOrderItems },
|
||||
new Models.Orders.Order { SequenceNumber = 231, Total = 56.40M, OrderDate = DateTime.Now, Status = OrderStatus.Delivered, OrderItems = MockOrderItems },
|
||||
};
|
||||
|
||||
private static List<OrderItem> MockOrderItems = new List<OrderItem>()
|
||||
{
|
||||
new OrderItem { OrderId = Guid.NewGuid(), ProductId = "1", Discount = 15, ProductName = ".NET Bot Blue Sweatshirt (M)", Quantity = 1, UnitPrice = 16.50M },
|
||||
new OrderItem { OrderId = Guid.NewGuid(), ProductId = "3", Discount = 0, ProductName = ".NET Bot Black Sweatshirt (M)", Quantity = 2, UnitPrice = 19.95M }
|
||||
};
|
||||
|
||||
private static List<CardType> MockCardTypes = new List<CardType>()
|
||||
{
|
||||
new CardType { Id = 1, Name = "Amex" },
|
||||
new CardType { Id = 2, Name = "Visa" },
|
||||
new CardType { Id = 3, Name = "MasterCard" },
|
||||
};
|
||||
|
||||
public async Task CreateOrderAsync(Models.Orders.Order newOrder)
|
||||
{
|
||||
await Task.Delay(500);
|
||||
|
||||
MockOrders.Insert(0, newOrder);
|
||||
}
|
||||
|
||||
public async Task<ObservableCollection<Models.Orders.Order>> GetOrdersAsync()
|
||||
{
|
||||
await Task.Delay(500);
|
||||
|
||||
return MockOrders.ToObservableCollection();
|
||||
}
|
||||
|
||||
public async Task<Models.Orders.Order> GetOrderAsync(int orderId)
|
||||
{
|
||||
await Task.Delay(500);
|
||||
|
||||
return MockOrders.FirstOrDefault(o => o.SequenceNumber == orderId);
|
||||
}
|
||||
|
||||
public async Task<ObservableCollection<CardType>> GetCardTypesAsync()
|
||||
{
|
||||
await Task.Delay(500);
|
||||
|
||||
return MockCardTypes.ToObservableCollection();
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,91 @@
|
||||
using eShopOnContainers.Core.Services.RequestProvider;
|
||||
using System;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace eShopOnContainers.Core.Services.Order
|
||||
{
|
||||
public class OrderService : IOrderService
|
||||
{
|
||||
private readonly IRequestProvider _requestProvider;
|
||||
|
||||
public OrderService(IRequestProvider requestProvider)
|
||||
{
|
||||
_requestProvider = requestProvider;
|
||||
}
|
||||
|
||||
public async Task CreateOrderAsync(Models.Orders.Order newOrder)
|
||||
{
|
||||
UriBuilder builder = new UriBuilder(GlobalSetting.Instance.OrdersEndpoint);
|
||||
|
||||
builder.Path = "api/v1/orders/new";
|
||||
|
||||
string uri = builder.ToString();
|
||||
|
||||
await _requestProvider.PostAsync(uri, newOrder);
|
||||
}
|
||||
|
||||
public async Task<ObservableCollection<Models.Orders.Order>> GetOrdersAsync()
|
||||
{
|
||||
try
|
||||
{
|
||||
UriBuilder builder = new UriBuilder(GlobalSetting.Instance.OrdersEndpoint);
|
||||
|
||||
builder.Path = "api/v1/orders";
|
||||
|
||||
string uri = builder.ToString();
|
||||
|
||||
ObservableCollection<Models.Orders.Order> orders =
|
||||
await _requestProvider.GetAsync<ObservableCollection<Models.Orders.Order>>(uri);
|
||||
|
||||
return orders;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return new ObservableCollection<Models.Orders.Order>();
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<Models.Orders.Order> GetOrderAsync(int orderId)
|
||||
{
|
||||
try
|
||||
{
|
||||
UriBuilder builder = new UriBuilder(GlobalSetting.Instance.OrdersEndpoint);
|
||||
|
||||
builder.Path = string.Format("api/v1/orders/{0}", orderId);
|
||||
|
||||
string uri = builder.ToString();
|
||||
|
||||
Models.Orders.Order order =
|
||||
await _requestProvider.GetAsync<Models.Orders.Order>(uri);
|
||||
|
||||
return order;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return new Models.Orders.Order();
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<ObservableCollection<Models.Orders.CardType>> GetCardTypesAsync()
|
||||
{
|
||||
try
|
||||
{
|
||||
UriBuilder builder = new UriBuilder(GlobalSetting.Instance.OrdersEndpoint);
|
||||
|
||||
builder.Path = "api/v1/orders/cardtypes";
|
||||
|
||||
string uri = builder.ToString();
|
||||
|
||||
ObservableCollection<Models.Orders.CardType> cardTypes =
|
||||
await _requestProvider.GetAsync<ObservableCollection<Models.Orders.CardType>>(uri);
|
||||
|
||||
return cardTypes;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return new ObservableCollection<Models.Orders.CardType>();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -6,6 +6,8 @@ namespace eShopOnContainers.Core.Services.RequestProvider
|
||||
{
|
||||
Task<TResult> GetAsync<TResult>(string uri);
|
||||
|
||||
Task<TResult> GetAsync<TResult>(string uri, string token);
|
||||
|
||||
Task<TResult> PostAsync<TResult>(string uri, TResult data);
|
||||
|
||||
Task<TResult> PostAsync<TRequest, TResult>(string uri, TRequest data);
|
||||
@ -13,5 +15,7 @@ namespace eShopOnContainers.Core.Services.RequestProvider
|
||||
Task<TResult> PutAsync<TResult>(string uri, TResult data);
|
||||
|
||||
Task<TResult> PutAsync<TRequest, TResult>(string uri, TRequest data);
|
||||
|
||||
Task DeleteAsync(string uri);
|
||||
}
|
||||
}
|
||||
}
|
@ -41,6 +41,22 @@ namespace eShopOnContainers.Core.Services.RequestProvider
|
||||
return result;
|
||||
}
|
||||
|
||||
public async Task<TResult> GetAsync<TResult>(string uri, string token)
|
||||
{
|
||||
HttpClient httpClient = CreateHttpClient();
|
||||
httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
|
||||
HttpResponseMessage response = await httpClient.GetAsync(uri);
|
||||
|
||||
await HandleResponse(response);
|
||||
|
||||
string serialized = await response.Content.ReadAsStringAsync();
|
||||
|
||||
TResult result = await Task.Run(() =>
|
||||
JsonConvert.DeserializeObject<TResult>(serialized, _serializerSettings));
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public Task<TResult> PostAsync<TResult>(string uri, TResult data)
|
||||
{
|
||||
return PostAsync<TResult, TResult>(uri, data);
|
||||
@ -77,6 +93,13 @@ namespace eShopOnContainers.Core.Services.RequestProvider
|
||||
return await Task.Run(() => JsonConvert.DeserializeObject<TResult>(responseData, _serializerSettings));
|
||||
}
|
||||
|
||||
public async Task DeleteAsync(string uri)
|
||||
{
|
||||
HttpClient httpClient = CreateHttpClient();
|
||||
|
||||
await httpClient.DeleteAsync(uri);
|
||||
}
|
||||
|
||||
private HttpClient CreateHttpClient()
|
||||
{
|
||||
var httpClient = new HttpClient();
|
||||
|
@ -1,12 +1,9 @@
|
||||
using eShopOnContainers.Core.Models.Orders;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace eShopOnContainers.Core.Services.User
|
||||
{
|
||||
public interface IUserService
|
||||
{
|
||||
Task<Models.User.User> GetUserAsync();
|
||||
Task<List<Order>> GetOrdersAsync();
|
||||
}
|
||||
}
|
@ -1,7 +1,4 @@
|
||||
using eShopOnContainers.Core.Models.Orders;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace eShopOnContainers.Core.Services.User
|
||||
{
|
||||
@ -18,31 +15,12 @@ namespace eShopOnContainers.Core.Services.User
|
||||
Country = "United States"
|
||||
};
|
||||
|
||||
private List<Order> MockOrders = new List<Order>()
|
||||
{
|
||||
new Order { SequenceNumber = 123, Total = 56.40M, OrderDate = DateTime.Now, Status = OrderStatus.Delivered, OrderItems = MockOrderItems },
|
||||
new Order { SequenceNumber = 132, Total = 56.40M, OrderDate = DateTime.Now, Status = OrderStatus.Delivered, OrderItems = MockOrderItems },
|
||||
new Order { SequenceNumber = 231, Total = 56.40M, OrderDate = DateTime.Now, Status = OrderStatus.Delivered, OrderItems = MockOrderItems },
|
||||
};
|
||||
|
||||
private static List<OrderItem> MockOrderItems = new List<OrderItem>()
|
||||
{
|
||||
new OrderItem { OrderId = Guid.NewGuid(), ProductId = "1", Discount = 15, ProductName = ".NET Bot Blue Sweatshirt (M)", Quantity = 1, UnitPrice = 16.50M },
|
||||
new OrderItem { OrderId = Guid.NewGuid(), ProductId = "3", Discount = 0, ProductName = ".NET Bot Black Sweatshirt (M)", Quantity = 2, UnitPrice = 19.95M }
|
||||
};
|
||||
|
||||
|
||||
public async Task<Models.User.User> GetUserAsync()
|
||||
{
|
||||
await Task.Delay(500);
|
||||
|
||||
return MockUser;
|
||||
}
|
||||
|
||||
public async Task<List<Order>> GetOrdersAsync()
|
||||
{
|
||||
await Task.Delay(500);
|
||||
|
||||
return MockOrders;
|
||||
}
|
||||
}
|
||||
}
|
@ -15,6 +15,6 @@
|
||||
public const string Filter = "Filter";
|
||||
|
||||
// Change selected Tab programmatically
|
||||
public const string ChangeTab = "ChangeTab";
|
||||
public const string ChangeTab = "ChangeTab";
|
||||
}
|
||||
}
|
||||
|
@ -7,6 +7,8 @@ using eShopOnContainers.Core.Services.OpenUrl;
|
||||
using eShopOnContainers.Core.Services.User;
|
||||
using eShopOnContainers.Core.Services.RequestProvider;
|
||||
using eShopOnContainers.Core.Services.Basket;
|
||||
using eShopOnContainers.Core.Services.Identity;
|
||||
using eShopOnContainers.Core.Services.Order;
|
||||
|
||||
namespace eShopOnContainers.ViewModels.Base
|
||||
{
|
||||
@ -37,6 +39,7 @@ namespace eShopOnContainers.ViewModels.Base
|
||||
RegisterSingleton<INavigationService, NavigationService>();
|
||||
_unityContainer.RegisterType<IOpenUrlService, OpenUrlService>();
|
||||
_unityContainer.RegisterType<IRequestProvider, RequestProvider>();
|
||||
_unityContainer.RegisterType<IIdentityService, IdentityService>();
|
||||
|
||||
_unityContainer.RegisterType<ICatalogService, CatalogMockService>();
|
||||
_unityContainer.RegisterType<IBasketService, BasketMockService>();
|
||||
@ -53,28 +56,29 @@ namespace eShopOnContainers.ViewModels.Base
|
||||
_unityContainer.RegisterType<SettingsViewModel>();
|
||||
}
|
||||
|
||||
public void UpdateServices(bool useMockServices)
|
||||
public void UpdateDependencies(bool useMockServices)
|
||||
{
|
||||
if (!useMockServices)
|
||||
if (useMockServices)
|
||||
{
|
||||
_unityContainer.RegisterInstance<ICatalogService>(new CatalogMockService());
|
||||
_unityContainer.RegisterInstance<IBasketService>(new BasketMockService());
|
||||
_unityContainer.RegisterInstance<IOrderService>(new OrderMockService());
|
||||
_unityContainer.RegisterInstance<IUserService>(new UserMockService());
|
||||
|
||||
UseMockService = false;
|
||||
UseMockService = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
var requestProvider = Resolve<IRequestProvider>();
|
||||
_unityContainer.RegisterInstance<ICatalogService>(new CatalogService(requestProvider));
|
||||
_unityContainer.RegisterInstance<IBasketService>(new BasketService(requestProvider));
|
||||
_unityContainer.RegisterInstance<IOrderService>(new OrderService(requestProvider));
|
||||
_unityContainer.RegisterInstance<IUserService>(new UserMockService());
|
||||
|
||||
UseMockService = true;
|
||||
UseMockService = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public T Resolve<T>()
|
||||
{
|
||||
return _unityContainer.Resolve<T>();
|
||||
|
@ -1,6 +1,5 @@
|
||||
using eShopOnContainers.Core.Models.Basket;
|
||||
using eShopOnContainers.Core.Models.Catalog;
|
||||
using eShopOnContainers.Core.Models.Orders;
|
||||
using eShopOnContainers.Core.Models.User;
|
||||
using eShopOnContainers.Core.Services.Basket;
|
||||
using eShopOnContainers.Core.Services.User;
|
||||
@ -69,10 +68,9 @@ namespace eShopOnContainers.Core.ViewModels
|
||||
{
|
||||
MessagingCenter.Subscribe<CatalogViewModel, List<BasketItem>>(this, MessengerKeys.UpdateBasket, (sender, arg) =>
|
||||
{
|
||||
BadgeCount = arg.Count;
|
||||
|
||||
foreach (var basketItem in arg)
|
||||
{
|
||||
BadgeCount += basketItem.Quantity;
|
||||
AddBasketItem(basketItem);
|
||||
}
|
||||
});
|
||||
@ -84,7 +82,7 @@ namespace eShopOnContainers.Core.ViewModels
|
||||
AddCatalogItem(arg);
|
||||
});
|
||||
|
||||
MessagingCenter.Subscribe<OrderItem>(this, MessengerKeys.UpdateProduct, (sender) =>
|
||||
MessagingCenter.Subscribe<BasketItem>(this, MessengerKeys.UpdateProduct, (sender) =>
|
||||
{
|
||||
ReCalculateTotal();
|
||||
});
|
||||
@ -126,12 +124,16 @@ namespace eShopOnContainers.Core.ViewModels
|
||||
{
|
||||
Total = 0;
|
||||
|
||||
if (BasketItems == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (var orderItem in BasketItems)
|
||||
{
|
||||
Total += (orderItem.Quantity * orderItem.UnitPrice);
|
||||
}
|
||||
|
||||
|
||||
|
||||
_basketService.UpdateBasketAsync(new CustomerBasket
|
||||
{
|
||||
BuyerId = _user.GuidUser,
|
||||
|
@ -9,6 +9,7 @@ using System.Windows.Input;
|
||||
using eShopOnContainers.Core.Services.User;
|
||||
using System.Linq;
|
||||
using eShopOnContainers.Core.Services.Basket;
|
||||
using eShopOnContainers.Core.Helpers;
|
||||
|
||||
namespace eShopOnContainers.Core.ViewModels
|
||||
{
|
||||
@ -100,9 +101,10 @@ namespace eShopOnContainers.Core.ViewModels
|
||||
Products = await _productsService.GetCatalogAsync();
|
||||
Brands = await _productsService.GetCatalogBrandAsync();
|
||||
Types = await _productsService.GetCatalogTypeAsync();
|
||||
|
||||
|
||||
var user = await _userService.GetUserAsync();
|
||||
var basket = await _basketService.GetBasketAsync(user.GuidUser);
|
||||
var authToken = Settings.AuthAccessToken;
|
||||
var basket = await _basketService.GetBasketAsync(user.GuidUser, authToken);
|
||||
|
||||
if (basket != null && basket.Items.Any())
|
||||
{
|
||||
|
@ -11,6 +11,8 @@ using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using eShopOnContainers.Core.Models.Basket;
|
||||
using System.Collections.Generic;
|
||||
using eShopOnContainers.Core.Services.Basket;
|
||||
using eShopOnContainers.Core.Services.Order;
|
||||
|
||||
namespace eShopOnContainers.Core.ViewModels
|
||||
{
|
||||
@ -21,10 +23,16 @@ namespace eShopOnContainers.Core.ViewModels
|
||||
private User _user;
|
||||
|
||||
private IUserService _userService;
|
||||
private IBasketService _basketService;
|
||||
private IOrderService _orderService;
|
||||
|
||||
public CheckoutViewModel(IUserService userService)
|
||||
public CheckoutViewModel(IUserService userService,
|
||||
IBasketService basketService,
|
||||
IOrderService orderService)
|
||||
{
|
||||
_basketService = basketService;
|
||||
_userService = userService;
|
||||
_orderService = orderService;
|
||||
}
|
||||
|
||||
public ObservableCollection<BasketItem> OrderItems
|
||||
@ -74,7 +82,7 @@ namespace eShopOnContainers.Core.ViewModels
|
||||
Order = new Order
|
||||
{
|
||||
ShippingAddress = User,
|
||||
OrderItems = CreateOrderItems(orderItems.ToList()),
|
||||
OrderItems = CreateOrderItems(orderItems),
|
||||
Status = OrderStatus.Pending,
|
||||
OrderDate = DateTime.Now,
|
||||
Total = GetOrderTotal()
|
||||
@ -86,14 +94,17 @@ namespace eShopOnContainers.Core.ViewModels
|
||||
|
||||
private async void Checkout()
|
||||
{
|
||||
await _orderService.CreateOrderAsync(Order);
|
||||
await _basketService.ClearBasketAsync(User.GuidUser);
|
||||
|
||||
await NavigationService.NavigateToAsync<MainViewModel>(new TabParameter { TabIndex = 1 });
|
||||
await NavigationService.RemoveLastFromBackStackAsync();
|
||||
|
||||
await DialogService.ShowAlertAsync("Order sent successfully", string.Format("Order {0}", Order.OrderNumber), "Ok");
|
||||
await DialogService.ShowAlertAsync("Order sent successfully!", string.Format("Order {0}", Order.OrderNumber), "Ok");
|
||||
await NavigationService.RemoveLastFromBackStackAsync();
|
||||
}
|
||||
|
||||
private List<OrderItem> CreateOrderItems(List<BasketItem> basketItems)
|
||||
private List<OrderItem> CreateOrderItems(ObservableCollection<BasketItem> basketItems)
|
||||
{
|
||||
var orderItems = new List<OrderItem>();
|
||||
|
||||
@ -124,4 +135,4 @@ namespace eShopOnContainers.Core.ViewModels
|
||||
return total;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,6 +1,11 @@
|
||||
using eShopOnContainers.Core.Services.OpenUrl;
|
||||
using eShopOnContainers.Core.Helpers;
|
||||
using eShopOnContainers.Core.Models.User;
|
||||
using eShopOnContainers.Core.Services.Identity;
|
||||
using eShopOnContainers.Core.Services.OpenUrl;
|
||||
using eShopOnContainers.Core.Validations;
|
||||
using eShopOnContainers.Core.ViewModels.Base;
|
||||
using eShopOnContainers.ViewModels.Base;
|
||||
using IdentityModel.Client;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Threading.Tasks;
|
||||
@ -13,17 +18,24 @@ namespace eShopOnContainers.Core.ViewModels
|
||||
{
|
||||
private ValidatableObject<string> _userName;
|
||||
private ValidatableObject<string> _password;
|
||||
private bool _isMock;
|
||||
private bool _isValid;
|
||||
private string _authUrl;
|
||||
|
||||
private IOpenUrlService _openUrlService;
|
||||
private IIdentityService _identityService;
|
||||
|
||||
public LoginViewModel(IOpenUrlService openUrlService)
|
||||
public LoginViewModel(IOpenUrlService openUrlService,
|
||||
IIdentityService identityService)
|
||||
{
|
||||
_openUrlService = openUrlService;
|
||||
_identityService = identityService;
|
||||
|
||||
_userName = new ValidatableObject<string>();
|
||||
_password = new ValidatableObject<string>();
|
||||
|
||||
IsMock = ViewModelLocator.Instance.UseMockService;
|
||||
|
||||
AddValidations();
|
||||
}
|
||||
|
||||
@ -53,6 +65,19 @@ namespace eShopOnContainers.Core.ViewModels
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsMock
|
||||
{
|
||||
get
|
||||
{
|
||||
return _isMock;
|
||||
}
|
||||
set
|
||||
{
|
||||
_isMock = value;
|
||||
RaisePropertyChanged(() => IsMock);
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsValid
|
||||
{
|
||||
get
|
||||
@ -66,11 +91,43 @@ namespace eShopOnContainers.Core.ViewModels
|
||||
}
|
||||
}
|
||||
|
||||
public ICommand SignInCommand => new Command(SignInAsync);
|
||||
public string LoginUrl
|
||||
{
|
||||
get
|
||||
{
|
||||
return _authUrl;
|
||||
}
|
||||
set
|
||||
{
|
||||
_authUrl = value;
|
||||
RaisePropertyChanged(() => LoginUrl);
|
||||
}
|
||||
}
|
||||
|
||||
public ICommand MockSignInCommand => new Command(MockSignInAsync);
|
||||
|
||||
public ICommand SignInCommand => new Command(async () => await SignInAsync());
|
||||
|
||||
public ICommand RegisterCommand => new Command(Register);
|
||||
|
||||
private async void SignInAsync()
|
||||
public ICommand NavigateCommand => new Command<string>(NavigateAsync);
|
||||
|
||||
public override Task InitializeAsync(object navigationData)
|
||||
{
|
||||
if(navigationData is LogoutParameter)
|
||||
{
|
||||
var logoutParameter = (LogoutParameter)navigationData;
|
||||
|
||||
if (logoutParameter.Logout)
|
||||
{
|
||||
Logout();
|
||||
}
|
||||
}
|
||||
|
||||
return base.InitializeAsync(navigationData);
|
||||
}
|
||||
|
||||
private async void MockSignInAsync()
|
||||
{
|
||||
IsBusy = true;
|
||||
IsValid = true;
|
||||
@ -104,9 +161,54 @@ namespace eShopOnContainers.Core.ViewModels
|
||||
IsBusy = false;
|
||||
}
|
||||
|
||||
private async Task SignInAsync()
|
||||
{
|
||||
IsBusy = true;
|
||||
|
||||
await Task.Delay(500);
|
||||
|
||||
LoginUrl = _identityService.CreateAuthorizeRequest();
|
||||
|
||||
IsValid = true;
|
||||
|
||||
IsBusy = false;
|
||||
}
|
||||
|
||||
private void Register()
|
||||
{
|
||||
_openUrlService.OpenUrl(GlobalSetting.RegisterWebsite);
|
||||
_openUrlService.OpenUrl(GlobalSetting.Instance.RegisterWebsite);
|
||||
}
|
||||
|
||||
private void Logout()
|
||||
{
|
||||
var token = Settings.AuthAccessToken;
|
||||
var logoutRequest = _identityService.CreateLogoutRequest(token);
|
||||
|
||||
if(!string.IsNullOrEmpty(logoutRequest))
|
||||
{
|
||||
IsValid = false;
|
||||
LoginUrl = logoutRequest;
|
||||
Settings.AuthAccessToken = string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
private async void NavigateAsync(string url)
|
||||
{
|
||||
if (url.Contains(GlobalSetting.Instance.IdentityCallback))
|
||||
{
|
||||
var authResponse = new AuthorizeResponse(url);
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(authResponse.AccessToken))
|
||||
{
|
||||
if(authResponse.AccessToken != null)
|
||||
{
|
||||
Settings.AuthAccessToken = authResponse.AccessToken;
|
||||
|
||||
await NavigationService.NavigateToAsync<MainViewModel>();
|
||||
await NavigationService.RemoveLastFromBackStackAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private bool Validate()
|
||||
@ -123,4 +225,4 @@ namespace eShopOnContainers.Core.ViewModels
|
||||
_password.Validations.Add(new IsNotNullOrEmptyRule<string> { ValidationMessage = "Password should not be empty" });
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,6 +1,8 @@
|
||||
using eShopOnContainers.Core.Extensions;
|
||||
using eShopOnContainers.Core.Models.Orders;
|
||||
using eShopOnContainers.Core.Services.User;
|
||||
using eShopOnContainers.Core.Models.User;
|
||||
using eShopOnContainers.Core.Services.Order;
|
||||
using eShopOnContainers.Core.ViewModels.Base;
|
||||
using eShopOnContainers.ViewModels.Base;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Threading.Tasks;
|
||||
@ -13,11 +15,11 @@ namespace eShopOnContainers.Core.ViewModels
|
||||
{
|
||||
private ObservableCollection<Order> _orders;
|
||||
|
||||
private IUserService _userService;
|
||||
private IOrderService _orderService;
|
||||
|
||||
public ProfileViewModel(IUserService userService)
|
||||
public ProfileViewModel(IOrderService orderService)
|
||||
{
|
||||
_userService = userService;
|
||||
_orderService = orderService;
|
||||
}
|
||||
|
||||
public ObservableCollection<Order> Orders
|
||||
@ -38,7 +40,7 @@ namespace eShopOnContainers.Core.ViewModels
|
||||
{
|
||||
IsBusy = true;
|
||||
|
||||
var orders = await _userService.GetOrdersAsync();
|
||||
var orders = await _orderService.GetOrdersAsync();
|
||||
Orders = orders.ToObservableCollection();
|
||||
|
||||
IsBusy = false;
|
||||
@ -48,7 +50,7 @@ namespace eShopOnContainers.Core.ViewModels
|
||||
{
|
||||
IsBusy = true;
|
||||
|
||||
await NavigationService.NavigateToAsync<LoginViewModel>();
|
||||
await NavigationService.NavigateToAsync<LoginViewModel>(new LogoutParameter { Logout = true });
|
||||
await NavigationService.RemoveBackStackAsync();
|
||||
|
||||
IsBusy = false;
|
||||
|
@ -9,11 +9,12 @@ namespace eShopOnContainers.Core.ViewModels
|
||||
{
|
||||
private string _title;
|
||||
private string _description;
|
||||
private bool _useMockServices;
|
||||
private bool _useAzureServices;
|
||||
private string _endpoint;
|
||||
|
||||
public SettingsViewModel()
|
||||
{
|
||||
UseMockServices = ViewModelLocator.Instance.UseMockService;
|
||||
UseAzureServices = !ViewModelLocator.Instance.UseMockService;
|
||||
}
|
||||
|
||||
public string Title
|
||||
@ -36,13 +37,29 @@ namespace eShopOnContainers.Core.ViewModels
|
||||
}
|
||||
}
|
||||
|
||||
public bool UseMockServices
|
||||
public bool UseAzureServices
|
||||
{
|
||||
get { return _useMockServices; }
|
||||
get { return _useAzureServices; }
|
||||
set
|
||||
{
|
||||
_useMockServices = value;
|
||||
RaisePropertyChanged(() => UseMockServices);
|
||||
_useAzureServices = value;
|
||||
RaisePropertyChanged(() => UseAzureServices);
|
||||
}
|
||||
}
|
||||
|
||||
public string Endpoint
|
||||
{
|
||||
get { return _endpoint; }
|
||||
set
|
||||
{
|
||||
_endpoint = value;
|
||||
|
||||
if(!string.IsNullOrEmpty(_endpoint))
|
||||
{
|
||||
UpdateEndpoint(_endpoint);
|
||||
}
|
||||
|
||||
RaisePropertyChanged(() => Endpoint);
|
||||
}
|
||||
}
|
||||
|
||||
@ -50,7 +67,7 @@ namespace eShopOnContainers.Core.ViewModels
|
||||
|
||||
private void MockServices()
|
||||
{
|
||||
ViewModelLocator.Instance.UpdateServices(UseMockServices);
|
||||
ViewModelLocator.Instance.UpdateDependencies(!UseAzureServices);
|
||||
UpdateInfo();
|
||||
}
|
||||
|
||||
@ -58,12 +75,14 @@ namespace eShopOnContainers.Core.ViewModels
|
||||
{
|
||||
UpdateInfo();
|
||||
|
||||
Endpoint = GlobalSetting.Instance.BaseEndpoint;
|
||||
|
||||
return base.InitializeAsync(navigationData);
|
||||
}
|
||||
|
||||
private void UpdateInfo()
|
||||
{
|
||||
if (!UseMockServices)
|
||||
if (!UseAzureServices)
|
||||
{
|
||||
Title = "Use Mock Services";
|
||||
Description = "Mock Services are simulated objects that mimic the behavior of real services in controlled ways";
|
||||
@ -74,5 +93,10 @@ namespace eShopOnContainers.Core.ViewModels
|
||||
Description = "Azure Services are real objects that required a valid internet connection";
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateEndpoint(string endpoint)
|
||||
{
|
||||
GlobalSetting.Instance.BaseEndpoint = endpoint;
|
||||
}
|
||||
}
|
||||
}
|
@ -58,7 +58,8 @@
|
||||
</Grid.RowDefinitions>
|
||||
<!-- FILTERS -->
|
||||
<Grid
|
||||
BackgroundColor="{StaticResource LightGreenColor}">
|
||||
BackgroundColor="{StaticResource LightGreenColor}"
|
||||
IsEnabled="{Binding Products.Count, Converter={StaticResource CountToBoolConverter}}">
|
||||
<Label
|
||||
Text="FILTER"
|
||||
Style="{StaticResource FilterLabelStyle}"/>
|
||||
|
@ -176,7 +176,8 @@
|
||||
</Grid.RowDefinitions>
|
||||
<ListView
|
||||
Grid.Row="0"
|
||||
ItemsSource="{Binding Order.OrderItems}"
|
||||
ItemsSource="{Binding Order.OrderItems}"
|
||||
HeightRequest="{Binding Order.OrderItems.Count, Converter={StaticResource ItemsToHeightConverter}}"
|
||||
HasUnevenRows="True"
|
||||
SeparatorVisibility="None"
|
||||
VerticalOptions="FillAndExpand"
|
||||
|
@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<NavigationPage xmlns="http://xamarin.com/schemas/2014/forms"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
x:Class="eShopOnContainers.Core.Views.CustomNavigationPage"
|
||||
BarBackgroundColor="{StaticResource GreenColor}"
|
||||
BarTextColor="{StaticResource WhiteColor}"
|
||||
BackgroundColor="Transparent">
|
||||
</NavigationPage>
|
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<NavigationPage
|
||||
xmlns="http://xamarin.com/schemas/2014/forms"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
x:Class="eShopOnContainers.Core.Views.CustomNavigationView"
|
||||
BarBackgroundColor="{StaticResource GreenColor}"
|
||||
BarTextColor="{StaticResource WhiteColor}"
|
||||
BackgroundColor="Transparent">
|
||||
</NavigationPage>
|
@ -2,14 +2,14 @@
|
||||
|
||||
namespace eShopOnContainers.Core.Views
|
||||
{
|
||||
public partial class CustomNavigationPage : NavigationPage
|
||||
public partial class CustomNavigationView : NavigationPage
|
||||
{
|
||||
public CustomNavigationPage() : base()
|
||||
public CustomNavigationView() : base()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public CustomNavigationPage(Page root) : base(root)
|
||||
public CustomNavigationView(Page root) : base(root)
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
@ -3,8 +3,14 @@
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
x:Class="eShopOnContainers.Core.Views.LoginView"
|
||||
xmlns:animations="clr-namespace:eShopOnContainers.Core.Animations;assembly=eShopOnContainers.Core"
|
||||
xmlns:triggers="clr-namespace:eShopOnContainers.Core.Triggers;assembly=eShopOnContainers.Core"
|
||||
Title="eShop on Containers">
|
||||
xmlns:triggers="clr-namespace:eShopOnContainers.Core.Triggers;assembly=eShopOnContainers.Core"
|
||||
xmlns:behaviors="clr-namespace:eShopOnContainers.Core.Behaviors;assembly=eShopOnContainers.Core">
|
||||
<ContentPage.Title>
|
||||
<OnPlatform
|
||||
x:TypeArguments="x:String"
|
||||
iOS="eShop on Containers"
|
||||
WinPhone="eShop on Containers"/>
|
||||
</ContentPage.Title>
|
||||
<ContentPage.Resources>
|
||||
<ResourceDictionary>
|
||||
|
||||
@ -46,6 +52,25 @@
|
||||
Value="Center" />
|
||||
</Style>
|
||||
|
||||
<Style x:Key="LoginPanelStyle"
|
||||
TargetType="{x:Type Grid}">
|
||||
<Setter Property="HeightRequest"
|
||||
Value="60" />
|
||||
<Setter Property="BackgroundColor"
|
||||
Value="{StaticResource LightGreenColor}" />
|
||||
<Setter Property="HorizontalOptions"
|
||||
Value="FillAndExpand" />
|
||||
<Setter Property="VerticalOptions"
|
||||
Value="FillAndExpand" />
|
||||
</Style>
|
||||
|
||||
<Style x:Key="RegisterPanelStyle"
|
||||
TargetType="{x:Type Grid}"
|
||||
BasedOn="{StaticResource LoginPanelStyle}">
|
||||
<Setter Property="BackgroundColor"
|
||||
Value="{StaticResource BlackColor}" />
|
||||
</Style>
|
||||
|
||||
<animations:StoryBoard
|
||||
x:Key="LoginAnimation"
|
||||
Target="{x:Reference LoginPanel}">
|
||||
@ -53,7 +78,7 @@
|
||||
Direction="Up"
|
||||
Duration="1500" />
|
||||
</animations:StoryBoard>
|
||||
|
||||
|
||||
</ResourceDictionary>
|
||||
</ContentPage.Resources>
|
||||
<ContentPage.Triggers>
|
||||
@ -65,8 +90,10 @@
|
||||
</ContentPage.Triggers>
|
||||
<Grid
|
||||
BackgroundColor="{StaticResource BackgroundColor}">
|
||||
<!-- MOCK AUTH -->
|
||||
<Grid
|
||||
x:Name="LoginPanel"
|
||||
x:Name="LoginPanel"
|
||||
IsVisible="{Binding IsMock}"
|
||||
Padding="0"
|
||||
ColumnSpacing="0"
|
||||
RowSpacing="0">
|
||||
@ -154,6 +181,55 @@
|
||||
Padding="0"
|
||||
ColumnSpacing="0"
|
||||
RowSpacing="0">
|
||||
<Label
|
||||
Text="[ LOGIN ]"
|
||||
Style="{StaticResource LoginButtonStyle}"/>
|
||||
<Grid.GestureRecognizers>
|
||||
<TapGestureRecognizer
|
||||
Command="{Binding MockSignInCommand}"
|
||||
NumberOfTapsRequired="1" />
|
||||
</Grid.GestureRecognizers>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<!-- AUTH -->
|
||||
<Grid
|
||||
ColumnSpacing="0"
|
||||
RowSpacing="0"
|
||||
IsVisible="{Binding IsMock, Converter={StaticResource InverseBoolConverter}}">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="60" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<!-- BANNER -->
|
||||
<Image
|
||||
x:Name="Banner"
|
||||
Grid.Row="0"
|
||||
Grid.Column="0"
|
||||
Grid.ColumnSpan="2"
|
||||
Aspect="AspectFill">
|
||||
<Image.Source>
|
||||
<OnPlatform
|
||||
x:TypeArguments="ImageSource"
|
||||
Android="banner.png"
|
||||
iOS="banner.png"
|
||||
WinPhone="Assets\banner.png"/>
|
||||
</Image.Source>
|
||||
</Image>
|
||||
<Grid
|
||||
Grid.Row="0"
|
||||
Grid.Column="0"
|
||||
Grid.ColumnSpan="2"
|
||||
BackgroundColor="{StaticResource BlackColor}"
|
||||
Opacity="0.5"/>
|
||||
<!-- LOG IN BUTTON -->
|
||||
<Grid
|
||||
Grid.Column="0"
|
||||
Grid.Row="1"
|
||||
Style="{StaticResource LoginPanelStyle}">
|
||||
<Label
|
||||
Text="[ LOGIN ]"
|
||||
Style="{StaticResource LoginButtonStyle}"/>
|
||||
@ -163,6 +239,37 @@
|
||||
NumberOfTapsRequired="1" />
|
||||
</Grid.GestureRecognizers>
|
||||
</Grid>
|
||||
<!-- REGISTER BUTTON -->
|
||||
<Grid
|
||||
Grid.Column="1"
|
||||
Grid.Row="1"
|
||||
Style="{StaticResource RegisterPanelStyle}">
|
||||
<Label
|
||||
Text="[ REGISTER ]"
|
||||
Style="{StaticResource LoginButtonStyle}"/>
|
||||
<Grid.GestureRecognizers>
|
||||
<TapGestureRecognizer
|
||||
Command="{Binding RegisterCommand}"
|
||||
NumberOfTapsRequired="1" />
|
||||
</Grid.GestureRecognizers>
|
||||
</Grid>
|
||||
<!-- WEBVIEW -->
|
||||
<AbsoluteLayout
|
||||
Grid.Column="0"
|
||||
Grid.ColumnSpan="2"
|
||||
Grid.Row="0"
|
||||
Grid.RowSpan="2"
|
||||
IsVisible="{Binding IsValid}">
|
||||
<WebView
|
||||
Source="{Binding LoginUrl}"
|
||||
AbsoluteLayout.LayoutBounds="0, 0, 1, 1"
|
||||
AbsoluteLayout.LayoutFlags="All">
|
||||
<WebView.Behaviors>
|
||||
<behaviors:WebViewNavigationBehavior
|
||||
NavigateCommand="{Binding NavigateCommand}"/>
|
||||
</WebView.Behaviors>
|
||||
</WebView>
|
||||
</AbsoluteLayout>
|
||||
</Grid>
|
||||
<!-- INDICATOR -->
|
||||
<ActivityIndicator
|
||||
|
@ -1,12 +1,64 @@
|
||||
using Xamarin.Forms;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Threading.Tasks;
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace eShopOnContainers.Core.Views
|
||||
{
|
||||
public partial class LoginView : ContentPage
|
||||
{
|
||||
private bool _animate;
|
||||
|
||||
public LoginView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
protected override async void OnAppearing()
|
||||
{
|
||||
var content = this.Content;
|
||||
this.Content = null;
|
||||
this.Content = content;
|
||||
|
||||
_animate = true;
|
||||
await AnimateIn();
|
||||
}
|
||||
|
||||
protected override void OnDisappearing()
|
||||
{
|
||||
_animate = false;
|
||||
}
|
||||
|
||||
public async Task AnimateIn()
|
||||
{
|
||||
if (Device.OS == TargetPlatform.Windows)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
await AnimateItem(Banner, 10500);
|
||||
}
|
||||
|
||||
private async Task AnimateItem(View uiElement, uint duration)
|
||||
{
|
||||
try
|
||||
{
|
||||
while (_animate)
|
||||
{
|
||||
await uiElement.ScaleTo(1.05, duration, Easing.SinInOut);
|
||||
|
||||
await Task.WhenAll(
|
||||
uiElement.FadeTo(1, duration, Easing.SinInOut),
|
||||
uiElement.LayoutTo(new Rectangle(new Point(0, 0), new Size(uiElement.Width, uiElement.Height))),
|
||||
uiElement.FadeTo(.9, duration, Easing.SinInOut),
|
||||
uiElement.ScaleTo(1.15, duration, Easing.SinInOut)
|
||||
);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.WriteLine(ex.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -6,8 +6,13 @@
|
||||
xmlns:controls="clr-namespace:eShopOnContainers.Core.Controls;assembly=eShopOnContainers.Core"
|
||||
BarBackgroundColor="{StaticResource DarkGreenColor}"
|
||||
BackgroundColor="{StaticResource BackgroundColor}"
|
||||
BarTextColor="{StaticResource WhiteColor}"
|
||||
Title="eShop on Containers">
|
||||
BarTextColor="{StaticResource WhiteColor}">
|
||||
<TabbedPage.Title>
|
||||
<OnPlatform
|
||||
x:TypeArguments="x:String"
|
||||
iOS="eShop on Containers"
|
||||
WinPhone="eShop on Containers"/>
|
||||
</TabbedPage.Title>
|
||||
<ContentPage.ToolbarItems>
|
||||
<ToolbarItem
|
||||
Command="{Binding SettingsCommand}"
|
||||
|
@ -78,26 +78,36 @@
|
||||
Grid.Row="0"
|
||||
Text="MY ORDERS"
|
||||
Style="{StaticResource MyOrdersLabelStyle}"/>
|
||||
<ListView
|
||||
Grid.Row="1"
|
||||
ItemsSource="{Binding Orders}"
|
||||
HasUnevenRows="True"
|
||||
SeparatorVisibility="None"
|
||||
CachingStrategy="RecycleElement">
|
||||
<ListView.Behaviors>
|
||||
<behaviors:EventToCommandBehavior
|
||||
EventName="ItemTapped"
|
||||
Command="{Binding OrderDetailCommand}"
|
||||
EventArgsConverter="{StaticResource ItemTappedEventArgsConverter}" />
|
||||
</ListView.Behaviors>
|
||||
<ListView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<ViewCell>
|
||||
<templates:OrderTemplate />
|
||||
</ViewCell>
|
||||
</DataTemplate>
|
||||
</ListView.ItemTemplate>
|
||||
</ListView>
|
||||
<Grid
|
||||
Grid.Row="1">
|
||||
<Grid
|
||||
IsVisible="{Binding IsBusy, Converter={StaticResource InverseBoolConverter}}">
|
||||
<Label
|
||||
Text="NO ORDERS"
|
||||
IsVisible="{Binding Orders.Count, Converter={StaticResource InverseCountToBoolConverter}}"
|
||||
HorizontalOptions="Center"
|
||||
VerticalOptions="Center"/>
|
||||
</Grid>
|
||||
<ListView
|
||||
ItemsSource="{Binding Orders}"
|
||||
HasUnevenRows="True"
|
||||
SeparatorVisibility="None"
|
||||
CachingStrategy="RecycleElement">
|
||||
<ListView.Behaviors>
|
||||
<behaviors:EventToCommandBehavior
|
||||
EventName="ItemTapped"
|
||||
Command="{Binding OrderDetailCommand}"
|
||||
EventArgsConverter="{StaticResource ItemTappedEventArgsConverter}" />
|
||||
</ListView.Behaviors>
|
||||
<ListView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<ViewCell>
|
||||
<templates:OrderTemplate />
|
||||
</ViewCell>
|
||||
</DataTemplate>
|
||||
</ListView.ItemTemplate>
|
||||
</ListView>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</ContentPage>
|
@ -43,6 +43,18 @@
|
||||
Value="12, 12, 12, 0" />
|
||||
</Style>
|
||||
|
||||
<Style x:Key="HeaderLabelStyle"
|
||||
TargetType="{x:Type Label}">
|
||||
<Setter Property="FontFamily"
|
||||
Value="{StaticResource MontserratRegular}" />
|
||||
<Setter Property="FontSize"
|
||||
Value="{StaticResource LittleSize}" />
|
||||
<Setter Property="TextColor"
|
||||
Value="{StaticResource GreenColor}" />
|
||||
<Setter Property="HorizontalOptions"
|
||||
Value="Start" />
|
||||
</Style>
|
||||
|
||||
<animations:StoryBoard
|
||||
x:Key="MockServicesAnimation"
|
||||
Target="{x:Reference MockServices}">
|
||||
@ -82,6 +94,7 @@
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="1" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid
|
||||
@ -105,7 +118,7 @@
|
||||
Grid.Column="1"
|
||||
Grid.Row="1"
|
||||
Animate="True"
|
||||
Checked="{Binding UseMockServices, Mode=TwoWay}"
|
||||
Checked="{Binding UseAzureServices, Mode=TwoWay}"
|
||||
Command="{Binding MockServicesCommand}"
|
||||
Style="{StaticResource SettingsToggleButtonStyle}">
|
||||
<controls:ToggleButton.CheckedImage>
|
||||
@ -121,10 +134,31 @@
|
||||
WinPhone="Assets/switchOff.png"/>
|
||||
</controls:ToggleButton.UnCheckedImage>
|
||||
</controls:ToggleButton>
|
||||
<Grid
|
||||
<!-- ENDPOINT -->
|
||||
<StackLayout
|
||||
Grid.Row="2"
|
||||
Grid.Column="0"
|
||||
Grid.ColumnSpan="2"
|
||||
Margin="12, 0, 12, 12"
|
||||
IsVisible="{Binding UseAzureServices}">
|
||||
<Label
|
||||
Text="Endpoint"
|
||||
Style="{StaticResource HeaderLabelStyle}"/>
|
||||
<Entry
|
||||
Text="{Binding Endpoint, Mode=TwoWay}">
|
||||
<Entry.Style>
|
||||
<OnPlatform
|
||||
x:TypeArguments="Style"
|
||||
iOS="{StaticResource EntryStyle}"
|
||||
Android="{StaticResource EntryStyle}"
|
||||
WinPhone="{StaticResource UwpEntryStyle}"/>
|
||||
</Entry.Style>
|
||||
</Entry>
|
||||
</StackLayout>
|
||||
<Grid
|
||||
Grid.Row="3"
|
||||
Grid.Column="0"
|
||||
Grid.ColumnSpan="2"
|
||||
BackgroundColor="Gray"/>
|
||||
</Grid>
|
||||
</StackLayout>
|
||||
|
@ -1,10 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using Xamarin.Forms;
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace eShopOnContainers.Core.Views
|
||||
{
|
||||
|
@ -56,6 +56,8 @@
|
||||
|
||||
<Style x:Key="QuantityPickerStyle"
|
||||
TargetType="{x:Type controls:BindablePicker}">
|
||||
<Setter Property="TextColor"
|
||||
Value="{StaticResource BlackColor}" />
|
||||
<Setter Property="BackgroundColor"
|
||||
Value="Transparent" />
|
||||
<Setter Property="HorizontalOptions"
|
||||
@ -139,7 +141,7 @@
|
||||
<controls:BindablePicker
|
||||
Grid.Column="1"
|
||||
ItemsSource="{Binding Numbers}"
|
||||
SelectedItem="{Binding Quantity, Mode=TwoWay}"
|
||||
SelectedItem="{Binding Quantity, Mode=TwoWay}"
|
||||
Style="{StaticResource QuantityPickerStyle}">
|
||||
<controls:BindablePicker.WidthRequest>
|
||||
<OnPlatform
|
||||
|
@ -15,6 +15,8 @@
|
||||
Value="{StaticResource MediumSize}" />
|
||||
<Setter Property="TextColor"
|
||||
Value="{StaticResource BlackColor}" />
|
||||
<Setter Property="LineBreakMode"
|
||||
Value="HeadTruncation" />
|
||||
</Style>
|
||||
|
||||
<Style x:Key="OrderItemUnitPriceStyle"
|
||||
@ -107,7 +109,8 @@
|
||||
<!-- NAME -->
|
||||
<Label
|
||||
Grid.Row="0"
|
||||
Text="{Binding ProductName, Converter={StaticResource ToUpperConverter}}"/>
|
||||
Text="{Binding ProductName, Converter={StaticResource ToUpperConverter}}"
|
||||
Style="{StaticResource OrderItemTitleStyle}"/>
|
||||
<Grid
|
||||
Grid.Row="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
|
@ -44,6 +44,7 @@
|
||||
</Compile>
|
||||
<Compile Include="Behaviors\Base\BindableBehavior.cs" />
|
||||
<Compile Include="Behaviors\EventToCommandBehavior.cs" />
|
||||
<Compile Include="Behaviors\WebViewNavigationBehavior.cs" />
|
||||
<Compile Include="Controls\BindablePicker.cs" />
|
||||
<Compile Include="Controls\AddBasketButton.xaml.cs">
|
||||
<DependentUpon>AddBasketButton.xaml</DependentUpon>
|
||||
@ -65,21 +66,26 @@
|
||||
<Compile Include="GlobalSettings.cs" />
|
||||
<Compile Include="Helpers\EasingHelper.cs" />
|
||||
<Compile Include="Helpers\NumericHelper.cs" />
|
||||
<Compile Include="Helpers\Settings.cs" />
|
||||
<Compile Include="Models\Basket\BasketItem.cs" />
|
||||
<Compile Include="Models\Catalog\CatalogBrand.cs" />
|
||||
<Compile Include="Models\Catalog\CatalogRoot.cs" />
|
||||
<Compile Include="Models\Catalog\CatalogType.cs" />
|
||||
<Compile Include="Models\Navigation\TabParameter.cs" />
|
||||
<Compile Include="Models\Basket\CustomerBasket.cs" />
|
||||
<Compile Include="Models\Orders\CardType.cs" />
|
||||
<Compile Include="Models\Orders\Order.cs" />
|
||||
<Compile Include="Models\Orders\OrderItem.cs" />
|
||||
<Compile Include="Models\Orders\OrderStatus.cs" />
|
||||
<Compile Include="Models\Catalog\CatalogItem.cs" />
|
||||
<Compile Include="Models\User\LogoutParameter.cs" />
|
||||
<Compile Include="Models\User\User.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Services\Catalog\CatalogService.cs" />
|
||||
<Compile Include="Services\Dialog\DialogService.cs" />
|
||||
<Compile Include="Services\Dialog\IDialogService.cs" />
|
||||
<Compile Include="Services\Identity\IdentityService.cs" />
|
||||
<Compile Include="Services\Identity\IIdentityService.cs" />
|
||||
<Compile Include="Services\Navigation\INavigationService.cs" />
|
||||
<Compile Include="Services\Navigation\NavigationService.cs" />
|
||||
<Compile Include="Services\OpenUrl\IOpenUrlService.cs" />
|
||||
@ -89,6 +95,9 @@
|
||||
<Compile Include="Services\Catalog\CatalogMockService.cs" />
|
||||
<Compile Include="Services\Catalog\ICatalogService.cs" />
|
||||
<Compile Include="Services\Basket\BasketService.cs" />
|
||||
<Compile Include="Services\Order\IOrderService.cs" />
|
||||
<Compile Include="Services\Order\OrderMockService.cs" />
|
||||
<Compile Include="Services\Order\OrderService.cs" />
|
||||
<Compile Include="Services\RequestProvider\IRequestProvider.cs" />
|
||||
<Compile Include="Services\RequestProvider\RequestProvider.cs" />
|
||||
<Compile Include="Services\User\IUserService.cs" />
|
||||
@ -116,8 +125,8 @@
|
||||
<Compile Include="Views\CheckoutView.xaml.cs">
|
||||
<DependentUpon>CheckoutView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\CustomNavigationPage.xaml.cs">
|
||||
<DependentUpon>CustomNavigationPage.xaml</DependentUpon>
|
||||
<Compile Include="Views\CustomNavigationView.xaml.cs">
|
||||
<DependentUpon>CustomNavigationView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\FiltersView.xaml.cs">
|
||||
<DependentUpon>FiltersView.xaml</DependentUpon>
|
||||
@ -186,6 +195,10 @@
|
||||
<HintPath>..\..\packages\Xamarin.FFImageLoading.2.2.6-pre-232\lib\portable-net45+win8+wpa81+wp8\FFImageLoading.Platform.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="IdentityModel.Portable, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\IdentityModel.1.3.1\lib\portable-net45+wp80+win8+wpa81\IdentityModel.Portable.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Practices.ServiceLocation, Version=1.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\CommonServiceLocator.1.3\lib\portable-net4+sl5+netcore45+wpa81+wp8\Microsoft.Practices.ServiceLocation.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
@ -202,6 +215,14 @@
|
||||
<HintPath>..\..\packages\Newtonsoft.Json.9.0.1\lib\portable-net45+wp80+win8+wpa81\Newtonsoft.Json.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Plugin.Settings, Version=2.6.0.12, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Xam.Plugins.Settings.2.6.0.12-beta\lib\portable-net45+wp80+win8+wpa81\Plugin.Settings.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Plugin.Settings.Abstractions, Version=2.6.0.12, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Xam.Plugins.Settings.2.6.0.12-beta\lib\portable-net45+wp80+win8+wpa81\Plugin.Settings.Abstractions.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="SlideOverKit, Version=1.0.6135.18790, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\SlideOverKit.2.1.4\lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\SlideOverKit.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
@ -281,12 +302,6 @@
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Views\CustomNavigationPage.xaml">
|
||||
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Views\Templates\ProductTemplate.xaml">
|
||||
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
|
||||
@ -335,6 +350,12 @@
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Views\CustomNavigationView.xaml">
|
||||
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
|
||||
<Import Project="..\..\packages\Xamarin.Forms.2.3.2.127\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets" Condition="Exists('..\..\packages\Xamarin.Forms.2.3.2.127\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets')" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
@ -342,10 +363,7 @@
|
||||
<ErrorText>Este proyecto hace referencia a los paquetes NuGet que faltan en este equipo. Use la restauración de paquetes NuGet para descargarlos. Para obtener más información, consulte http://go.microsoft.com/fwlink/?LinkID=322105. El archivo que falta es {0}.</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\..\packages\Xamarin.Forms.2.3.2.127\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Xamarin.Forms.2.3.2.127\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets'))" />
|
||||
<Error Condition="!Exists('..\..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets'))" />
|
||||
</Target>
|
||||
<Import Project="..\..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets" Condition="Exists('..\..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets')" />
|
||||
<Target Name="EnsureBclBuildImported" BeforeTargets="BeforeBuild" Condition="'$(BclBuildImported)' == ''">
|
||||
<Error Condition="!Exists('..\..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets')" Text="This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=317567." HelpKeyword="BCLBUILD2001" />
|
||||
<Error Condition="Exists('..\..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets')" Text="The build restored NuGet packages. Build the project again to include these packages in the build. For more information, see http://go.microsoft.com/fwlink/?LinkID=317568." HelpKeyword="BCLBUILD2002" />
|
||||
</Target>
|
||||
<Import Project="..\..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets" Condition="Exists('..\..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets')" />
|
||||
</Project>
|
@ -2,14 +2,16 @@
|
||||
<packages>
|
||||
<package id="Acr.UserDialogs" version="6.3.1" targetFramework="portable45-net45+win8+wp8+wpa81" />
|
||||
<package id="CommonServiceLocator" version="1.3" targetFramework="portable45-net45+win8+wp8+wpa81" />
|
||||
<package id="IdentityModel" version="1.3.1" targetFramework="portable45-net45+win8+wp8+wpa81" />
|
||||
<package id="Microsoft.Bcl" version="1.1.10" targetFramework="portable45-net45+win8+wp8+wpa81" />
|
||||
<package id="Microsoft.Bcl.Build" version="1.0.14" targetFramework="portable45-net45+win8+wp8+wpa81" />
|
||||
<package id="Microsoft.Bcl.Build" version="1.0.21" targetFramework="portable45-net45+win8+wp8+wpa81" />
|
||||
<package id="Microsoft.Net.Http" version="2.2.29" targetFramework="portable45-net45+win8+wp8+wpa81" />
|
||||
<package id="modernhttpclient" version="2.4.2" targetFramework="portable45-net45+win8+wp8+wpa81" />
|
||||
<package id="Newtonsoft.Json" version="9.0.1" targetFramework="portable45-net45+win8+wp8+wpa81" />
|
||||
<package id="SlideOverKit" version="2.1.4" targetFramework="portable45-net45+win8+wp8+wpa81" />
|
||||
<package id="Splat" version="1.6.2" targetFramework="portable45-net45+win8+wp8+wpa81" />
|
||||
<package id="Unity" version="4.0.1" targetFramework="portable45-net45+win8+wp8+wpa81" />
|
||||
<package id="Xam.Plugins.Settings" version="2.6.0.12-beta" targetFramework="portable45-net45+win8+wp8+wpa81" />
|
||||
<package id="Xamarin.FFImageLoading" version="2.2.6-pre-232" targetFramework="portable45-net45+win8+wp8+wpa81" />
|
||||
<package id="Xamarin.FFImageLoading.Forms" version="2.2.6-pre-232" targetFramework="portable45-net45+win8+wp8+wpa81" />
|
||||
<package id="Xamarin.Forms" version="2.3.2.127" targetFramework="portable45-net45+win8+wp8+wpa81" />
|
||||
|
@ -0,0 +1,44 @@
|
||||
/*
|
||||
// Helpers/Settings.cs This file was automatically added when you installed the Settings Plugin. If you are not using a PCL then comment this file back in to use it.
|
||||
using Plugin.Settings;
|
||||
using Plugin.Settings.Abstractions;
|
||||
|
||||
namespace eShopOnContainers.Droid.Helpers
|
||||
{
|
||||
/// <summary>
|
||||
/// This is the Settings static class that can be used in your Core solution or in any
|
||||
/// of your client applications. All settings are laid out the same exact way with getters
|
||||
/// and setters.
|
||||
/// </summary>
|
||||
public static class Settings
|
||||
{
|
||||
private static ISettings AppSettings
|
||||
{
|
||||
get
|
||||
{
|
||||
return CrossSettings.Current;
|
||||
}
|
||||
}
|
||||
|
||||
#region Setting Constants
|
||||
|
||||
private const string SettingsKey = "settings_key";
|
||||
private static readonly string SettingsDefault = string.Empty;
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
public static string GeneralSettings
|
||||
{
|
||||
get
|
||||
{
|
||||
return AppSettings.GetValueOrDefault<string>(SettingsKey, SettingsDefault);
|
||||
}
|
||||
set
|
||||
{
|
||||
AppSettings.AddOrUpdateValue<string>(SettingsKey, value);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}*/
|
@ -0,0 +1,33 @@
|
||||
using Android.Widget;
|
||||
using eShopOnContainers.Droid.Renderers;
|
||||
using Xamarin.Forms;
|
||||
using Xamarin.Forms.Platform.Android.AppCompat;
|
||||
|
||||
[assembly: ExportRenderer(typeof(NavigationPage), typeof(CustomNavigationPageRenderer))]
|
||||
namespace eShopOnContainers.Droid.Renderers
|
||||
{
|
||||
public class CustomNavigationPageRenderer : NavigationPageRenderer
|
||||
{
|
||||
protected override void OnLayout(bool changed, int l, int t, int r, int b)
|
||||
{
|
||||
base.OnLayout(changed, l, t, r, b);
|
||||
|
||||
var toolbar = FindViewById<Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar);
|
||||
|
||||
if (toolbar != null)
|
||||
{
|
||||
var image = toolbar.FindViewById<ImageView>(Resource.Id.toolbar_image);
|
||||
|
||||
if (Element.CurrentPage == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(Element.CurrentPage.Title))
|
||||
image.Visibility = Android.Views.ViewStates.Invisible;
|
||||
else
|
||||
image.Visibility = Android.Views.ViewStates.Visible;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -2027,319 +2027,325 @@ namespace eShopOnContainers.Droid
|
||||
public const int background = 2130837580;
|
||||
|
||||
// aapt resource value: 0x7f02004d
|
||||
public const int default_product = 2130837581;
|
||||
public const int banner = 2130837581;
|
||||
|
||||
// aapt resource value: 0x7f02004e
|
||||
public const int design_fab_background = 2130837582;
|
||||
public const int default_product = 2130837582;
|
||||
|
||||
// aapt resource value: 0x7f02004f
|
||||
public const int design_snackbar_background = 2130837583;
|
||||
public const int design_fab_background = 2130837583;
|
||||
|
||||
// aapt resource value: 0x7f020050
|
||||
public const int fake_product_01 = 2130837584;
|
||||
public const int design_snackbar_background = 2130837584;
|
||||
|
||||
// aapt resource value: 0x7f020051
|
||||
public const int fake_product_02 = 2130837585;
|
||||
public const int fake_product_01 = 2130837585;
|
||||
|
||||
// aapt resource value: 0x7f020052
|
||||
public const int fake_product_03 = 2130837586;
|
||||
public const int fake_product_02 = 2130837586;
|
||||
|
||||
// aapt resource value: 0x7f020053
|
||||
public const int fake_product_04 = 2130837587;
|
||||
public const int fake_product_03 = 2130837587;
|
||||
|
||||
// aapt resource value: 0x7f020054
|
||||
public const int fake_product_05 = 2130837588;
|
||||
public const int fake_product_04 = 2130837588;
|
||||
|
||||
// aapt resource value: 0x7f020055
|
||||
public const int ic_audiotrack = 2130837589;
|
||||
public const int fake_product_05 = 2130837589;
|
||||
|
||||
// aapt resource value: 0x7f020056
|
||||
public const int ic_audiotrack_light = 2130837590;
|
||||
public const int header_logo = 2130837590;
|
||||
|
||||
// aapt resource value: 0x7f020057
|
||||
public const int ic_bluetooth_grey = 2130837591;
|
||||
public const int ic_audiotrack = 2130837591;
|
||||
|
||||
// aapt resource value: 0x7f020058
|
||||
public const int ic_bluetooth_white = 2130837592;
|
||||
public const int ic_audiotrack_light = 2130837592;
|
||||
|
||||
// aapt resource value: 0x7f020059
|
||||
public const int ic_cast_dark = 2130837593;
|
||||
public const int ic_bluetooth_grey = 2130837593;
|
||||
|
||||
// aapt resource value: 0x7f02005a
|
||||
public const int ic_cast_disabled_light = 2130837594;
|
||||
public const int ic_bluetooth_white = 2130837594;
|
||||
|
||||
// aapt resource value: 0x7f02005b
|
||||
public const int ic_cast_grey = 2130837595;
|
||||
public const int ic_cast_dark = 2130837595;
|
||||
|
||||
// aapt resource value: 0x7f02005c
|
||||
public const int ic_cast_light = 2130837596;
|
||||
public const int ic_cast_disabled_light = 2130837596;
|
||||
|
||||
// aapt resource value: 0x7f02005d
|
||||
public const int ic_cast_off_light = 2130837597;
|
||||
public const int ic_cast_grey = 2130837597;
|
||||
|
||||
// aapt resource value: 0x7f02005e
|
||||
public const int ic_cast_on_0_light = 2130837598;
|
||||
public const int ic_cast_light = 2130837598;
|
||||
|
||||
// aapt resource value: 0x7f02005f
|
||||
public const int ic_cast_on_1_light = 2130837599;
|
||||
public const int ic_cast_off_light = 2130837599;
|
||||
|
||||
// aapt resource value: 0x7f020060
|
||||
public const int ic_cast_on_2_light = 2130837600;
|
||||
public const int ic_cast_on_0_light = 2130837600;
|
||||
|
||||
// aapt resource value: 0x7f020061
|
||||
public const int ic_cast_on_light = 2130837601;
|
||||
public const int ic_cast_on_1_light = 2130837601;
|
||||
|
||||
// aapt resource value: 0x7f020062
|
||||
public const int ic_cast_white = 2130837602;
|
||||
public const int ic_cast_on_2_light = 2130837602;
|
||||
|
||||
// aapt resource value: 0x7f020063
|
||||
public const int ic_close_dark = 2130837603;
|
||||
public const int ic_cast_on_light = 2130837603;
|
||||
|
||||
// aapt resource value: 0x7f020064
|
||||
public const int ic_close_light = 2130837604;
|
||||
public const int ic_cast_white = 2130837604;
|
||||
|
||||
// aapt resource value: 0x7f020065
|
||||
public const int ic_collapse = 2130837605;
|
||||
public const int ic_close_dark = 2130837605;
|
||||
|
||||
// aapt resource value: 0x7f020066
|
||||
public const int ic_collapse_00000 = 2130837606;
|
||||
public const int ic_close_light = 2130837606;
|
||||
|
||||
// aapt resource value: 0x7f020067
|
||||
public const int ic_collapse_00001 = 2130837607;
|
||||
public const int ic_collapse = 2130837607;
|
||||
|
||||
// aapt resource value: 0x7f020068
|
||||
public const int ic_collapse_00002 = 2130837608;
|
||||
public const int ic_collapse_00000 = 2130837608;
|
||||
|
||||
// aapt resource value: 0x7f020069
|
||||
public const int ic_collapse_00003 = 2130837609;
|
||||
public const int ic_collapse_00001 = 2130837609;
|
||||
|
||||
// aapt resource value: 0x7f02006a
|
||||
public const int ic_collapse_00004 = 2130837610;
|
||||
public const int ic_collapse_00002 = 2130837610;
|
||||
|
||||
// aapt resource value: 0x7f02006b
|
||||
public const int ic_collapse_00005 = 2130837611;
|
||||
public const int ic_collapse_00003 = 2130837611;
|
||||
|
||||
// aapt resource value: 0x7f02006c
|
||||
public const int ic_collapse_00006 = 2130837612;
|
||||
public const int ic_collapse_00004 = 2130837612;
|
||||
|
||||
// aapt resource value: 0x7f02006d
|
||||
public const int ic_collapse_00007 = 2130837613;
|
||||
public const int ic_collapse_00005 = 2130837613;
|
||||
|
||||
// aapt resource value: 0x7f02006e
|
||||
public const int ic_collapse_00008 = 2130837614;
|
||||
public const int ic_collapse_00006 = 2130837614;
|
||||
|
||||
// aapt resource value: 0x7f02006f
|
||||
public const int ic_collapse_00009 = 2130837615;
|
||||
public const int ic_collapse_00007 = 2130837615;
|
||||
|
||||
// aapt resource value: 0x7f020070
|
||||
public const int ic_collapse_00010 = 2130837616;
|
||||
public const int ic_collapse_00008 = 2130837616;
|
||||
|
||||
// aapt resource value: 0x7f020071
|
||||
public const int ic_collapse_00011 = 2130837617;
|
||||
public const int ic_collapse_00009 = 2130837617;
|
||||
|
||||
// aapt resource value: 0x7f020072
|
||||
public const int ic_collapse_00012 = 2130837618;
|
||||
public const int ic_collapse_00010 = 2130837618;
|
||||
|
||||
// aapt resource value: 0x7f020073
|
||||
public const int ic_collapse_00013 = 2130837619;
|
||||
public const int ic_collapse_00011 = 2130837619;
|
||||
|
||||
// aapt resource value: 0x7f020074
|
||||
public const int ic_collapse_00014 = 2130837620;
|
||||
public const int ic_collapse_00012 = 2130837620;
|
||||
|
||||
// aapt resource value: 0x7f020075
|
||||
public const int ic_collapse_00015 = 2130837621;
|
||||
public const int ic_collapse_00013 = 2130837621;
|
||||
|
||||
// aapt resource value: 0x7f020076
|
||||
public const int ic_errorstatus = 2130837622;
|
||||
public const int ic_collapse_00014 = 2130837622;
|
||||
|
||||
// aapt resource value: 0x7f020077
|
||||
public const int ic_expand = 2130837623;
|
||||
public const int ic_collapse_00015 = 2130837623;
|
||||
|
||||
// aapt resource value: 0x7f020078
|
||||
public const int ic_expand_00000 = 2130837624;
|
||||
public const int ic_errorstatus = 2130837624;
|
||||
|
||||
// aapt resource value: 0x7f020079
|
||||
public const int ic_expand_00001 = 2130837625;
|
||||
public const int ic_expand = 2130837625;
|
||||
|
||||
// aapt resource value: 0x7f02007a
|
||||
public const int ic_expand_00002 = 2130837626;
|
||||
public const int ic_expand_00000 = 2130837626;
|
||||
|
||||
// aapt resource value: 0x7f02007b
|
||||
public const int ic_expand_00003 = 2130837627;
|
||||
public const int ic_expand_00001 = 2130837627;
|
||||
|
||||
// aapt resource value: 0x7f02007c
|
||||
public const int ic_expand_00004 = 2130837628;
|
||||
public const int ic_expand_00002 = 2130837628;
|
||||
|
||||
// aapt resource value: 0x7f02007d
|
||||
public const int ic_expand_00005 = 2130837629;
|
||||
public const int ic_expand_00003 = 2130837629;
|
||||
|
||||
// aapt resource value: 0x7f02007e
|
||||
public const int ic_expand_00006 = 2130837630;
|
||||
public const int ic_expand_00004 = 2130837630;
|
||||
|
||||
// aapt resource value: 0x7f02007f
|
||||
public const int ic_expand_00007 = 2130837631;
|
||||
public const int ic_expand_00005 = 2130837631;
|
||||
|
||||
// aapt resource value: 0x7f020080
|
||||
public const int ic_expand_00008 = 2130837632;
|
||||
public const int ic_expand_00006 = 2130837632;
|
||||
|
||||
// aapt resource value: 0x7f020081
|
||||
public const int ic_expand_00009 = 2130837633;
|
||||
public const int ic_expand_00007 = 2130837633;
|
||||
|
||||
// aapt resource value: 0x7f020082
|
||||
public const int ic_expand_00010 = 2130837634;
|
||||
public const int ic_expand_00008 = 2130837634;
|
||||
|
||||
// aapt resource value: 0x7f020083
|
||||
public const int ic_expand_00011 = 2130837635;
|
||||
public const int ic_expand_00009 = 2130837635;
|
||||
|
||||
// aapt resource value: 0x7f020084
|
||||
public const int ic_expand_00012 = 2130837636;
|
||||
public const int ic_expand_00010 = 2130837636;
|
||||
|
||||
// aapt resource value: 0x7f020085
|
||||
public const int ic_expand_00013 = 2130837637;
|
||||
public const int ic_expand_00011 = 2130837637;
|
||||
|
||||
// aapt resource value: 0x7f020086
|
||||
public const int ic_expand_00014 = 2130837638;
|
||||
public const int ic_expand_00012 = 2130837638;
|
||||
|
||||
// aapt resource value: 0x7f020087
|
||||
public const int ic_expand_00015 = 2130837639;
|
||||
public const int ic_expand_00013 = 2130837639;
|
||||
|
||||
// aapt resource value: 0x7f020088
|
||||
public const int ic_media_pause = 2130837640;
|
||||
public const int ic_expand_00014 = 2130837640;
|
||||
|
||||
// aapt resource value: 0x7f020089
|
||||
public const int ic_media_play = 2130837641;
|
||||
public const int ic_expand_00015 = 2130837641;
|
||||
|
||||
// aapt resource value: 0x7f02008a
|
||||
public const int ic_media_route_disabled_mono_dark = 2130837642;
|
||||
public const int ic_media_pause = 2130837642;
|
||||
|
||||
// aapt resource value: 0x7f02008b
|
||||
public const int ic_media_route_off_mono_dark = 2130837643;
|
||||
public const int ic_media_play = 2130837643;
|
||||
|
||||
// aapt resource value: 0x7f02008c
|
||||
public const int ic_media_route_on_0_mono_dark = 2130837644;
|
||||
public const int ic_media_route_disabled_mono_dark = 2130837644;
|
||||
|
||||
// aapt resource value: 0x7f02008d
|
||||
public const int ic_media_route_on_1_mono_dark = 2130837645;
|
||||
public const int ic_media_route_off_mono_dark = 2130837645;
|
||||
|
||||
// aapt resource value: 0x7f02008e
|
||||
public const int ic_media_route_on_2_mono_dark = 2130837646;
|
||||
public const int ic_media_route_on_0_mono_dark = 2130837646;
|
||||
|
||||
// aapt resource value: 0x7f02008f
|
||||
public const int ic_media_route_on_mono_dark = 2130837647;
|
||||
public const int ic_media_route_on_1_mono_dark = 2130837647;
|
||||
|
||||
// aapt resource value: 0x7f020090
|
||||
public const int ic_pause_dark = 2130837648;
|
||||
public const int ic_media_route_on_2_mono_dark = 2130837648;
|
||||
|
||||
// aapt resource value: 0x7f020091
|
||||
public const int ic_pause_light = 2130837649;
|
||||
public const int ic_media_route_on_mono_dark = 2130837649;
|
||||
|
||||
// aapt resource value: 0x7f020092
|
||||
public const int ic_play_dark = 2130837650;
|
||||
public const int ic_pause_dark = 2130837650;
|
||||
|
||||
// aapt resource value: 0x7f020093
|
||||
public const int ic_play_light = 2130837651;
|
||||
public const int ic_pause_light = 2130837651;
|
||||
|
||||
// aapt resource value: 0x7f020094
|
||||
public const int ic_speaker_dark = 2130837652;
|
||||
public const int ic_play_dark = 2130837652;
|
||||
|
||||
// aapt resource value: 0x7f020095
|
||||
public const int ic_speaker_group_dark = 2130837653;
|
||||
public const int ic_play_light = 2130837653;
|
||||
|
||||
// aapt resource value: 0x7f020096
|
||||
public const int ic_speaker_group_light = 2130837654;
|
||||
public const int ic_speaker_dark = 2130837654;
|
||||
|
||||
// aapt resource value: 0x7f020097
|
||||
public const int ic_speaker_light = 2130837655;
|
||||
public const int ic_speaker_group_dark = 2130837655;
|
||||
|
||||
// aapt resource value: 0x7f020098
|
||||
public const int ic_successstatus = 2130837656;
|
||||
public const int ic_speaker_group_light = 2130837656;
|
||||
|
||||
// aapt resource value: 0x7f020099
|
||||
public const int ic_tv_dark = 2130837657;
|
||||
public const int ic_speaker_light = 2130837657;
|
||||
|
||||
// aapt resource value: 0x7f02009a
|
||||
public const int ic_tv_light = 2130837658;
|
||||
public const int ic_successstatus = 2130837658;
|
||||
|
||||
// aapt resource value: 0x7f02009b
|
||||
public const int icon = 2130837659;
|
||||
public const int ic_tv_dark = 2130837659;
|
||||
|
||||
// aapt resource value: 0x7f02009c
|
||||
public const int menu_cart = 2130837660;
|
||||
public const int ic_tv_light = 2130837660;
|
||||
|
||||
// aapt resource value: 0x7f02009d
|
||||
public const int menu_filter = 2130837661;
|
||||
public const int icon = 2130837661;
|
||||
|
||||
// aapt resource value: 0x7f02009e
|
||||
public const int menu_profile = 2130837662;
|
||||
public const int menu_cart = 2130837662;
|
||||
|
||||
// aapt resource value: 0x7f02009f
|
||||
public const int mr_dialog_material_background_dark = 2130837663;
|
||||
public const int menu_filter = 2130837663;
|
||||
|
||||
// aapt resource value: 0x7f0200a0
|
||||
public const int mr_dialog_material_background_light = 2130837664;
|
||||
public const int menu_profile = 2130837664;
|
||||
|
||||
// aapt resource value: 0x7f0200a1
|
||||
public const int mr_ic_audiotrack_light = 2130837665;
|
||||
public const int mr_dialog_material_background_dark = 2130837665;
|
||||
|
||||
// aapt resource value: 0x7f0200a2
|
||||
public const int mr_ic_cast_dark = 2130837666;
|
||||
public const int mr_dialog_material_background_light = 2130837666;
|
||||
|
||||
// aapt resource value: 0x7f0200a3
|
||||
public const int mr_ic_cast_light = 2130837667;
|
||||
public const int mr_ic_audiotrack_light = 2130837667;
|
||||
|
||||
// aapt resource value: 0x7f0200a4
|
||||
public const int mr_ic_close_dark = 2130837668;
|
||||
public const int mr_ic_cast_dark = 2130837668;
|
||||
|
||||
// aapt resource value: 0x7f0200a5
|
||||
public const int mr_ic_close_light = 2130837669;
|
||||
public const int mr_ic_cast_light = 2130837669;
|
||||
|
||||
// aapt resource value: 0x7f0200a6
|
||||
public const int mr_ic_media_route_connecting_mono_dark = 2130837670;
|
||||
public const int mr_ic_close_dark = 2130837670;
|
||||
|
||||
// aapt resource value: 0x7f0200a7
|
||||
public const int mr_ic_media_route_connecting_mono_light = 2130837671;
|
||||
public const int mr_ic_close_light = 2130837671;
|
||||
|
||||
// aapt resource value: 0x7f0200a8
|
||||
public const int mr_ic_media_route_mono_dark = 2130837672;
|
||||
public const int mr_ic_media_route_connecting_mono_dark = 2130837672;
|
||||
|
||||
// aapt resource value: 0x7f0200a9
|
||||
public const int mr_ic_media_route_mono_light = 2130837673;
|
||||
public const int mr_ic_media_route_connecting_mono_light = 2130837673;
|
||||
|
||||
// aapt resource value: 0x7f0200aa
|
||||
public const int mr_ic_pause_dark = 2130837674;
|
||||
public const int mr_ic_media_route_mono_dark = 2130837674;
|
||||
|
||||
// aapt resource value: 0x7f0200ab
|
||||
public const int mr_ic_pause_light = 2130837675;
|
||||
public const int mr_ic_media_route_mono_light = 2130837675;
|
||||
|
||||
// aapt resource value: 0x7f0200ac
|
||||
public const int mr_ic_play_dark = 2130837676;
|
||||
public const int mr_ic_pause_dark = 2130837676;
|
||||
|
||||
// aapt resource value: 0x7f0200ad
|
||||
public const int mr_ic_play_light = 2130837677;
|
||||
public const int mr_ic_pause_light = 2130837677;
|
||||
|
||||
// aapt resource value: 0x7f0200ae
|
||||
public const int noimage = 2130837678;
|
||||
|
||||
// aapt resource value: 0x7f0200b5
|
||||
public const int notification_template_icon_bg = 2130837685;
|
||||
public const int mr_ic_play_dark = 2130837678;
|
||||
|
||||
// aapt resource value: 0x7f0200af
|
||||
public const int product_add = 2130837679;
|
||||
public const int mr_ic_play_light = 2130837679;
|
||||
|
||||
// aapt resource value: 0x7f0200b0
|
||||
public const int roundedbg = 2130837680;
|
||||
public const int noimage = 2130837680;
|
||||
|
||||
// aapt resource value: 0x7f0200b7
|
||||
public const int notification_template_icon_bg = 2130837687;
|
||||
|
||||
// aapt resource value: 0x7f0200b1
|
||||
public const int roundedbgdark = 2130837681;
|
||||
public const int product_add = 2130837681;
|
||||
|
||||
// aapt resource value: 0x7f0200b2
|
||||
public const int splash_drawable = 2130837682;
|
||||
public const int roundedbg = 2130837682;
|
||||
|
||||
// aapt resource value: 0x7f0200b3
|
||||
public const int switch_off = 2130837683;
|
||||
public const int roundedbgdark = 2130837683;
|
||||
|
||||
// aapt resource value: 0x7f0200b4
|
||||
public const int switch_on = 2130837684;
|
||||
public const int splash_drawable = 2130837684;
|
||||
|
||||
// aapt resource value: 0x7f0200b5
|
||||
public const int switch_off = 2130837685;
|
||||
|
||||
// aapt resource value: 0x7f0200b6
|
||||
public const int switch_on = 2130837686;
|
||||
|
||||
static Drawable()
|
||||
{
|
||||
@ -2810,6 +2816,9 @@ namespace eShopOnContainers.Droid
|
||||
// aapt resource value: 0x7f0700a0
|
||||
public const int toolbar = 2131165344;
|
||||
|
||||
// aapt resource value: 0x7f0700a1
|
||||
public const int toolbar_image = 2131165345;
|
||||
|
||||
// aapt resource value: 0x7f070032
|
||||
public const int top = 2131165234;
|
||||
|
||||
|
Binary file not shown.
After Width: | Height: | Size: 2.0 KiB |
Binary file not shown.
After Width: | Height: | Size: 2.4 KiB |
Binary file not shown.
After Width: | Height: | Size: 3.5 KiB |
Binary file not shown.
After Width: | Height: | Size: 142 KiB |
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.v7.widget.Toolbar
|
||||
<android.support.v7.widget.Toolbar
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/toolbar"
|
||||
@ -9,4 +9,12 @@
|
||||
android:background="?attr/colorPrimary"
|
||||
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
|
||||
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
|
||||
app:layout_scrollFlags="scroll|enterAlways" />
|
||||
app:layout_scrollFlags="scroll|enterAlways">
|
||||
<ImageView
|
||||
android:id="@+id/toolbar_image"
|
||||
android:src="@drawable/header_logo"
|
||||
android:scaleType="fitCenter"
|
||||
android:layout_width="124dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_gravity="center" />
|
||||
</android.support.v7.widget.Toolbar>
|
@ -22,6 +22,10 @@
|
||||
<assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-1.5.0.0" newVersion="1.5.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Net.Http.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.2.28.0" newVersion="4.2.28.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
||||
|
@ -17,7 +17,7 @@
|
||||
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
|
||||
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
|
||||
<AndroidUseLatestPlatformSdk>true</AndroidUseLatestPlatformSdk>
|
||||
<TargetFrameworkVersion>v6.0</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v7.0</TargetFrameworkVersion>
|
||||
<AndroidSupportedAbis>armeabi,armeabi-v7a,x86</AndroidSupportedAbis>
|
||||
<AndroidStoreUncompressedFileExtensions />
|
||||
<MandroidI18n />
|
||||
@ -93,6 +93,10 @@
|
||||
<HintPath>..\..\packages\Xamarin.Forms.2.3.2.127\lib\MonoAndroid10\FormsViewGroup.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="IdentityModel.Portable, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\IdentityModel.1.3.1\lib\portable-net45+wp80+win8+wpa81\IdentityModel.Portable.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="Microsoft.Practices.ServiceLocation, Version=1.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\CommonServiceLocator.1.3\lib\portable-net4+sl5+netcore45+wpa81+wp8\Microsoft.Practices.ServiceLocation.dll</HintPath>
|
||||
@ -116,6 +120,14 @@
|
||||
<HintPath>..\..\packages\modernhttpclient.2.4.2\lib\MonoAndroid\OkHttp.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Plugin.Settings, Version=2.6.0.12, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Xam.Plugins.Settings.2.6.0.12-beta\lib\MonoAndroid10\Plugin.Settings.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Plugin.Settings.Abstractions, Version=2.6.0.12, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Xam.Plugins.Settings.2.6.0.12-beta\lib\MonoAndroid10\Plugin.Settings.Abstractions.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="SlideOverKit, Version=1.0.6135.18790, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\SlideOverKit.2.1.4\lib\MonoAndroid10\SlideOverKit.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
@ -130,6 +142,15 @@
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Net.Http.Extensions, Version=2.2.28.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Microsoft.Net.Http.2.2.28\lib\monoandroid\System.Net.Http.Extensions.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Net.Http.Primitives, Version=4.2.28.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Microsoft.Net.Http.2.2.28\lib\monoandroid\System.Net.Http.Primitives.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.ObjectModel" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Xml" />
|
||||
@ -203,7 +224,9 @@
|
||||
<Compile Include="Activities\SplashActivity.cs" />
|
||||
<Compile Include="Effects\EntryLineColorEffect.cs" />
|
||||
<Compile Include="Extensions\ViewExtensions.cs" />
|
||||
<Compile Include="Helpers\Settings.cs" />
|
||||
<Compile Include="Renderers\BadgeView.cs" />
|
||||
<Compile Include="Renderers\CustomNavigationPageRenderer.cs" />
|
||||
<Compile Include="Renderers\CustomTabbedPageRenderer.cs" />
|
||||
<Compile Include="Renderers\SlideDownMenuPageRenderer.cs" />
|
||||
<Compile Include="Resources\Resource.Designer.cs" />
|
||||
@ -346,6 +369,18 @@
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\drawable\default_product.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\drawable\banner.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\drawable-hdpi\header_logo.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\drawable-xhdpi\header_logo.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\drawable-xxhdpi\header_logo.png" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
|
||||
<Import Project="..\..\packages\Xamarin.Android.Support.Vector.Drawable.23.3.0\build\Xamarin.Android.Support.Vector.Drawable.targets" Condition="Exists('..\..\packages\Xamarin.Android.Support.Vector.Drawable.23.3.0\build\Xamarin.Android.Support.Vector.Drawable.targets')" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
@ -354,6 +389,8 @@
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\..\packages\Xamarin.Android.Support.Vector.Drawable.23.3.0\build\Xamarin.Android.Support.Vector.Drawable.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Xamarin.Android.Support.Vector.Drawable.23.3.0\build\Xamarin.Android.Support.Vector.Drawable.targets'))" />
|
||||
<Error Condition="!Exists('..\..\packages\Xamarin.Forms.2.3.2.127\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Xamarin.Forms.2.3.2.127\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets'))" />
|
||||
<Error Condition="!Exists('..\..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets'))" />
|
||||
</Target>
|
||||
<Import Project="..\..\packages\Xamarin.Forms.2.3.2.127\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets" Condition="Exists('..\..\packages\Xamarin.Forms.2.3.2.127\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets')" />
|
||||
<Import Project="..\..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets" Condition="Exists('..\..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets')" />
|
||||
</Project>
|
@ -17,7 +17,7 @@
|
||||
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
|
||||
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
|
||||
<AndroidUseLatestPlatformSdk>true</AndroidUseLatestPlatformSdk>
|
||||
<TargetFrameworkVersion>v7.0</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v6.0</TargetFrameworkVersion>
|
||||
<AndroidSupportedAbis>armeabi,armeabi-v7a,x86</AndroidSupportedAbis>
|
||||
<AndroidStoreUncompressedFileExtensions />
|
||||
<MandroidI18n />
|
||||
@ -223,6 +223,8 @@
|
||||
<None Include="packages.config" />
|
||||
<None Include="Resources\AboutResources.txt" />
|
||||
<None Include="Assets\AboutAssets.txt" />
|
||||
<AndroidResource Include="Resources\drawable-xxhdpi\switch_off.png" />
|
||||
<AndroidResource Include="Resources\drawable-xxhdpi\switch_on.png" />
|
||||
<AndroidResource Include="Resources\layout\Tabs.axml">
|
||||
<SubType>Designer</SubType>
|
||||
</AndroidResource>
|
||||
@ -332,9 +334,6 @@
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\drawable-xhdpi\switch_on.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\drawable-xxhdpi\switch_on.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\drawable-hdpi\switch_off.png" />
|
||||
</ItemGroup>
|
||||
@ -342,10 +341,10 @@
|
||||
<AndroidResource Include="Resources\drawable-xhdpi\switch_off.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\drawable-xxhdpi\switch_off.png" />
|
||||
<AndroidResource Include="Resources\drawable\noimage.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\drawable\noimage.png" />
|
||||
<AndroidResource Include="Resources\drawable\default_product.png" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
|
||||
<Import Project="..\..\packages\Xamarin.Android.Support.Vector.Drawable.23.3.0\build\Xamarin.Android.Support.Vector.Drawable.targets" Condition="Exists('..\..\packages\Xamarin.Android.Support.Vector.Drawable.23.3.0\build\Xamarin.Android.Support.Vector.Drawable.targets')" />
|
||||
@ -354,9 +353,7 @@
|
||||
<ErrorText>Este proyecto hace referencia a los paquetes NuGet que faltan en este equipo. Use la restauración de paquetes NuGet para descargarlos. Para obtener más información, consulte http://go.microsoft.com/fwlink/?LinkID=322105. El archivo que falta es {0}.</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\..\packages\Xamarin.Android.Support.Vector.Drawable.23.3.0\build\Xamarin.Android.Support.Vector.Drawable.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Xamarin.Android.Support.Vector.Drawable.23.3.0\build\Xamarin.Android.Support.Vector.Drawable.targets'))" />
|
||||
<Error Condition="!Exists('..\..\packages\StyleCop.MSBuild.5.0.0-alpha01\build\StyleCop.MSBuild.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\StyleCop.MSBuild.5.0.0-alpha01\build\StyleCop.MSBuild.targets'))" />
|
||||
<Error Condition="!Exists('..\..\packages\Xamarin.Forms.2.3.2.127\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Xamarin.Forms.2.3.2.127\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets'))" />
|
||||
</Target>
|
||||
<Import Project="..\..\packages\StyleCop.MSBuild.5.0.0-alpha01\build\StyleCop.MSBuild.targets" Condition="Exists('..\..\packages\StyleCop.MSBuild.5.0.0-alpha01\build\StyleCop.MSBuild.targets')" />
|
||||
<Import Project="..\..\packages\Xamarin.Forms.2.3.2.127\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets" Condition="Exists('..\..\packages\Xamarin.Forms.2.3.2.127\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets')" />
|
||||
</Project>
|
@ -4,7 +4,11 @@
|
||||
<package id="Acr.UserDialogs" version="6.3.1" targetFramework="monoandroid70" />
|
||||
<package id="AndHUD" version="1.2.0" targetFramework="monoandroid70" />
|
||||
<package id="CommonServiceLocator" version="1.3" targetFramework="monoandroid70" />
|
||||
<package id="IdentityModel" version="1.3.1" targetFramework="monoandroid60" />
|
||||
<package id="Microsoft.Bcl" version="1.1.10" targetFramework="monoandroid60" />
|
||||
<package id="Microsoft.Bcl.Build" version="1.0.21" targetFramework="monoandroid60" />
|
||||
<package id="Microsoft.CSharp" version="4.0.1" targetFramework="monoandroid70" />
|
||||
<package id="Microsoft.Net.Http" version="2.2.28" targetFramework="monoandroid60" />
|
||||
<package id="modernhttpclient" version="2.4.2" targetFramework="monoandroid70" />
|
||||
<package id="Newtonsoft.Json" version="9.0.2-beta1" targetFramework="monoandroid70" />
|
||||
<package id="SlideOverKit" version="2.1.4" targetFramework="monoandroid70" />
|
||||
@ -32,6 +36,7 @@
|
||||
<package id="System.Xml.ReaderWriter" version="4.0.11" targetFramework="monoandroid70" />
|
||||
<package id="System.Xml.XDocument" version="4.0.11" targetFramework="monoandroid70" />
|
||||
<package id="Unity" version="4.0.1" targetFramework="monoandroid70" />
|
||||
<package id="Xam.Plugins.Settings" version="2.6.0.12-beta" targetFramework="monoandroid70" />
|
||||
<package id="Xamarin.Android.Support.Animated.Vector.Drawable" version="23.3.0" targetFramework="monoandroid70" />
|
||||
<package id="Xamarin.Android.Support.Design" version="23.3.0" targetFramework="monoandroid70" />
|
||||
<package id="Xamarin.Android.Support.v4" version="23.3.0" targetFramework="monoandroid70" />
|
||||
|
Binary file not shown.
After Width: | Height: | Size: 856 KiB |
@ -8,7 +8,6 @@ using System.Linq;
|
||||
using Xamarin.Forms;
|
||||
using Xamarin.Forms.Internals;
|
||||
using Xamarin.Forms.Platform.UWP;
|
||||
using UI = Windows.UI;
|
||||
using Xaml = Windows.UI.Xaml;
|
||||
|
||||
[assembly: ExportRenderer(typeof(TabbedPage), typeof(CustomTabbedPageRenderer))]
|
||||
@ -35,7 +34,7 @@ namespace eShopOnContainers.Windows.Renderers
|
||||
|
||||
private void AddTabBadge(int tabIndex)
|
||||
{
|
||||
if(Element == null)
|
||||
if (Element == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -129,6 +129,7 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Assets\app_settings.png" />
|
||||
<Content Include="Assets\banner.png" />
|
||||
<Content Include="Assets\circle_button_background.png" />
|
||||
<Content Include="Assets\default_product.png" />
|
||||
<Content Include="Assets\fake_product_01.png" />
|
||||
|
@ -1,10 +1,12 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"Acr.UserDialogs": "6.3.1",
|
||||
"IdentityModel": "1.3.1",
|
||||
"Microsoft.NETCore.UniversalWindowsPlatform": "5.0.0",
|
||||
"Newtonsoft.Json": "9.0.1",
|
||||
"SlideOverKit": "2.1.4",
|
||||
"Unity": "4.0.1",
|
||||
"Xam.Plugins.Settings": "2.6.0.12-beta",
|
||||
"Xamarin.FFImageLoading": "2.2.6-pre-232",
|
||||
"Xamarin.FFImageLoading.Forms": "2.2.6-pre-232",
|
||||
"Xamarin.Forms": "2.3.2.127",
|
||||
|
@ -0,0 +1,44 @@
|
||||
/*
|
||||
// Helpers/Settings.cs This file was automatically added when you installed the Settings Plugin. If you are not using a PCL then comment this file back in to use it.
|
||||
using Plugin.Settings;
|
||||
using Plugin.Settings.Abstractions;
|
||||
|
||||
namespace eShopOnContainers.iOS.Helpers
|
||||
{
|
||||
/// <summary>
|
||||
/// This is the Settings static class that can be used in your Core solution or in any
|
||||
/// of your client applications. All settings are laid out the same exact way with getters
|
||||
/// and setters.
|
||||
/// </summary>
|
||||
public static class Settings
|
||||
{
|
||||
private static ISettings AppSettings
|
||||
{
|
||||
get
|
||||
{
|
||||
return CrossSettings.Current;
|
||||
}
|
||||
}
|
||||
|
||||
#region Setting Constants
|
||||
|
||||
private const string SettingsKey = "settings_key";
|
||||
private static readonly string SettingsDefault = string.Empty;
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
public static string GeneralSettings
|
||||
{
|
||||
get
|
||||
{
|
||||
return AppSettings.GetValueOrDefault<string>(SettingsKey, SettingsDefault);
|
||||
}
|
||||
set
|
||||
{
|
||||
AppSettings.AddOrUpdateValue<string>(SettingsKey, value);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}*/
|
Binary file not shown.
After Width: | Height: | Size: 142 KiB |
@ -10,6 +10,10 @@
|
||||
<assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-1.5.0.0" newVersion="1.5.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Net.Http.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.2.28.0" newVersion="4.2.28.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
@ -101,6 +101,7 @@
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Effects\EntryLineColorEffect.cs" />
|
||||
<Compile Include="Helpers\Settings.cs" />
|
||||
<Compile Include="Main.cs" />
|
||||
<Compile Include="AppDelegate.cs" />
|
||||
<BundleResource Include="..\CommonResources\Fonts\Montserrat-Bold.ttf">
|
||||
@ -157,6 +158,10 @@
|
||||
<HintPath>..\..\packages\Xamarin.FFImageLoading.2.2.6-pre-232\lib\Xamarin.iOS10\FFImageLoading.Platform.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="IdentityModel.Portable, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\IdentityModel.1.3.1\lib\portable-net45+wp80+win8+wpa81\IdentityModel.Portable.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Practices.ServiceLocation, Version=1.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\CommonServiceLocator.1.3\lib\portable-net4+sl5+netcore45+wpa81+wp8\Microsoft.Practices.ServiceLocation.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
@ -173,6 +178,14 @@
|
||||
<HintPath>..\..\packages\Newtonsoft.Json.9.0.1\lib\portable-net45+wp80+win8+wpa81\Newtonsoft.Json.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Plugin.Settings, Version=2.6.0.12, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Xam.Plugins.Settings.2.6.0.12-beta\lib\Xamarin.iOS10\Plugin.Settings.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Plugin.Settings.Abstractions, Version=2.6.0.12, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Xam.Plugins.Settings.2.6.0.12-beta\lib\Xamarin.iOS10\Plugin.Settings.Abstractions.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="SlideOverKit, Version=1.0.6135.18790, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\SlideOverKit.2.1.4\lib\Xamarin.iOS10\SlideOverKit.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
@ -186,6 +199,14 @@
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Net.Http.Extensions, Version=2.2.28.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Microsoft.Net.Http.2.2.28\lib\portable-net45+win8\System.Net.Http.Extensions.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Net.Http.Primitives, Version=4.2.28.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Microsoft.Net.Http.2.2.28\lib\portable-net45+win8\System.Net.Http.Primitives.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="WebP.Touch, Version=1.0.5923.35383, Culture=neutral, processorArchitecture=MSIL">
|
||||
@ -372,12 +393,50 @@
|
||||
<ItemGroup>
|
||||
<BundleResource Include="Resources\default_product.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BundleResource Include="Resources\banner.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BundleResource Include="Resources\Default%402x.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BundleResource Include="Resources\Default-568h%402x.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BundleResource Include="Resources\Default-Portrait.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BundleResource Include="Resources\Default-Portrait%402x.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BundleResource Include="Resources\Icon-60%402x.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BundleResource Include="Resources\Icon-76.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BundleResource Include="Resources\Icon-76%402x.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BundleResource Include="Resources\Icon-Small.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BundleResource Include="Resources\Icon-Small%402x.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BundleResource Include="Resources\Icon-Small-40.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BundleResource Include="Resources\Icon-Small-40%402x.png" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>Este proyecto hace referencia a los paquetes NuGet que faltan en este equipo. Use la restauración de paquetes NuGet para descargarlos. Para obtener más información, consulte http://go.microsoft.com/fwlink/?LinkID=322105. El archivo que falta es {0}.</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\..\packages\Xamarin.Forms.2.3.2.127\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Xamarin.Forms.2.3.2.127\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets'))" />
|
||||
<Error Condition="!Exists('..\..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets'))" />
|
||||
</Target>
|
||||
<Import Project="..\..\packages\Xamarin.Forms.2.3.2.127\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets" Condition="Exists('..\..\packages\Xamarin.Forms.2.3.2.127\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets')" />
|
||||
<Import Project="..\..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets" Condition="Exists('..\..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets')" />
|
||||
</Project>
|
@ -3,12 +3,17 @@
|
||||
<package id="Acr.Support" version="2.1.0" targetFramework="xamarinios10" />
|
||||
<package id="Acr.UserDialogs" version="6.3.1" targetFramework="xamarinios10" />
|
||||
<package id="CommonServiceLocator" version="1.3" targetFramework="xamarinios10" />
|
||||
<package id="IdentityModel" version="1.3.1" targetFramework="xamarinios10" />
|
||||
<package id="Microsoft.Bcl" version="1.1.10" targetFramework="xamarinios10" />
|
||||
<package id="Microsoft.Bcl.Build" version="1.0.21" targetFramework="xamarinios10" />
|
||||
<package id="Microsoft.Net.Http" version="2.2.28" targetFramework="xamarinios10" />
|
||||
<package id="modernhttpclient" version="2.4.2" targetFramework="xamarinios10" />
|
||||
<package id="Newtonsoft.Json" version="9.0.1" targetFramework="xamarinios10" />
|
||||
<package id="SlideOverKit" version="2.1.4" targetFramework="xamarinios10" />
|
||||
<package id="Splat" version="1.6.2" targetFramework="xamarinios10" />
|
||||
<package id="Unity" version="4.0.1" targetFramework="xamarinios10" />
|
||||
<package id="WebP.Touch" version="1.0.2" targetFramework="xamarinios10" />
|
||||
<package id="Xam.Plugins.Settings" version="2.6.0.12-beta" targetFramework="xamarinios10" />
|
||||
<package id="Xamarin.FFImageLoading" version="2.2.6-pre-232" targetFramework="xamarinios10" />
|
||||
<package id="Xamarin.FFImageLoading.Forms" version="2.2.6-pre-232" targetFramework="xamarinios10" />
|
||||
<package id="Xamarin.Forms" version="2.3.2.127" targetFramework="xamarinios10" />
|
||||
|
Loading…
x
Reference in New Issue
Block a user