diff --git a/src/Mobile/eShopOnContainers.Xamarin.sln b/src/Mobile/eShopOnContainers.Xamarin.sln
index 68893edc2..7082291a3 100644
--- a/src/Mobile/eShopOnContainers.Xamarin.sln
+++ b/src/Mobile/eShopOnContainers.Xamarin.sln
@@ -240,6 +240,8 @@ Global
{C3C1E2CF-B1F7-4654-BBDC-50143DB22E0B}.Debug|ARM.Deploy.0 = Debug|ARM
{C3C1E2CF-B1F7-4654-BBDC-50143DB22E0B}.Debug|iPhone.ActiveCfg = Debug|x86
{C3C1E2CF-B1F7-4654-BBDC-50143DB22E0B}.Debug|iPhoneSimulator.ActiveCfg = Debug|x86
+ {C3C1E2CF-B1F7-4654-BBDC-50143DB22E0B}.Debug|iPhoneSimulator.Build.0 = Debug|x86
+ {C3C1E2CF-B1F7-4654-BBDC-50143DB22E0B}.Debug|iPhoneSimulator.Deploy.0 = Debug|x86
{C3C1E2CF-B1F7-4654-BBDC-50143DB22E0B}.Debug|x64.ActiveCfg = Debug|x64
{C3C1E2CF-B1F7-4654-BBDC-50143DB22E0B}.Debug|x64.Build.0 = Debug|x64
{C3C1E2CF-B1F7-4654-BBDC-50143DB22E0B}.Debug|x64.Deploy.0 = Debug|x64
diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/App.xaml b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/App.xaml
index 91a8ede8b..9a5c14319 100644
--- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/App.xaml
+++ b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/App.xaml
@@ -103,6 +103,7 @@
+
diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Controls/BindablePicker.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Controls/BindablePicker.cs
index 78dce2ef5..c0ad76a05 100644
--- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Controls/BindablePicker.cs
+++ b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Controls/BindablePicker.cs
@@ -101,10 +101,12 @@ namespace eShopOnContainers.Core.Controls
private static void OnSelectedItemChanged(BindableObject bindable, object oldValue, object newValue)
{
var boundPicker = (BindablePicker)bindable;
+
if (boundPicker.ItemSelected != null)
{
boundPicker.ItemSelected(boundPicker, new SelectedItemChangedEventArgs(newValue));
}
+
boundPicker.InternalUpdateSelectedIndex();
}
}
diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Converters/InverseBoolConverter.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Converters/InverseBoolConverter.cs
new file mode 100644
index 000000000..622c85d85
--- /dev/null
+++ b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Converters/InverseBoolConverter.cs
@@ -0,0 +1,24 @@
+using System;
+using System.Globalization;
+using Xamarin.Forms;
+
+namespace eShopOnContainers.Core.Converters
+{
+ public class InverseBoolConverter : IValueConverter
+ {
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (!(value is bool))
+ {
+ throw new InvalidOperationException("The target must be a boolean");
+ }
+
+ return !(bool)value;
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return null;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Extensions/ObservableExtension.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Extensions/ObservableExtension.cs
new file mode 100644
index 000000000..800f9a031
--- /dev/null
+++ b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Extensions/ObservableExtension.cs
@@ -0,0 +1,20 @@
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+
+namespace eShopOnContainers.Core.Extensions
+{
+ public static class ObservableExtension
+ {
+ public static ObservableCollection ToObservableCollection(this IEnumerable source)
+ {
+ ObservableCollection collection = new ObservableCollection();
+
+ foreach (T item in source)
+ {
+ collection.Add(item);
+ }
+
+ return collection;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Helpers/NumericHelper.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Helpers/NumericHelper.cs
new file mode 100644
index 000000000..989d359a1
--- /dev/null
+++ b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Helpers/NumericHelper.cs
@@ -0,0 +1,18 @@
+using System.Collections.ObjectModel;
+
+namespace eShopOnContainers.Core.Helpers
+{
+ public class NumericHelper
+ {
+ public static ObservableCollection GetNumericList(int count = 100)
+ {
+ var result = new ObservableCollection();
+ for (int i = 0; i < count; i++)
+ {
+ result.Add(i);
+ }
+
+ return result;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Catalog/CatalogBrand.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Catalog/CatalogBrand.cs
new file mode 100644
index 000000000..773c9e2a8
--- /dev/null
+++ b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Catalog/CatalogBrand.cs
@@ -0,0 +1,13 @@
+namespace eShopOnContainers.Core.Models.Catalog
+{
+ public class CatalogBrand
+ {
+ public int CatalogBrandId { get; set; }
+ public string Name { get; set; }
+
+ public override string ToString()
+ {
+ return Name;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Catalog/CatalogItem.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Catalog/CatalogItem.cs
index 95dff1f60..649afa008 100644
--- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Catalog/CatalogItem.cs
+++ b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Catalog/CatalogItem.cs
@@ -11,6 +11,5 @@
public string CatalogBrand { get; set; }
public int CatalogTypeId { get; set; }
public string CatalogType { get; set; }
-
}
}
\ No newline at end of file
diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Catalog/CatalogType.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Catalog/CatalogType.cs
new file mode 100644
index 000000000..55277463c
--- /dev/null
+++ b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Catalog/CatalogType.cs
@@ -0,0 +1,13 @@
+namespace eShopOnContainers.Core.Models.Catalog
+{
+ public class CatalogType
+ {
+ public int CatalogTypeId { get; set; }
+ public string Name { get; set; }
+
+ public override string ToString()
+ {
+ return Name;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Navigation/TabParameter.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Navigation/TabParameter.cs
new file mode 100644
index 000000000..8fbf2b495
--- /dev/null
+++ b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Navigation/TabParameter.cs
@@ -0,0 +1,7 @@
+namespace eShopOnContainers.Core.Models.Navigation
+{
+ public class TabParameter
+ {
+ public int TabIndex { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Orders/Order.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Orders/Order.cs
index dc40b5cf8..256ba9cd9 100644
--- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Orders/Order.cs
+++ b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Orders/Order.cs
@@ -6,7 +6,7 @@ namespace eShopOnContainers.Core.Models.Orders
public class Order
{
public int SequenceNumber { get; set; }
- public double Total { get; set; }
+ public decimal Total { get; set; }
public DateTime OrderDate { get; set; }
public OrderStatus Status { get; set; }
public User.User ShippingAddress { get; set; }
diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Orders/OrderItem.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Orders/OrderItem.cs
index 77bf8b220..ada28ef5f 100644
--- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Orders/OrderItem.cs
+++ b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Orders/OrderItem.cs
@@ -1,5 +1,9 @@
-using eShopOnContainers.ViewModels.Base;
+using eShopOnContainers.Core.Helpers;
+using eShopOnContainers.Core.ViewModels.Base;
+using eShopOnContainers.ViewModels.Base;
using System;
+using System.Collections.ObjectModel;
+using Xamarin.Forms;
namespace eShopOnContainers.Core.Models.Orders
{
@@ -12,6 +16,12 @@ namespace eShopOnContainers.Core.Models.Orders
private decimal _unitPrice;
private int _quantity;
private decimal _discount;
+ private ObservableCollection _numbers;
+
+ public OrderItem()
+ {
+ Numbers = NumericHelper.GetNumericList();
+ }
public int ProductId
{
@@ -60,6 +70,9 @@ namespace eShopOnContainers.Core.Models.Orders
{
_quantity = value;
RaisePropertyChanged(() => Quantity);
+ RaisePropertyChanged(() => Total);
+
+ MessagingCenter.Send(this, MessengerKeys.UpdateProduct);
}
}
@@ -85,9 +98,19 @@ namespace eShopOnContainers.Core.Models.Orders
}
}
+ public ObservableCollection Numbers
+ {
+ get { return _numbers; }
+ set
+ {
+ _numbers = value;
+ RaisePropertyChanged(() => Numbers);
+ }
+ }
+
public override string ToString()
{
return String.Format("Product Id: {0}, Quantity: {1}", ProductId, Quantity);
}
}
-}
+}
\ No newline at end of file
diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Catalog/CatalogMockService.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Catalog/CatalogMockService.cs
index 1282d4782..19447bc6a 100644
--- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Catalog/CatalogMockService.cs
+++ b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Catalog/CatalogMockService.cs
@@ -1,4 +1,5 @@
-using eShopOnContainers.Core.Models.Catalog;
+using eShopOnContainers.Core.Extensions;
+using eShopOnContainers.Core.Models.Catalog;
using System;
using System.Collections.ObjectModel;
using System.Linq;
@@ -9,11 +10,25 @@ namespace eShopOnContainers.Core.Services.Catalog
{
public class CatalogMockService : ICatalogService
{
+ private ObservableCollection MockCatalogBrand = new ObservableCollection
+ {
+ new CatalogBrand { CatalogBrandId = 1, Name = "Azure" },
+ new CatalogBrand { CatalogBrandId = 2, Name = "Visual Studio" }
+ };
+
+ private ObservableCollection MockCatalogType = new ObservableCollection
+ {
+ new CatalogType { CatalogTypeId = 1, Name = "Mug" },
+ new CatalogType { CatalogTypeId = 2, Name = "T-Shirt" }
+ };
+
private ObservableCollection MockCatalog = new ObservableCollection
{
- new CatalogItem { Id = "1", PictureUri = Device.OS != TargetPlatform.Windows? "fake_product_01" : "Assets/fake_product_01.png", Name = ".NET Bot Blue Sweatshirt (M)", Price = 19.50M },
- new CatalogItem { Id = "2", PictureUri = Device.OS != TargetPlatform.Windows? "fake_product_02": "Assets/fake_product_02.png", Name = ".NET Bot Purple Sweatshirt (M)", Price = 19.50M },
- new CatalogItem { Id = "3", PictureUri = Device.OS != TargetPlatform.Windows? "fake_product_03": "Assets/fake_product_03.png", Name = ".NET Bot Black Sweatshirt (M)", Price = 19.95M }
+ new CatalogItem { Id = "1", PictureUri = Device.OS != TargetPlatform.Windows? "fake_product_01" : "Assets/fake_product_01.png", Name = ".NET Bot Blue Sweatshirt (M)", Price = 19.50M, CatalogBrand = "Visual Studio", CatalogType = "T-Shirt" },
+ new CatalogItem { Id = "2", PictureUri = Device.OS != TargetPlatform.Windows? "fake_product_02": "Assets/fake_product_02.png", Name = ".NET Bot Purple Sweatshirt (M)", Price = 19.50M, CatalogBrand = "Visual Studio", CatalogType = "T-Shirt" },
+ new CatalogItem { Id = "3", PictureUri = Device.OS != TargetPlatform.Windows? "fake_product_03": "Assets/fake_product_03.png", Name = ".NET Bot Black Sweatshirt (M)", Price = 19.95M, CatalogBrand = "Visual Studio", CatalogType = "T-Shirt" },
+ new CatalogItem { Id = "4", PictureUri = Device.OS != TargetPlatform.Windows? "fake_product_04": "Assets/fake_product_04.png", Name = ".NET Black Cupt", Price = 17.00M, CatalogBrand = "Visual Studio", CatalogType = "Mug" },
+ new CatalogItem { Id = "5", PictureUri = Device.OS != TargetPlatform.Windows? "fake_product_05": "Assets/fake_product_05.png", Name = "Azure Black Sweatshirt (M)", Price = 19.50M, CatalogBrand = "Azure", CatalogType = "T-Shirt" }
};
public async Task> GetCatalogAsync()
@@ -23,6 +38,30 @@ namespace eShopOnContainers.Core.Services.Catalog
return MockCatalog;
}
+ public async Task> FilterAsync(string catalogBrand, string catalogType)
+ {
+ await Task.Delay(500);
+
+ return MockCatalog
+ .Where(c => c.CatalogBrand.Equals(catalogBrand, StringComparison.CurrentCultureIgnoreCase) &&
+ c.CatalogType.Equals(catalogType, StringComparison.CurrentCultureIgnoreCase))
+ .ToObservableCollection();
+ }
+
+ public async Task> GetCatalogBrandAsync()
+ {
+ await Task.Delay(500);
+
+ return MockCatalogBrand;
+ }
+
+ public async Task> GetCatalogTypeAsync()
+ {
+ await Task.Delay(500);
+
+ return MockCatalogType;
+ }
+
public async Task GetCatalogItemAsync(string id)
{
await Task.Delay(500);
diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Catalog/ICatalogService.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Catalog/ICatalogService.cs
index 4cac65467..e6817a8a9 100644
--- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Catalog/ICatalogService.cs
+++ b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Catalog/ICatalogService.cs
@@ -6,6 +6,9 @@ namespace eShopOnContainers.Core.Services.Catalog
{
public interface ICatalogService
{
+ Task> GetCatalogBrandAsync();
+ Task> FilterAsync(string catalogBrand, string catalogType);
+ Task> GetCatalogTypeAsync();
Task> GetCatalogAsync();
Task GetCatalogItemAsync(string id);
}
diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Navigation/NavigationService.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Navigation/NavigationService.cs
index 638a71f15..69669af9c 100644
--- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Navigation/NavigationService.cs
+++ b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Navigation/NavigationService.cs
@@ -149,6 +149,7 @@ namespace eShopOnContainers.Services
{
_mappings.Add(typeof(CartViewModel), typeof(CartView));
_mappings.Add(typeof(CatalogViewModel), typeof(CatalogView));
+ _mappings.Add(typeof(CheckoutViewModel), typeof(CheckoutView));
_mappings.Add(typeof(LoginViewModel), typeof(LoginView));
_mappings.Add(typeof(MainViewModel), typeof(MainView));
_mappings.Add(typeof(OrderDetailViewModel), typeof(OrderDetailView));
diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Orders/OrdersMockService.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Orders/OrdersMockService.cs
index 351975663..9c4a7b42c 100644
--- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Orders/OrdersMockService.cs
+++ b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Orders/OrdersMockService.cs
@@ -14,9 +14,9 @@ namespace eShopOnContainers.Core.Services.Orders
return new ObservableCollection
{
- new Order { SequenceNumber = 123, Total = 56.40, OrderDate = DateTime.Now, Status = OrderStatus.Delivered, OrderItems = GetOrderItems() },
- new Order { SequenceNumber = 132, Total = 56.40, OrderDate = DateTime.Now, Status = OrderStatus.Delivered, OrderItems = GetOrderItems() },
- new Order { SequenceNumber = 231, Total = 56.40, OrderDate = DateTime.Now, Status = OrderStatus.Delivered, OrderItems = GetOrderItems() },
+ new Order { SequenceNumber = 123, Total = 56.40M, OrderDate = DateTime.Now, Status = OrderStatus.Delivered, OrderItems = GetOrderItems() },
+ new Order { SequenceNumber = 132, Total = 56.40M, OrderDate = DateTime.Now, Status = OrderStatus.Delivered, OrderItems = GetOrderItems() },
+ new Order { SequenceNumber = 231, Total = 56.40M, OrderDate = DateTime.Now, Status = OrderStatus.Delivered, OrderItems = GetOrderItems() },
};
}
@@ -24,7 +24,7 @@ namespace eShopOnContainers.Core.Services.Orders
{
await Task.Delay(500);
- return new Order { SequenceNumber = 0123456789, Total = 56.40, OrderDate = DateTime.Now, Status = OrderStatus.Pending, OrderItems = GetOrderItems() };
+ return new Order { SequenceNumber = 0123456789, Total = 56.40M, OrderDate = DateTime.Now, Status = OrderStatus.Pending, OrderItems = GetOrderItems() };
}
private List GetOrderItems()
diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/User/IUserService.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/User/IUserService.cs
new file mode 100644
index 000000000..4ed3e5755
--- /dev/null
+++ b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/User/IUserService.cs
@@ -0,0 +1,9 @@
+using System.Threading.Tasks;
+
+namespace eShopOnContainers.Core.Services.User
+{
+ public interface IUserService
+ {
+ Task GetUserAsync();
+ }
+}
diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/User/UserMockService.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/User/UserMockService.cs
new file mode 100644
index 000000000..67f7a0bb1
--- /dev/null
+++ b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/User/UserMockService.cs
@@ -0,0 +1,24 @@
+using System.Threading.Tasks;
+
+namespace eShopOnContainers.Core.Services.User
+{
+ public class UserMockService : IUserService
+ {
+ private Models.User.User MockUser = new Models.User.User
+ {
+ Name = "Jhon",
+ LastName = "Doe",
+ City = "Seattle, WA",
+ Street = "120 E 87th Street",
+ CountryCode = "98122",
+ Country = "United States"
+ };
+
+ public async Task GetUserAsync()
+ {
+ await Task.Delay(500);
+
+ return MockUser;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/Base/MessengerKeys.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/Base/MessengerKeys.cs
index b5e1bdb46..ec49e8802 100644
--- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/Base/MessengerKeys.cs
+++ b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/Base/MessengerKeys.cs
@@ -4,5 +4,14 @@
{
// Add product to cart
public const string AddProduct = "AddProduct";
+
+ // Update product cart
+ public const string UpdateProduct = "UpdateProduct";
+
+ // Filter
+ public const string Filter = "Filter";
+
+ // Change selected Tab programmatically
+ public const string ChangeTab = "ChangeTab";
}
}
diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/Base/ViewModelLocator.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/Base/ViewModelLocator.cs
index f8f351a0c..578bfe482 100644
--- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/Base/ViewModelLocator.cs
+++ b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/Base/ViewModelLocator.cs
@@ -5,6 +5,7 @@ using eShopOnContainers.Services;
using System;
using eShopOnContainers.Core.Services.Catalog;
using eShopOnContainers.Core.Services.OpenUrl;
+using eShopOnContainers.Core.Services.User;
namespace eShopOnContainers.ViewModels.Base
{
@@ -16,10 +17,7 @@ namespace eShopOnContainers.ViewModels.Base
public static ViewModelLocator Instance
{
- get
- {
- return _instance;
- }
+ get { return _instance; }
}
protected ViewModelLocator()
@@ -30,12 +28,15 @@ namespace eShopOnContainers.ViewModels.Base
_unityContainer.RegisterType();
RegisterSingleton();
_unityContainer.RegisterType();
+
_unityContainer.RegisterType();
_unityContainer.RegisterType();
+ _unityContainer.RegisterType();
// view models
_unityContainer.RegisterType();
_unityContainer.RegisterType();
+ _unityContainer.RegisterType();
_unityContainer.RegisterType();
_unityContainer.RegisterType();
_unityContainer.RegisterType();
@@ -67,4 +68,4 @@ namespace eShopOnContainers.ViewModels.Base
_unityContainer.RegisterType(new ContainerControlledLifetimeManager());
}
}
-}
+}
\ No newline at end of file
diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/CartViewModel.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/CartViewModel.cs
index 238d5e2e0..8001fa834 100644
--- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/CartViewModel.cs
+++ b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/CartViewModel.cs
@@ -1,4 +1,5 @@
-using eShopOnContainers.Core.Models.Catalog;
+using eShopOnContainers.Core.Helpers;
+using eShopOnContainers.Core.Models.Catalog;
using eShopOnContainers.Core.Models.Orders;
using eShopOnContainers.Core.Services.Orders;
using eShopOnContainers.Core.ViewModels.Base;
@@ -7,6 +8,7 @@ using System;
using System.Collections.ObjectModel;
using System.Linq;
using System.Threading.Tasks;
+using System.Windows.Input;
using Xamarin.Forms;
namespace eShopOnContainers.Core.ViewModels
@@ -43,7 +45,7 @@ namespace eShopOnContainers.Core.ViewModels
RaisePropertyChanged(() => OrderItems);
}
}
-
+
public decimal Total
{
get { return _total; }
@@ -54,6 +56,8 @@ namespace eShopOnContainers.Core.ViewModels
}
}
+ public ICommand CheckoutCommand => new Command(Checkout);
+
public override Task InitializeAsync(object navigationData)
{
MessagingCenter.Subscribe(this, MessengerKeys.AddProduct, (sender, arg) =>
@@ -62,6 +66,11 @@ namespace eShopOnContainers.Core.ViewModels
AddCartItem(arg);
});
+
+ MessagingCenter.Subscribe(this, MessengerKeys.UpdateProduct, (sender) =>
+ {
+ ReCalculateTotal();
+ });
OrderItems = new ObservableCollection();
@@ -99,5 +108,10 @@ namespace eShopOnContainers.Core.ViewModels
Total += orderItem.Total;
}
}
+
+ private void Checkout()
+ {
+ NavigationService.NavigateToAsync(OrderItems);
+ }
}
-}
+}
\ No newline at end of file
diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/CatalogViewModel.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/CatalogViewModel.cs
index 58076add3..bbdfea6ec 100644
--- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/CatalogViewModel.cs
+++ b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/CatalogViewModel.cs
@@ -12,6 +12,10 @@ namespace eShopOnContainers.Core.ViewModels
public class CatalogViewModel : ViewModelBase
{
private ObservableCollection _products;
+ private ObservableCollection _brands;
+ private CatalogBrand _brand;
+ private ObservableCollection _types;
+ private CatalogType _type;
private ICatalogService _productsService;
@@ -30,13 +34,63 @@ namespace eShopOnContainers.Core.ViewModels
}
}
+ public ObservableCollection Brands
+ {
+ get { return _brands; }
+ set
+ {
+ _brands = value;
+ RaisePropertyChanged(() => Brands);
+ }
+ }
+
+ public CatalogBrand Brand
+ {
+ get { return _brand; }
+ set
+ {
+ _brand = value;
+ RaisePropertyChanged(() => Brand);
+ RaisePropertyChanged(() => IsFilter);
+ }
+ }
+
+ public ObservableCollection Types
+ {
+ get { return _types; }
+ set
+ {
+ _types = value;
+ RaisePropertyChanged(() => Types);
+ }
+ }
+
+ public CatalogType Type
+ {
+ get { return _type; }
+ set
+ {
+ _type = value;
+ RaisePropertyChanged(() => Type);
+ RaisePropertyChanged(() => IsFilter);
+ }
+ }
+
+ public bool IsFilter { get { return Brand != null || Type != null; } }
+
public ICommand AddCatalogItemCommand => new Command(AddCatalogItem);
+ public ICommand FilterCommand => new Command(Filter);
+
+ public ICommand ClearFilterCommand => new Command(ClearFilter);
+
public override async Task InitializeAsync(object navigationData)
{
IsBusy = true;
Products = await _productsService.GetCatalogAsync();
+ Brands = await _productsService.GetCatalogBrandAsync();
+ Types = await _productsService.GetCatalogTypeAsync();
IsBusy = false;
}
@@ -45,5 +99,31 @@ namespace eShopOnContainers.Core.ViewModels
{
MessagingCenter.Send(this, MessengerKeys.AddProduct, catalogItem);
}
+
+ private async void Filter()
+ {
+ if(Brand == null && Type == null)
+ {
+ return;
+ }
+
+ IsBusy = true;
+
+ MessagingCenter.Send(this, MessengerKeys.Filter);
+ Products = await _productsService.FilterAsync(Brand.Name, Type.Name);
+
+ IsBusy = false;
+ }
+
+ private async void ClearFilter()
+ {
+ IsBusy = true;
+
+ Brand = null;
+ Type = null;
+ Products = await _productsService.GetCatalogAsync();
+
+ IsBusy = false;
+ }
}
-}
+}
\ No newline at end of file
diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/CheckoutViewModel.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/CheckoutViewModel.cs
new file mode 100644
index 000000000..938170d6a
--- /dev/null
+++ b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/CheckoutViewModel.cs
@@ -0,0 +1,106 @@
+using eShopOnContainers.Core.Models.Navigation;
+using eShopOnContainers.Core.Services.User;
+using eShopOnContainers.ViewModels.Base;
+using System.Windows.Input;
+using Xamarin.Forms;
+using System.Threading.Tasks;
+using eShopOnContainers.Core.Models.User;
+using eShopOnContainers.Core.Models.Orders;
+using System;
+using System.Collections.ObjectModel;
+using System.Linq;
+
+namespace eShopOnContainers.Core.ViewModels
+{
+ public class CheckoutViewModel : ViewModelBase
+ {
+ private ObservableCollection _orderItems;
+ private Order _order;
+ private User _user;
+
+ private IUserService _userService;
+
+ public CheckoutViewModel(IUserService userService)
+ {
+ _userService = userService;
+ }
+
+ public ObservableCollection OrderItems
+ {
+ get { return _orderItems; }
+ set
+ {
+ _orderItems = value;
+ RaisePropertyChanged(() => OrderItems);
+ }
+ }
+
+ public Order Order
+ {
+ get { return _order; }
+ set
+ {
+ _order = value;
+ RaisePropertyChanged(() => Order);
+ }
+ }
+
+ public User User
+ {
+ get { return _user; }
+ set
+ {
+ _user = value;
+ RaisePropertyChanged(() => User);
+ }
+ }
+
+ public ICommand CheckoutCommand => new Command(Checkout);
+
+ public override async Task InitializeAsync(object navigationData)
+ {
+ if (navigationData is ObservableCollection)
+ {
+ IsBusy = true;
+
+ var orderItems = ((ObservableCollection)navigationData);
+
+ OrderItems = orderItems;
+
+ User = await _userService.GetUserAsync();
+
+ Order = new Order
+ {
+ ShippingAddress = User,
+ OrderItems = orderItems.ToList(),
+ Status = OrderStatus.Pending,
+ OrderDate = DateTime.Now,
+ Total = GetOrderTotal()
+ };
+
+ IsBusy = false;
+ }
+ }
+
+ private async void Checkout()
+ {
+ await NavigationService.NavigateToAsync(new TabParameter { TabIndex = 1 });
+ await NavigationService.RemoveLastFromBackStackAsync();
+
+ await DialogService.ShowAlertAsync("Order sent successfully", string.Format("Order {0}", Order.OrderNumber), "Ok");
+ await NavigationService.RemoveLastFromBackStackAsync();
+ }
+
+ private decimal GetOrderTotal()
+ {
+ decimal total = 0;
+
+ foreach (var orderItem in OrderItems)
+ {
+ total += orderItem.Total;
+ }
+
+ return total;
+ }
+ }
+}
diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/MainViewModel.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/MainViewModel.cs
index 097b92869..cf7d8032d 100644
--- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/MainViewModel.cs
+++ b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/MainViewModel.cs
@@ -1,9 +1,22 @@
-using eShopOnContainers.ViewModels.Base;
+using System.Threading.Tasks;
+using eShopOnContainers.ViewModels.Base;
+using eShopOnContainers.Core.Models.Navigation;
+using Xamarin.Forms;
+using eShopOnContainers.Core.ViewModels.Base;
namespace eShopOnContainers.Core.ViewModels
{
public class MainViewModel : ViewModelBase
{
-
+ public override Task InitializeAsync(object navigationData)
+ {
+ if (navigationData is TabParameter)
+ {
+ var tabIndex = ((TabParameter)navigationData).TabIndex;
+ MessagingCenter.Send(this, MessengerKeys.ChangeTab, tabIndex);
+ }
+
+ return base.InitializeAsync(navigationData);
+ }
}
-}
+}
\ No newline at end of file
diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/OrderDetailViewModel.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/OrderDetailViewModel.cs
index b82e2ffae..9d63851f6 100644
--- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/OrderDetailViewModel.cs
+++ b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/OrderDetailViewModel.cs
@@ -3,21 +3,27 @@ using eShopOnContainers.Core.Models.Orders;
using eShopOnContainers.ViewModels.Base;
using eShopOnContainers.Core.Services.Orders;
using eShopOnContainers.Core.Services.Catalog;
+using eShopOnContainers.Core.Services.User;
+using eShopOnContainers.Core.Models.User;
namespace eShopOnContainers.Core.ViewModels
{
public class OrderDetailViewModel : ViewModelBase
{
private Order _order;
+ private User _user;
private IOrdersService _orderService;
private ICatalogService _catalogService;
+ private IUserService _userService;
public OrderDetailViewModel(IOrdersService orderService,
- ICatalogService catalogService)
+ ICatalogService catalogService,
+ IUserService userService)
{
_orderService = orderService;
_catalogService = catalogService;
+ _userService = userService;
}
public Order Order
@@ -30,6 +36,16 @@ namespace eShopOnContainers.Core.ViewModels
}
}
+ public User User
+ {
+ get { return _user; }
+ set
+ {
+ _user = value;
+ RaisePropertyChanged(() => User);
+ }
+ }
+
public override async Task InitializeAsync(object navigationData)
{
if(navigationData is Order)
@@ -45,6 +61,7 @@ namespace eShopOnContainers.Core.ViewModels
}
Order = order;
+ User = await _userService.GetUserAsync();
IsBusy = false;
}
diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/CartView.xaml b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/CartView.xaml
index ee7f9eacf..c3c127656 100644
--- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/CartView.xaml
+++ b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/CartView.xaml
@@ -81,7 +81,7 @@
-
+
diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/CatalogView.xaml b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/CatalogView.xaml
index 4b2db156d..6f6220146 100644
--- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/CatalogView.xaml
+++ b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/CatalogView.xaml
@@ -30,7 +30,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
(this, MessengerKeys.Filter, (sender) =>
+ {
+ Filter();
+ });
}
public Action HideMenuAction
@@ -31,7 +42,20 @@ namespace eShopOnContainers.Core.Views
set;
}
+
+ protected override void OnBindingContextChanged()
+ {
+ base.OnBindingContextChanged();
+
+ _filterView.BindingContext = BindingContext;
+ }
+
private void OnFilterChanged(object sender, EventArgs e)
+ {
+ Filter();
+ }
+
+ private void Filter()
{
if (SlideMenu.IsShown)
{
diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/CheckoutView.xaml b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/CheckoutView.xaml
new file mode 100644
index 000000000..2cc066c56
--- /dev/null
+++ b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/CheckoutView.xaml
@@ -0,0 +1,243 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/CheckoutView.xaml.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/CheckoutView.xaml.cs
new file mode 100644
index 000000000..f6a5f00b5
--- /dev/null
+++ b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/CheckoutView.xaml.cs
@@ -0,0 +1,12 @@
+using Xamarin.Forms;
+
+namespace eShopOnContainers.Core.Views
+{
+ public partial class CheckoutView : ContentPage
+ {
+ public CheckoutView()
+ {
+ InitializeComponent();
+ }
+ }
+}
diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/FiltersView.xaml b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/FiltersView.xaml
index ba7cc5e3f..ba6f4b0fa 100644
--- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/FiltersView.xaml
+++ b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/FiltersView.xaml
@@ -2,71 +2,93 @@
-
-
+
+
-
-
-
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/MainView.xaml.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/MainView.xaml.cs
index 95a067d2e..9db63b917 100644
--- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/MainView.xaml.cs
+++ b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/MainView.xaml.cs
@@ -1,4 +1,5 @@
using eShopOnContainers.Core.ViewModels;
+using eShopOnContainers.Core.ViewModels.Base;
using eShopOnContainers.ViewModels.Base;
using Xamarin.Forms;
@@ -15,6 +16,22 @@ namespace eShopOnContainers.Core.Views
{
base.OnAppearing();
+ MessagingCenter.Subscribe(this, MessengerKeys.ChangeTab, (sender, arg) =>
+ {
+ switch(arg)
+ {
+ case 0:
+ CurrentPage = HomeView;
+ break;
+ case 1:
+ CurrentPage = ProfileView;
+ break;
+ case 2:
+ CurrentPage = CartView;
+ break;
+ }
+ });
+
var homeViewModel = ViewModelLocator.Instance.Resolve();
await homeViewModel.InitializeAsync(null);
HomeView.BindingContext = homeViewModel;
diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/OrderDetailView.xaml b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/OrderDetailView.xaml
index 6ad746727..08068718f 100644
--- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/OrderDetailView.xaml
+++ b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/OrderDetailView.xaml
@@ -176,16 +176,16 @@
diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/OrderDetailView.xaml.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/OrderDetailView.xaml.cs
index eecb25ad5..10f6269c3 100644
--- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/OrderDetailView.xaml.cs
+++ b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/OrderDetailView.xaml.cs
@@ -9,4 +9,4 @@ namespace eShopOnContainers.Core.Views
InitializeComponent();
}
}
-}
+}
\ No newline at end of file
diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/ProfileView.xaml.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/ProfileView.xaml.cs
index 626b59942..aba69315a 100644
--- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/ProfileView.xaml.cs
+++ b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/ProfileView.xaml.cs
@@ -9,4 +9,4 @@ namespace eShopOnContainers.Core.Views
InitializeComponent();
}
}
-}
+}
\ No newline at end of file
diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/Templates/CartOrderItemTemplate.xaml b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/Templates/CartOrderItemTemplate.xaml
new file mode 100644
index 000000000..9ae0a3df0
--- /dev/null
+++ b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/Templates/CartOrderItemTemplate.xaml
@@ -0,0 +1,134 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/Templates/CartOrderItemTemplate.xaml.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/Templates/CartOrderItemTemplate.xaml.cs
new file mode 100644
index 000000000..8e954487b
--- /dev/null
+++ b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/Templates/CartOrderItemTemplate.xaml.cs
@@ -0,0 +1,12 @@
+using Xamarin.Forms;
+
+namespace eShopOnContainers.Core.Views.Templates
+{
+ public partial class CartOrderItemTemplate : ContentView
+ {
+ public CartOrderItemTemplate()
+ {
+ InitializeComponent();
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/eShopOnContainers.Core.csproj b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/eShopOnContainers.Core.csproj
index e5bf61cd8..3ebfa339e 100644
--- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/eShopOnContainers.Core.csproj
+++ b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/eShopOnContainers.Core.csproj
@@ -49,13 +49,19 @@
+
+
+
+
+
+
@@ -72,6 +78,8 @@
+
+
@@ -83,6 +91,7 @@
+
@@ -90,6 +99,9 @@
CartView.xaml
+
+ CheckoutView.xaml
+
CustomNavigationPage.xaml
@@ -111,6 +123,9 @@
ProfileView.xaml
+
+ CartOrderItemTemplate.xaml
+
OrderItemTemplate.xaml
@@ -267,6 +282,18 @@
Designer
+
+
+ MSBuild:UpdateDesignTimeXaml
+ Designer
+
+
+
+
+ MSBuild:UpdateDesignTimeXaml
+ Designer
+
+
diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Droid/Activities/MainActivity.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Droid/Activities/MainActivity.cs
index 566b264d3..108506e4f 100644
--- a/src/Mobile/eShopOnContainers/eShopOnContainers.Droid/Activities/MainActivity.cs
+++ b/src/Mobile/eShopOnContainers/eShopOnContainers.Droid/Activities/MainActivity.cs
@@ -4,6 +4,7 @@ using Android.Content.PM;
using Android.Views;
using Xamarin.Forms.Platform.Android;
using FFImageLoading.Forms.Droid;
+using Acr.UserDialogs;
namespace eShopOnContainers.Droid.Activities
{
@@ -28,6 +29,7 @@ namespace eShopOnContainers.Droid.Activities
SupportActionBar.SetDisplayShowTitleEnabled(false);
global::Xamarin.Forms.Forms.Init(this, bundle);
+ UserDialogs.Init(this);
CachedImageRenderer.Init();
LoadApplication(new App());
diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Droid/Resources/Resource.Designer.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Droid/Resources/Resource.Designer.cs
index b1f70bdf9..bb05301c1 100644
--- a/src/Mobile/eShopOnContainers/eShopOnContainers.Droid/Resources/Resource.Designer.cs
+++ b/src/Mobile/eShopOnContainers/eShopOnContainers.Droid/Resources/Resource.Designer.cs
@@ -2039,289 +2039,295 @@ namespace eShopOnContainers.Droid
public const int fake_product_03 = 2130837584;
// aapt resource value: 0x7f020051
- public const int ic_audiotrack = 2130837585;
+ public const int fake_product_04 = 2130837585;
// aapt resource value: 0x7f020052
- public const int ic_audiotrack_light = 2130837586;
+ public const int fake_product_05 = 2130837586;
// aapt resource value: 0x7f020053
- public const int ic_bluetooth_grey = 2130837587;
+ public const int ic_audiotrack = 2130837587;
// aapt resource value: 0x7f020054
- public const int ic_bluetooth_white = 2130837588;
+ public const int ic_audiotrack_light = 2130837588;
// aapt resource value: 0x7f020055
- public const int ic_cast_dark = 2130837589;
+ public const int ic_bluetooth_grey = 2130837589;
// aapt resource value: 0x7f020056
- public const int ic_cast_disabled_light = 2130837590;
+ public const int ic_bluetooth_white = 2130837590;
// aapt resource value: 0x7f020057
- public const int ic_cast_grey = 2130837591;
+ public const int ic_cast_dark = 2130837591;
// aapt resource value: 0x7f020058
- public const int ic_cast_light = 2130837592;
+ public const int ic_cast_disabled_light = 2130837592;
// aapt resource value: 0x7f020059
- public const int ic_cast_off_light = 2130837593;
+ public const int ic_cast_grey = 2130837593;
// aapt resource value: 0x7f02005a
- public const int ic_cast_on_0_light = 2130837594;
+ public const int ic_cast_light = 2130837594;
// aapt resource value: 0x7f02005b
- public const int ic_cast_on_1_light = 2130837595;
+ public const int ic_cast_off_light = 2130837595;
// aapt resource value: 0x7f02005c
- public const int ic_cast_on_2_light = 2130837596;
+ public const int ic_cast_on_0_light = 2130837596;
// aapt resource value: 0x7f02005d
- public const int ic_cast_on_light = 2130837597;
+ public const int ic_cast_on_1_light = 2130837597;
// aapt resource value: 0x7f02005e
- public const int ic_cast_white = 2130837598;
+ public const int ic_cast_on_2_light = 2130837598;
// aapt resource value: 0x7f02005f
- public const int ic_close_dark = 2130837599;
+ public const int ic_cast_on_light = 2130837599;
// aapt resource value: 0x7f020060
- public const int ic_close_light = 2130837600;
+ public const int ic_cast_white = 2130837600;
// aapt resource value: 0x7f020061
- public const int ic_collapse = 2130837601;
+ public const int ic_close_dark = 2130837601;
// aapt resource value: 0x7f020062
- public const int ic_collapse_00000 = 2130837602;
+ public const int ic_close_light = 2130837602;
// aapt resource value: 0x7f020063
- public const int ic_collapse_00001 = 2130837603;
+ public const int ic_collapse = 2130837603;
// aapt resource value: 0x7f020064
- public const int ic_collapse_00002 = 2130837604;
+ public const int ic_collapse_00000 = 2130837604;
// aapt resource value: 0x7f020065
- public const int ic_collapse_00003 = 2130837605;
+ public const int ic_collapse_00001 = 2130837605;
// aapt resource value: 0x7f020066
- public const int ic_collapse_00004 = 2130837606;
+ public const int ic_collapse_00002 = 2130837606;
// aapt resource value: 0x7f020067
- public const int ic_collapse_00005 = 2130837607;
+ public const int ic_collapse_00003 = 2130837607;
// aapt resource value: 0x7f020068
- public const int ic_collapse_00006 = 2130837608;
+ public const int ic_collapse_00004 = 2130837608;
// aapt resource value: 0x7f020069
- public const int ic_collapse_00007 = 2130837609;
+ public const int ic_collapse_00005 = 2130837609;
// aapt resource value: 0x7f02006a
- public const int ic_collapse_00008 = 2130837610;
+ public const int ic_collapse_00006 = 2130837610;
// aapt resource value: 0x7f02006b
- public const int ic_collapse_00009 = 2130837611;
+ public const int ic_collapse_00007 = 2130837611;
// aapt resource value: 0x7f02006c
- public const int ic_collapse_00010 = 2130837612;
+ public const int ic_collapse_00008 = 2130837612;
// aapt resource value: 0x7f02006d
- public const int ic_collapse_00011 = 2130837613;
+ public const int ic_collapse_00009 = 2130837613;
// aapt resource value: 0x7f02006e
- public const int ic_collapse_00012 = 2130837614;
+ public const int ic_collapse_00010 = 2130837614;
// aapt resource value: 0x7f02006f
- public const int ic_collapse_00013 = 2130837615;
+ public const int ic_collapse_00011 = 2130837615;
// aapt resource value: 0x7f020070
- public const int ic_collapse_00014 = 2130837616;
+ public const int ic_collapse_00012 = 2130837616;
// aapt resource value: 0x7f020071
- public const int ic_collapse_00015 = 2130837617;
+ public const int ic_collapse_00013 = 2130837617;
// aapt resource value: 0x7f020072
- public const int ic_errorstatus = 2130837618;
+ public const int ic_collapse_00014 = 2130837618;
// aapt resource value: 0x7f020073
- public const int ic_expand = 2130837619;
+ public const int ic_collapse_00015 = 2130837619;
// aapt resource value: 0x7f020074
- public const int ic_expand_00000 = 2130837620;
+ public const int ic_errorstatus = 2130837620;
// aapt resource value: 0x7f020075
- public const int ic_expand_00001 = 2130837621;
+ public const int ic_expand = 2130837621;
// aapt resource value: 0x7f020076
- public const int ic_expand_00002 = 2130837622;
+ public const int ic_expand_00000 = 2130837622;
// aapt resource value: 0x7f020077
- public const int ic_expand_00003 = 2130837623;
+ public const int ic_expand_00001 = 2130837623;
// aapt resource value: 0x7f020078
- public const int ic_expand_00004 = 2130837624;
+ public const int ic_expand_00002 = 2130837624;
// aapt resource value: 0x7f020079
- public const int ic_expand_00005 = 2130837625;
+ public const int ic_expand_00003 = 2130837625;
// aapt resource value: 0x7f02007a
- public const int ic_expand_00006 = 2130837626;
+ public const int ic_expand_00004 = 2130837626;
// aapt resource value: 0x7f02007b
- public const int ic_expand_00007 = 2130837627;
+ public const int ic_expand_00005 = 2130837627;
// aapt resource value: 0x7f02007c
- public const int ic_expand_00008 = 2130837628;
+ public const int ic_expand_00006 = 2130837628;
// aapt resource value: 0x7f02007d
- public const int ic_expand_00009 = 2130837629;
+ public const int ic_expand_00007 = 2130837629;
// aapt resource value: 0x7f02007e
- public const int ic_expand_00010 = 2130837630;
+ public const int ic_expand_00008 = 2130837630;
// aapt resource value: 0x7f02007f
- public const int ic_expand_00011 = 2130837631;
+ public const int ic_expand_00009 = 2130837631;
// aapt resource value: 0x7f020080
- public const int ic_expand_00012 = 2130837632;
+ public const int ic_expand_00010 = 2130837632;
// aapt resource value: 0x7f020081
- public const int ic_expand_00013 = 2130837633;
+ public const int ic_expand_00011 = 2130837633;
// aapt resource value: 0x7f020082
- public const int ic_expand_00014 = 2130837634;
+ public const int ic_expand_00012 = 2130837634;
// aapt resource value: 0x7f020083
- public const int ic_expand_00015 = 2130837635;
+ public const int ic_expand_00013 = 2130837635;
// aapt resource value: 0x7f020084
- public const int ic_media_pause = 2130837636;
+ public const int ic_expand_00014 = 2130837636;
// aapt resource value: 0x7f020085
- public const int ic_media_play = 2130837637;
+ public const int ic_expand_00015 = 2130837637;
// aapt resource value: 0x7f020086
- public const int ic_media_route_disabled_mono_dark = 2130837638;
+ public const int ic_media_pause = 2130837638;
// aapt resource value: 0x7f020087
- public const int ic_media_route_off_mono_dark = 2130837639;
+ public const int ic_media_play = 2130837639;
// aapt resource value: 0x7f020088
- public const int ic_media_route_on_0_mono_dark = 2130837640;
+ public const int ic_media_route_disabled_mono_dark = 2130837640;
// aapt resource value: 0x7f020089
- public const int ic_media_route_on_1_mono_dark = 2130837641;
+ public const int ic_media_route_off_mono_dark = 2130837641;
// aapt resource value: 0x7f02008a
- public const int ic_media_route_on_2_mono_dark = 2130837642;
+ public const int ic_media_route_on_0_mono_dark = 2130837642;
// aapt resource value: 0x7f02008b
- public const int ic_media_route_on_mono_dark = 2130837643;
+ public const int ic_media_route_on_1_mono_dark = 2130837643;
// aapt resource value: 0x7f02008c
- public const int ic_pause_dark = 2130837644;
+ public const int ic_media_route_on_2_mono_dark = 2130837644;
// aapt resource value: 0x7f02008d
- public const int ic_pause_light = 2130837645;
+ public const int ic_media_route_on_mono_dark = 2130837645;
// aapt resource value: 0x7f02008e
- public const int ic_play_dark = 2130837646;
+ public const int ic_pause_dark = 2130837646;
// aapt resource value: 0x7f02008f
- public const int ic_play_light = 2130837647;
+ public const int ic_pause_light = 2130837647;
// aapt resource value: 0x7f020090
- public const int ic_speaker_dark = 2130837648;
+ public const int ic_play_dark = 2130837648;
// aapt resource value: 0x7f020091
- public const int ic_speaker_group_dark = 2130837649;
+ public const int ic_play_light = 2130837649;
// aapt resource value: 0x7f020092
- public const int ic_speaker_group_light = 2130837650;
+ public const int ic_speaker_dark = 2130837650;
// aapt resource value: 0x7f020093
- public const int ic_speaker_light = 2130837651;
+ public const int ic_speaker_group_dark = 2130837651;
// aapt resource value: 0x7f020094
- public const int ic_successstatus = 2130837652;
+ public const int ic_speaker_group_light = 2130837652;
// aapt resource value: 0x7f020095
- public const int ic_tv_dark = 2130837653;
+ public const int ic_speaker_light = 2130837653;
// aapt resource value: 0x7f020096
- public const int ic_tv_light = 2130837654;
+ public const int ic_successstatus = 2130837654;
// aapt resource value: 0x7f020097
- public const int icon = 2130837655;
+ public const int ic_tv_dark = 2130837655;
// aapt resource value: 0x7f020098
- public const int menu_cart = 2130837656;
+ public const int ic_tv_light = 2130837656;
// aapt resource value: 0x7f020099
- public const int menu_filter = 2130837657;
+ public const int icon = 2130837657;
// aapt resource value: 0x7f02009a
- public const int menu_profile = 2130837658;
+ public const int menu_cart = 2130837658;
// aapt resource value: 0x7f02009b
- public const int mr_dialog_material_background_dark = 2130837659;
+ public const int menu_filter = 2130837659;
// aapt resource value: 0x7f02009c
- public const int mr_dialog_material_background_light = 2130837660;
+ public const int menu_profile = 2130837660;
// aapt resource value: 0x7f02009d
- public const int mr_ic_audiotrack_light = 2130837661;
+ public const int mr_dialog_material_background_dark = 2130837661;
// aapt resource value: 0x7f02009e
- public const int mr_ic_cast_dark = 2130837662;
+ public const int mr_dialog_material_background_light = 2130837662;
// aapt resource value: 0x7f02009f
- public const int mr_ic_cast_light = 2130837663;
+ public const int mr_ic_audiotrack_light = 2130837663;
// aapt resource value: 0x7f0200a0
- public const int mr_ic_close_dark = 2130837664;
+ public const int mr_ic_cast_dark = 2130837664;
// aapt resource value: 0x7f0200a1
- public const int mr_ic_close_light = 2130837665;
+ public const int mr_ic_cast_light = 2130837665;
// aapt resource value: 0x7f0200a2
- public const int mr_ic_media_route_connecting_mono_dark = 2130837666;
+ public const int mr_ic_close_dark = 2130837666;
// aapt resource value: 0x7f0200a3
- public const int mr_ic_media_route_connecting_mono_light = 2130837667;
+ public const int mr_ic_close_light = 2130837667;
// aapt resource value: 0x7f0200a4
- public const int mr_ic_media_route_mono_dark = 2130837668;
+ public const int mr_ic_media_route_connecting_mono_dark = 2130837668;
// aapt resource value: 0x7f0200a5
- public const int mr_ic_media_route_mono_light = 2130837669;
+ public const int mr_ic_media_route_connecting_mono_light = 2130837669;
// aapt resource value: 0x7f0200a6
- public const int mr_ic_pause_dark = 2130837670;
+ public const int mr_ic_media_route_mono_dark = 2130837670;
// aapt resource value: 0x7f0200a7
- public const int mr_ic_pause_light = 2130837671;
+ public const int mr_ic_media_route_mono_light = 2130837671;
// aapt resource value: 0x7f0200a8
- public const int mr_ic_play_dark = 2130837672;
+ public const int mr_ic_pause_dark = 2130837672;
// aapt resource value: 0x7f0200a9
- public const int mr_ic_play_light = 2130837673;
-
- // aapt resource value: 0x7f0200af
- public const int notification_template_icon_bg = 2130837679;
+ public const int mr_ic_pause_light = 2130837673;
// aapt resource value: 0x7f0200aa
- public const int product_add = 2130837674;
+ public const int mr_ic_play_dark = 2130837674;
// aapt resource value: 0x7f0200ab
- public const int roundedbg = 2130837675;
+ public const int mr_ic_play_light = 2130837675;
+
+ // aapt resource value: 0x7f0200b1
+ public const int notification_template_icon_bg = 2130837681;
// aapt resource value: 0x7f0200ac
- public const int roundedbgdark = 2130837676;
+ public const int product_add = 2130837676;
// aapt resource value: 0x7f0200ad
- public const int splash_drawable = 2130837677;
+ public const int roundedbg = 2130837677;
// aapt resource value: 0x7f0200ae
- public const int user_profile = 2130837678;
+ public const int roundedbgdark = 2130837678;
+
+ // aapt resource value: 0x7f0200af
+ public const int splash_drawable = 2130837679;
+
+ // aapt resource value: 0x7f0200b0
+ public const int user_profile = 2130837680;
static Drawable()
{
diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Droid/Resources/drawable/fake_product_04.png b/src/Mobile/eShopOnContainers/eShopOnContainers.Droid/Resources/drawable/fake_product_04.png
new file mode 100644
index 000000000..42703194e
Binary files /dev/null and b/src/Mobile/eShopOnContainers/eShopOnContainers.Droid/Resources/drawable/fake_product_04.png differ
diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Droid/Resources/drawable/fake_product_05.png b/src/Mobile/eShopOnContainers/eShopOnContainers.Droid/Resources/drawable/fake_product_05.png
new file mode 100644
index 000000000..a67c69abe
Binary files /dev/null and b/src/Mobile/eShopOnContainers/eShopOnContainers.Droid/Resources/drawable/fake_product_05.png differ
diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Droid/eShopOnContainers.Droid.csproj b/src/Mobile/eShopOnContainers/eShopOnContainers.Droid/eShopOnContainers.Droid.csproj
index 6e1525d17..83c3d49ab 100644
--- a/src/Mobile/eShopOnContainers/eShopOnContainers.Droid/eShopOnContainers.Droid.csproj
+++ b/src/Mobile/eShopOnContainers/eShopOnContainers.Droid/eShopOnContainers.Droid.csproj
@@ -17,7 +17,7 @@
Off
Properties\AndroidManifest.xml
true
- v6.0
+ v7.0
armeabi,armeabi-v7a,x86
@@ -322,6 +322,12 @@
+
+
+
+
+
+
diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Windows/App.xaml b/src/Mobile/eShopOnContainers/eShopOnContainers.Windows/App.xaml
index e6d44a376..059e72563 100644
--- a/src/Mobile/eShopOnContainers/eShopOnContainers.Windows/App.xaml
+++ b/src/Mobile/eShopOnContainers/eShopOnContainers.Windows/App.xaml
@@ -235,6 +235,10 @@
+
+
diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Windows/App.xaml.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Windows/App.xaml.cs
index ea09ccca2..9b74cf102 100644
--- a/src/Mobile/eShopOnContainers/eShopOnContainers.Windows/App.xaml.cs
+++ b/src/Mobile/eShopOnContainers/eShopOnContainers.Windows/App.xaml.cs
@@ -55,7 +55,9 @@ namespace eShopOnContainers.UWP
var assembliesToInclude = new List()
{
typeof(CachedImage).GetTypeInfo().Assembly,
- typeof(CachedImageRenderer).GetTypeInfo().Assembly
+ typeof(CachedImageRenderer).GetTypeInfo().Assembly,
+ typeof(SlideOverKit.MenuContainerPage).GetTypeInfo().Assembly,
+ typeof(SlideOverKit.UWP.MenuContainerPageUWPRenderer).GetTypeInfo().Assembly
};
Xamarin.Forms.Forms.Init(e, assembliesToInclude);
diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Windows/Assets/SplashScreen.scale-200.png b/src/Mobile/eShopOnContainers/eShopOnContainers.Windows/Assets/SplashScreen.scale-200.png
index 023e7f1fe..01becba0f 100644
Binary files a/src/Mobile/eShopOnContainers/eShopOnContainers.Windows/Assets/SplashScreen.scale-200.png and b/src/Mobile/eShopOnContainers/eShopOnContainers.Windows/Assets/SplashScreen.scale-200.png differ
diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Windows/Assets/Square150x150Logo.scale-200.png b/src/Mobile/eShopOnContainers/eShopOnContainers.Windows/Assets/Square150x150Logo.scale-200.png
index af49fec1a..c24bf89fb 100644
Binary files a/src/Mobile/eShopOnContainers/eShopOnContainers.Windows/Assets/Square150x150Logo.scale-200.png and b/src/Mobile/eShopOnContainers/eShopOnContainers.Windows/Assets/Square150x150Logo.scale-200.png differ
diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Windows/Assets/Square44x44Logo.scale-200.png b/src/Mobile/eShopOnContainers/eShopOnContainers.Windows/Assets/Square44x44Logo.scale-200.png
index ce342a2ec..183a9da8a 100644
Binary files a/src/Mobile/eShopOnContainers/eShopOnContainers.Windows/Assets/Square44x44Logo.scale-200.png and b/src/Mobile/eShopOnContainers/eShopOnContainers.Windows/Assets/Square44x44Logo.scale-200.png differ
diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Windows/Assets/Wide310x150Logo.scale-200.png b/src/Mobile/eShopOnContainers/eShopOnContainers.Windows/Assets/Wide310x150Logo.scale-200.png
index 288995b39..630a2c61d 100644
Binary files a/src/Mobile/eShopOnContainers/eShopOnContainers.Windows/Assets/Wide310x150Logo.scale-200.png and b/src/Mobile/eShopOnContainers/eShopOnContainers.Windows/Assets/Wide310x150Logo.scale-200.png differ
diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Windows/Assets/fake_product_04.png b/src/Mobile/eShopOnContainers/eShopOnContainers.Windows/Assets/fake_product_04.png
new file mode 100644
index 000000000..42703194e
Binary files /dev/null and b/src/Mobile/eShopOnContainers/eShopOnContainers.Windows/Assets/fake_product_04.png differ
diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Windows/Assets/fake_product_05.png b/src/Mobile/eShopOnContainers/eShopOnContainers.Windows/Assets/fake_product_05.png
new file mode 100644
index 000000000..a67c69abe
Binary files /dev/null and b/src/Mobile/eShopOnContainers/eShopOnContainers.Windows/Assets/fake_product_05.png differ
diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Windows/Renderers/SlideDownMenuPageRenderer.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Windows/Renderers/SlideDownMenuPageRenderer.cs
new file mode 100644
index 000000000..df6eca53e
--- /dev/null
+++ b/src/Mobile/eShopOnContainers/eShopOnContainers.Windows/Renderers/SlideDownMenuPageRenderer.cs
@@ -0,0 +1,37 @@
+using eShopOnContainers.Core.Views;
+using eShopOnContainers.Windows.Renderers;
+using SlideOverKit.UWP;
+using System;
+using Xamarin.Forms;
+using Xamarin.Forms.Platform.UWP;
+
+[assembly: ExportRenderer(typeof(CatalogView), typeof(SlideDownMenuPageRenderer))]
+namespace eShopOnContainers.Windows.Renderers
+{
+ public class SlideDownMenuPageRenderer : PageRenderer, ISlideOverKitPageRendererUWP
+ {
+ public Action> OnElementChangedEvent { get; set; }
+ SlideOverKitUWPHandler _handler;
+
+ public SlideDownMenuPageRenderer()
+ {
+ _handler = new SlideOverKitUWPHandler();
+ _handler.Init(this);
+ }
+
+ protected override void OnElementChanged(ElementChangedEventArgs e)
+ {
+ base.OnElementChanged(e);
+ if (OnElementChangedEvent != null)
+ OnElementChangedEvent(e);
+ }
+
+ protected override void Dispose(bool disposing)
+ {
+ _handler.Dispose();
+ base.Dispose(disposing);
+ _handler = null;
+ }
+
+ }
+}
diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Windows/eShopOnContainers.Windows.csproj b/src/Mobile/eShopOnContainers/eShopOnContainers.Windows/eShopOnContainers.Windows.csproj
index 06c347159..1cd8baba5 100644
--- a/src/Mobile/eShopOnContainers/eShopOnContainers.Windows/eShopOnContainers.Windows.csproj
+++ b/src/Mobile/eShopOnContainers/eShopOnContainers.Windows/eShopOnContainers.Windows.csproj
@@ -111,6 +111,7 @@
+
@@ -122,6 +123,8 @@
+
+
diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.iOS/Resources/fake_product_04.png b/src/Mobile/eShopOnContainers/eShopOnContainers.iOS/Resources/fake_product_04.png
new file mode 100644
index 000000000..42703194e
Binary files /dev/null and b/src/Mobile/eShopOnContainers/eShopOnContainers.iOS/Resources/fake_product_04.png differ
diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.iOS/Resources/fake_product_05.png b/src/Mobile/eShopOnContainers/eShopOnContainers.iOS/Resources/fake_product_05.png
new file mode 100644
index 000000000..a67c69abe
Binary files /dev/null and b/src/Mobile/eShopOnContainers/eShopOnContainers.iOS/Resources/fake_product_05.png differ
diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.iOS/eShopOnContainers.iOS.csproj b/src/Mobile/eShopOnContainers/eShopOnContainers.iOS/eShopOnContainers.iOS.csproj
index c159b57bc..00d8357dd 100644
--- a/src/Mobile/eShopOnContainers/eShopOnContainers.iOS/eShopOnContainers.iOS.csproj
+++ b/src/Mobile/eShopOnContainers/eShopOnContainers.iOS/eShopOnContainers.iOS.csproj
@@ -240,6 +240,12 @@
+
+
+
+
+
+