Merge pull request #114 from dotnet/revert-85-xamarin
Revert "ViewModelLocator now connects view models to views, rather than NavigationService."
This commit is contained in:
commit
4818f68902
@ -1,6 +1,6 @@
|
|||||||
using eShopOnContainers.Core.Helpers;
|
using eShopOnContainers.Core.Helpers;
|
||||||
using eShopOnContainers.Services;
|
using eShopOnContainers.Services;
|
||||||
using eShopOnContainers.Core.ViewModels.Base;
|
using eShopOnContainers.ViewModels.Base;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Xamarin.Forms;
|
using Xamarin.Forms;
|
||||||
using Xamarin.Forms.Xaml;
|
using Xamarin.Forms.Xaml;
|
||||||
@ -28,13 +28,12 @@ namespace eShopOnContainers
|
|||||||
{
|
{
|
||||||
UseMockServices = Settings.UseMocks;
|
UseMockServices = Settings.UseMocks;
|
||||||
|
|
||||||
ViewModelLocator.Initialize();
|
ViewModelLocator.Instance.UpdateDependencies(UseMockServices);
|
||||||
ViewModelLocator.UpdateDependencies(UseMockServices);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private Task InitNavigation()
|
private Task InitNavigation()
|
||||||
{
|
{
|
||||||
var navigationService = ViewModelLocator.Resolve<INavigationService>();
|
var navigationService = ViewModelLocator.Instance.Resolve<INavigationService>();
|
||||||
return navigationService.InitializeAsync();
|
return navigationService.InitializeAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -0,0 +1,18 @@
|
|||||||
|
using eShopOnContainers.Core.Animations.Base;
|
||||||
|
using System;
|
||||||
|
using Xamarin.Forms;
|
||||||
|
|
||||||
|
namespace eShopOnContainers.Core.Extensions
|
||||||
|
{
|
||||||
|
public static class AnimationExtension
|
||||||
|
{
|
||||||
|
public static async void Animate(this VisualElement visualElement, AnimationBase animation, Action onFinishedCallback = null)
|
||||||
|
{
|
||||||
|
animation.Target = visualElement;
|
||||||
|
|
||||||
|
await animation.Begin();
|
||||||
|
|
||||||
|
onFinishedCallback?.Invoke();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,6 +1,6 @@
|
|||||||
using eShopOnContainers.Core.Models.Basket;
|
using eShopOnContainers.Core.Models.Basket;
|
||||||
using eShopOnContainers.Core.Models.Catalog;
|
using eShopOnContainers.Core.Models.Catalog;
|
||||||
using eShopOnContainers.Core.ViewModels.Base;
|
using eShopOnContainers.ViewModels.Base;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
@ -21,7 +21,7 @@ namespace eShopOnContainers.Core.Helpers
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (!ViewModelLocator.UseMockService
|
if (!ViewModelLocator.Instance.UseMockService
|
||||||
&& Settings.UrlBase != GlobalSetting.DefaultEndpoint)
|
&& Settings.UrlBase != GlobalSetting.DefaultEndpoint)
|
||||||
{
|
{
|
||||||
foreach (var catalogItem in catalogItems)
|
foreach (var catalogItem in catalogItems)
|
||||||
@ -54,7 +54,7 @@ namespace eShopOnContainers.Core.Helpers
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (!ViewModelLocator.UseMockService
|
if (!ViewModelLocator.Instance.UseMockService
|
||||||
&& Settings.UrlBase != GlobalSetting.DefaultEndpoint)
|
&& Settings.UrlBase != GlobalSetting.DefaultEndpoint)
|
||||||
{
|
{
|
||||||
foreach (var basketItem in basketItems)
|
foreach (var basketItem in basketItems)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
using eShopOnContainers.Core.ViewModels.Base;
|
using eShopOnContainers.ViewModels.Base;
|
||||||
using Plugin.Settings;
|
using Plugin.Settings;
|
||||||
using Plugin.Settings.Abstractions;
|
using Plugin.Settings.Abstractions;
|
||||||
|
|
||||||
@ -27,7 +27,7 @@ namespace eShopOnContainers.Core.Helpers
|
|||||||
private const string IdUrlBase = "url_base";
|
private const string IdUrlBase = "url_base";
|
||||||
private static readonly string AccessTokenDefault = string.Empty;
|
private static readonly string AccessTokenDefault = string.Empty;
|
||||||
private static readonly string IdTokenDefault = string.Empty;
|
private static readonly string IdTokenDefault = string.Empty;
|
||||||
private static readonly bool UseMocksDefault = ViewModelLocator.UseMockService;
|
private static readonly bool UseMocksDefault = ViewModelLocator.Instance.UseMockService;
|
||||||
private static readonly string UrlBaseDefault = GlobalSetting.Instance.BaseEndpoint;
|
private static readonly string UrlBaseDefault = GlobalSetting.Instance.BaseEndpoint;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
using eShopOnContainers.Core.ViewModels.Base;
|
using eShopOnContainers.ViewModels.Base;
|
||||||
using System;
|
using System;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
@ -1,10 +1,9 @@
|
|||||||
using eShopOnContainers.Core.Helpers;
|
using eShopOnContainers.Core.Helpers;
|
||||||
using eShopOnContainers.Core.ViewModels;
|
using eShopOnContainers.Core.ViewModels;
|
||||||
using eShopOnContainers.Core.Views;
|
using eShopOnContainers.Core.Views;
|
||||||
using eShopOnContainers.Core.ViewModels.Base;
|
using eShopOnContainers.ViewModels.Base;
|
||||||
using System;
|
using System;
|
||||||
using System.Globalization;
|
using System.Collections.Generic;
|
||||||
using System.Reflection;
|
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Xamarin.Forms;
|
using Xamarin.Forms;
|
||||||
|
|
||||||
@ -12,7 +11,9 @@ namespace eShopOnContainers.Services
|
|||||||
{
|
{
|
||||||
public class NavigationService : INavigationService
|
public class NavigationService : INavigationService
|
||||||
{
|
{
|
||||||
protected Application CurrentApplication
|
protected readonly Dictionary<Type, Type> _mappings;
|
||||||
|
|
||||||
|
protected Application CurrentApplication
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
@ -20,6 +21,13 @@ namespace eShopOnContainers.Services
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public NavigationService()
|
||||||
|
{
|
||||||
|
_mappings = new Dictionary<Type, Type>();
|
||||||
|
|
||||||
|
CreatePageViewModelMappings();
|
||||||
|
}
|
||||||
|
|
||||||
public Task InitializeAsync()
|
public Task InitializeAsync()
|
||||||
{
|
{
|
||||||
if(string.IsNullOrEmpty(Settings.AuthAccessToken))
|
if(string.IsNullOrEmpty(Settings.AuthAccessToken))
|
||||||
@ -92,7 +100,7 @@ namespace eShopOnContainers.Services
|
|||||||
|
|
||||||
protected virtual async Task InternalNavigateToAsync(Type viewModelType, object parameter)
|
protected virtual async Task InternalNavigateToAsync(Type viewModelType, object parameter)
|
||||||
{
|
{
|
||||||
Page page = CreatePage(viewModelType, parameter);
|
Page page = CreateAndBindPage(viewModelType, parameter);
|
||||||
|
|
||||||
if (page is LoginView)
|
if (page is LoginView)
|
||||||
{
|
{
|
||||||
@ -101,6 +109,7 @@ namespace eShopOnContainers.Services
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
var navigationPage = CurrentApplication.MainPage as CustomNavigationView;
|
var navigationPage = CurrentApplication.MainPage as CustomNavigationView;
|
||||||
|
|
||||||
if (navigationPage != null)
|
if (navigationPage != null)
|
||||||
{
|
{
|
||||||
await navigationPage.PushAsync(page);
|
await navigationPage.PushAsync(page);
|
||||||
@ -116,23 +125,40 @@ namespace eShopOnContainers.Services
|
|||||||
|
|
||||||
protected Type GetPageTypeForViewModel(Type viewModelType)
|
protected Type GetPageTypeForViewModel(Type viewModelType)
|
||||||
{
|
{
|
||||||
var viewName = viewModelType.FullName.Replace("Model", string.Empty);
|
if (!_mappings.ContainsKey(viewModelType))
|
||||||
var viewModelAssemblyName = viewModelType.GetTypeInfo().Assembly.FullName;
|
{
|
||||||
var viewAssemblyName = string.Format(CultureInfo.InvariantCulture, "{0}, {1}", viewName, viewModelAssemblyName);
|
throw new KeyNotFoundException($"No map for ${viewModelType} was found on navigation mappings");
|
||||||
var viewType = Type.GetType(viewAssemblyName);
|
}
|
||||||
return viewType;
|
|
||||||
|
return _mappings[viewModelType];
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Page CreatePage(Type viewModelType, object parameter)
|
protected Page CreateAndBindPage(Type viewModelType, object parameter)
|
||||||
{
|
{
|
||||||
Type pageType = GetPageTypeForViewModel(viewModelType);
|
Type pageType = GetPageTypeForViewModel(viewModelType);
|
||||||
|
|
||||||
if (pageType == null)
|
if (pageType == null)
|
||||||
{
|
{
|
||||||
throw new Exception($"Cannot locate page type for {viewModelType}");
|
throw new Exception($"Mapping type for {viewModelType} is not a page");
|
||||||
}
|
}
|
||||||
|
|
||||||
Page page = Activator.CreateInstance(pageType) as Page;
|
Page page = Activator.CreateInstance(pageType) as Page;
|
||||||
|
ViewModelBase viewModel = ViewModelLocator.Instance.Resolve(viewModelType) as ViewModelBase;
|
||||||
|
page.BindingContext = viewModel;
|
||||||
|
|
||||||
return page;
|
return page;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void CreatePageViewModelMappings()
|
||||||
|
{
|
||||||
|
_mappings.Add(typeof(BasketViewModel), typeof(BasketView));
|
||||||
|
_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));
|
||||||
|
_mappings.Add(typeof(ProfileViewModel), typeof(ProfileView));
|
||||||
|
_mappings.Add(typeof(SettingsViewModel), typeof(SettingsView));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,4 +1,4 @@
|
|||||||
using eShopOnContainers.Core.ViewModels.Base;
|
using eShopOnContainers.ViewModels.Base;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
@ -3,7 +3,7 @@ using System.Linq.Expressions;
|
|||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using Xamarin.Forms;
|
using Xamarin.Forms;
|
||||||
|
|
||||||
namespace eShopOnContainers.Core.ViewModels.Base
|
namespace eShopOnContainers.ViewModels.Base
|
||||||
{
|
{
|
||||||
public abstract class ExtendedBindableObject : BindableObject
|
public abstract class ExtendedBindableObject : BindableObject
|
||||||
{
|
{
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
using eShopOnContainers.Core.Helpers;
|
using eShopOnContainers.Core;
|
||||||
|
using eShopOnContainers.Core.Helpers;
|
||||||
using eShopOnContainers.Services;
|
using eShopOnContainers.Services;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace eShopOnContainers.Core.ViewModels.Base
|
namespace eShopOnContainers.ViewModels.Base
|
||||||
{
|
{
|
||||||
public abstract class ViewModelBase : ExtendedBindableObject
|
public abstract class ViewModelBase : ExtendedBindableObject
|
||||||
{
|
{
|
||||||
@ -27,14 +28,14 @@ namespace eShopOnContainers.Core.ViewModels.Base
|
|||||||
|
|
||||||
public ViewModelBase()
|
public ViewModelBase()
|
||||||
{
|
{
|
||||||
DialogService = ViewModelLocator.Resolve<IDialogService>();
|
DialogService = ViewModelLocator.Instance.Resolve<IDialogService>();
|
||||||
NavigationService = ViewModelLocator.Resolve<INavigationService>();
|
NavigationService = ViewModelLocator.Instance.Resolve<INavigationService>();
|
||||||
GlobalSetting.Instance.BaseEndpoint = Settings.UrlBase;
|
GlobalSetting.Instance.BaseEndpoint = Settings.UrlBase;
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual Task InitializeAsync(object navigationData)
|
public virtual Task InitializeAsync(object navigationData)
|
||||||
{
|
{
|
||||||
return Task.FromResult(false);
|
return Task.FromResult(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,8 +1,7 @@
|
|||||||
using Microsoft.Practices.Unity;
|
using Microsoft.Practices.Unity;
|
||||||
|
using eShopOnContainers.Core.ViewModels;
|
||||||
using eShopOnContainers.Services;
|
using eShopOnContainers.Services;
|
||||||
using System;
|
using System;
|
||||||
using System.Globalization;
|
|
||||||
using System.Reflection;
|
|
||||||
using eShopOnContainers.Core.Services.Catalog;
|
using eShopOnContainers.Core.Services.Catalog;
|
||||||
using eShopOnContainers.Core.Services.OpenUrl;
|
using eShopOnContainers.Core.Services.OpenUrl;
|
||||||
using eShopOnContainers.Core.Services.RequestProvider;
|
using eShopOnContainers.Core.Services.RequestProvider;
|
||||||
@ -10,53 +9,54 @@ using eShopOnContainers.Core.Services.Basket;
|
|||||||
using eShopOnContainers.Core.Services.Identity;
|
using eShopOnContainers.Core.Services.Identity;
|
||||||
using eShopOnContainers.Core.Services.Order;
|
using eShopOnContainers.Core.Services.Order;
|
||||||
using eShopOnContainers.Core.Services.User;
|
using eShopOnContainers.Core.Services.User;
|
||||||
using Xamarin.Forms;
|
|
||||||
|
|
||||||
namespace eShopOnContainers.Core.ViewModels.Base
|
namespace eShopOnContainers.ViewModels.Base
|
||||||
{
|
{
|
||||||
public static class ViewModelLocator
|
public class ViewModelLocator
|
||||||
{
|
{
|
||||||
private static readonly IUnityContainer _unityContainer = new UnityContainer();
|
private bool _useMockService;
|
||||||
|
private readonly IUnityContainer _unityContainer;
|
||||||
|
|
||||||
public static readonly BindableProperty AutoWireViewModelProperty =
|
private static readonly ViewModelLocator _instance = new ViewModelLocator();
|
||||||
BindableProperty.CreateAttached("AutoWireViewModel", typeof(bool), typeof(ViewModelLocator), default(bool), propertyChanged: OnAutoWireViewModelChanged);
|
|
||||||
|
|
||||||
public static bool GetAutoWireViewModel(BindableObject bindable)
|
public static ViewModelLocator Instance
|
||||||
{
|
{
|
||||||
return (bool)bindable.GetValue(ViewModelLocator.AutoWireViewModelProperty);
|
get { return _instance; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void SetAutoWireViewModel(BindableObject bindable, bool value)
|
public bool UseMockService
|
||||||
{
|
{
|
||||||
bindable.SetValue(ViewModelLocator.AutoWireViewModelProperty, value);
|
get { return _useMockService; }
|
||||||
}
|
set { _useMockService = value; ; }
|
||||||
|
}
|
||||||
|
|
||||||
public static bool UseMockService { get; set; }
|
protected ViewModelLocator()
|
||||||
|
{
|
||||||
|
_unityContainer = new UnityContainer();
|
||||||
|
|
||||||
public static void Initialize()
|
// Services
|
||||||
{
|
_unityContainer.RegisterType<IDialogService, DialogService>();
|
||||||
// Services
|
RegisterSingleton<INavigationService, NavigationService>();
|
||||||
_unityContainer.RegisterType<IDialogService, DialogService>();
|
_unityContainer.RegisterType<IOpenUrlService, OpenUrlService>();
|
||||||
_unityContainer.RegisterType<INavigationService, NavigationService>(new ContainerControlledLifetimeManager());
|
_unityContainer.RegisterType<IRequestProvider, RequestProvider>();
|
||||||
_unityContainer.RegisterType<IOpenUrlService, OpenUrlService>();
|
_unityContainer.RegisterType<IIdentityService, IdentityService>();
|
||||||
_unityContainer.RegisterType<IRequestProvider, RequestProvider>();
|
|
||||||
_unityContainer.RegisterType<IIdentityService, IdentityService>();
|
|
||||||
_unityContainer.RegisterType<ICatalogService, CatalogMockService>();
|
|
||||||
_unityContainer.RegisterType<IBasketService, BasketMockService>();
|
|
||||||
_unityContainer.RegisterType<IUserService, UserMockService>();
|
|
||||||
|
|
||||||
// View models
|
_unityContainer.RegisterType<ICatalogService, CatalogMockService>();
|
||||||
_unityContainer.RegisterType<BasketViewModel>();
|
_unityContainer.RegisterType<IBasketService, BasketMockService>();
|
||||||
_unityContainer.RegisterType<CatalogViewModel>();
|
_unityContainer.RegisterType<IUserService, UserMockService>();
|
||||||
_unityContainer.RegisterType<CheckoutViewModel>();
|
|
||||||
_unityContainer.RegisterType<LoginViewModel>();
|
|
||||||
_unityContainer.RegisterType<MainViewModel>();
|
|
||||||
_unityContainer.RegisterType<OrderDetailViewModel>();
|
|
||||||
_unityContainer.RegisterType<ProfileViewModel>();
|
|
||||||
_unityContainer.RegisterType<SettingsViewModel>();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void UpdateDependencies(bool useMockServices)
|
// View models
|
||||||
|
_unityContainer.RegisterType<BasketViewModel>();
|
||||||
|
_unityContainer.RegisterType<CatalogViewModel>();
|
||||||
|
_unityContainer.RegisterType<CheckoutViewModel>();
|
||||||
|
_unityContainer.RegisterType<LoginViewModel>();
|
||||||
|
_unityContainer.RegisterType<MainViewModel>();
|
||||||
|
_unityContainer.RegisterType<OrderDetailViewModel>();
|
||||||
|
_unityContainer.RegisterType<ProfileViewModel>();
|
||||||
|
_unityContainer.RegisterType<SettingsViewModel>();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UpdateDependencies(bool useMockServices)
|
||||||
{
|
{
|
||||||
// Change injected dependencies
|
// Change injected dependencies
|
||||||
if (useMockServices)
|
if (useMockServices)
|
||||||
@ -80,31 +80,29 @@ namespace eShopOnContainers.Core.ViewModels.Base
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static T Resolve<T>()
|
public T Resolve<T>()
|
||||||
{
|
{
|
||||||
return _unityContainer.Resolve<T>();
|
return _unityContainer.Resolve<T>();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void OnAutoWireViewModelChanged(BindableObject bindable, object oldValue, object newValue)
|
public object Resolve(Type type)
|
||||||
{
|
{
|
||||||
var view = bindable as Element;
|
return _unityContainer.Resolve(type);
|
||||||
if (view == null)
|
}
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var viewType = view.GetType();
|
public void Register<T>(T instance)
|
||||||
var viewName = viewType.FullName.Replace(".Views.", ".ViewModels.");
|
{
|
||||||
var viewAssemblyName = viewType.GetTypeInfo().Assembly.FullName;
|
_unityContainer.RegisterInstance<T>(instance);
|
||||||
var viewModelName = string.Format(CultureInfo.InvariantCulture, "{0}Model, {1}", viewName, viewAssemblyName);
|
}
|
||||||
|
|
||||||
var viewModelType = Type.GetType(viewModelName);
|
public void Register<TInterface, T>() where T : TInterface
|
||||||
if (viewModelType == null)
|
{
|
||||||
{
|
_unityContainer.RegisterType<TInterface, T>();
|
||||||
return;
|
}
|
||||||
}
|
|
||||||
var viewModel = _unityContainer.Resolve(viewModelType);
|
public void RegisterSingleton<TInterface, T>() where T : TInterface
|
||||||
view.BindingContext = viewModel;
|
{
|
||||||
}
|
_unityContainer.RegisterType<TInterface, T>(new ContainerControlledLifetimeManager());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -4,6 +4,8 @@ using eShopOnContainers.Core.Models.Catalog;
|
|||||||
using eShopOnContainers.Core.Services.Basket;
|
using eShopOnContainers.Core.Services.Basket;
|
||||||
using eShopOnContainers.Core.Services.User;
|
using eShopOnContainers.Core.Services.User;
|
||||||
using eShopOnContainers.Core.ViewModels.Base;
|
using eShopOnContainers.Core.ViewModels.Base;
|
||||||
|
using eShopOnContainers.ViewModels.Base;
|
||||||
|
using System;
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
@ -59,7 +61,7 @@ namespace eShopOnContainers.Core.ViewModels
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public ICommand AddCommand => new Command<BasketItem>(async (item) => await AddItemAsync(item));
|
public ICommand AddCommand => new Command<BasketItem>(AddItem);
|
||||||
|
|
||||||
public ICommand CheckoutCommand => new Command(async () => await CheckoutAsync());
|
public ICommand CheckoutCommand => new Command(async () => await CheckoutAsync());
|
||||||
|
|
||||||
@ -80,22 +82,22 @@ namespace eShopOnContainers.Core.ViewModels
|
|||||||
foreach (var basketItem in basket.Items)
|
foreach (var basketItem in basket.Items)
|
||||||
{
|
{
|
||||||
BadgeCount += basketItem.Quantity;
|
BadgeCount += basketItem.Quantity;
|
||||||
await AddBasketItemAsync(basketItem);
|
AddBasketItem(basketItem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MessagingCenter.Unsubscribe<CatalogViewModel, CatalogItem>(this, MessengerKeys.AddProduct);
|
MessagingCenter.Unsubscribe<CatalogViewModel, CatalogItem>(this, MessengerKeys.AddProduct);
|
||||||
MessagingCenter.Subscribe<CatalogViewModel, CatalogItem>(this, MessengerKeys.AddProduct, async (sender, arg) =>
|
MessagingCenter.Subscribe<CatalogViewModel, CatalogItem>(this, MessengerKeys.AddProduct, (sender, arg) =>
|
||||||
{
|
{
|
||||||
BadgeCount++;
|
BadgeCount++;
|
||||||
|
|
||||||
await AddCatalogItemAsync(arg);
|
AddCatalogItem(arg);
|
||||||
});
|
});
|
||||||
|
|
||||||
await base.InitializeAsync(navigationData);
|
await base.InitializeAsync(navigationData);
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task AddCatalogItemAsync(CatalogItem item)
|
private void AddCatalogItem(CatalogItem item)
|
||||||
{
|
{
|
||||||
BasketItems.Add(new BasketItem
|
BasketItems.Add(new BasketItem
|
||||||
{
|
{
|
||||||
@ -106,23 +108,26 @@ namespace eShopOnContainers.Core.ViewModels
|
|||||||
Quantity = 1
|
Quantity = 1
|
||||||
});
|
});
|
||||||
|
|
||||||
await ReCalculateTotal();
|
ReCalculateTotal();
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task AddItemAsync(BasketItem item)
|
private void AddItem(BasketItem item)
|
||||||
{
|
{
|
||||||
BadgeCount++;
|
BadgeCount++;
|
||||||
await AddBasketItemAsync(item);
|
|
||||||
|
AddBasketItem(item);
|
||||||
|
|
||||||
RaisePropertyChanged(() => BasketItems);
|
RaisePropertyChanged(() => BasketItems);
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task AddBasketItemAsync(BasketItem item)
|
private void AddBasketItem(BasketItem item)
|
||||||
{
|
{
|
||||||
BasketItems.Add(item);
|
BasketItems.Add(item);
|
||||||
await ReCalculateTotal();
|
|
||||||
|
ReCalculateTotal();
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task ReCalculateTotal()
|
private async void ReCalculateTotal()
|
||||||
{
|
{
|
||||||
Total = 0;
|
Total = 0;
|
||||||
|
|
||||||
|
@ -1,11 +1,14 @@
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using eShopOnContainers.Core.ViewModels.Base;
|
using eShopOnContainers.ViewModels.Base;
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
using Xamarin.Forms;
|
using Xamarin.Forms;
|
||||||
|
using eShopOnContainers.Core.ViewModels.Base;
|
||||||
using eShopOnContainers.Core.Models.Catalog;
|
using eShopOnContainers.Core.Models.Catalog;
|
||||||
using eShopOnContainers.Core.Services.Catalog;
|
using eShopOnContainers.Core.Services.Catalog;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
|
using System.Linq;
|
||||||
using eShopOnContainers.Core.Services.Basket;
|
using eShopOnContainers.Core.Services.Basket;
|
||||||
|
using eShopOnContainers.Core.Helpers;
|
||||||
using eShopOnContainers.Core.Services.User;
|
using eShopOnContainers.Core.Services.User;
|
||||||
|
|
||||||
namespace eShopOnContainers.Core.ViewModels
|
namespace eShopOnContainers.Core.ViewModels
|
||||||
@ -88,9 +91,9 @@ namespace eShopOnContainers.Core.ViewModels
|
|||||||
|
|
||||||
public ICommand AddCatalogItemCommand => new Command<CatalogItem>(AddCatalogItem);
|
public ICommand AddCatalogItemCommand => new Command<CatalogItem>(AddCatalogItem);
|
||||||
|
|
||||||
public ICommand FilterCommand => new Command(async () => await FilterAsync());
|
public ICommand FilterCommand => new Command(Filter);
|
||||||
|
|
||||||
public ICommand ClearFilterCommand => new Command(async () => await ClearFilterAsync());
|
public ICommand ClearFilterCommand => new Command(ClearFilter);
|
||||||
|
|
||||||
public override async Task InitializeAsync(object navigationData)
|
public override async Task InitializeAsync(object navigationData)
|
||||||
{
|
{
|
||||||
@ -110,7 +113,7 @@ namespace eShopOnContainers.Core.ViewModels
|
|||||||
MessagingCenter.Send(this, MessengerKeys.AddProduct, catalogItem);
|
MessagingCenter.Send(this, MessengerKeys.AddProduct, catalogItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task FilterAsync()
|
private async void Filter()
|
||||||
{
|
{
|
||||||
if (Brand == null && Type == null)
|
if (Brand == null && Type == null)
|
||||||
{
|
{
|
||||||
@ -126,7 +129,7 @@ namespace eShopOnContainers.Core.ViewModels
|
|||||||
IsBusy = false;
|
IsBusy = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task ClearFilterAsync()
|
private async void ClearFilter()
|
||||||
{
|
{
|
||||||
IsBusy = true;
|
IsBusy = true;
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
using eShopOnContainers.Core.Models.Navigation;
|
using eShopOnContainers.Core.Models.Navigation;
|
||||||
using eShopOnContainers.Core.ViewModels.Base;
|
using eShopOnContainers.ViewModels.Base;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using Xamarin.Forms;
|
using Xamarin.Forms;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
@ -138,7 +138,7 @@ namespace eShopOnContainers.Core.ViewModels
|
|||||||
await _basketService.ClearBasketAsync(_shippingAddress.Id.ToString(), authToken);
|
await _basketService.ClearBasketAsync(_shippingAddress.Id.ToString(), authToken);
|
||||||
|
|
||||||
// Reset Basket badge
|
// Reset Basket badge
|
||||||
var basketViewModel = ViewModelLocator.Resolve<BasketViewModel>();
|
var basketViewModel = ViewModelLocator.Instance.Resolve<BasketViewModel>();
|
||||||
basketViewModel.BadgeCount = 0;
|
basketViewModel.BadgeCount = 0;
|
||||||
|
|
||||||
// Navigate to Orders
|
// Navigate to Orders
|
||||||
|
@ -4,7 +4,7 @@ using eShopOnContainers.Core.Services.Identity;
|
|||||||
using eShopOnContainers.Core.Services.OpenUrl;
|
using eShopOnContainers.Core.Services.OpenUrl;
|
||||||
using eShopOnContainers.Core.Services.User;
|
using eShopOnContainers.Core.Services.User;
|
||||||
using eShopOnContainers.Core.Validations;
|
using eShopOnContainers.Core.Validations;
|
||||||
using eShopOnContainers.Core.ViewModels.Base;
|
using eShopOnContainers.ViewModels.Base;
|
||||||
using IdentityModel.Client;
|
using IdentityModel.Client;
|
||||||
using System;
|
using System;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
@ -133,9 +133,10 @@ namespace eShopOnContainers.Core.ViewModels
|
|||||||
|
|
||||||
public override Task InitializeAsync(object navigationData)
|
public override Task InitializeAsync(object navigationData)
|
||||||
{
|
{
|
||||||
if (navigationData is LogoutParameter)
|
if(navigationData is LogoutParameter)
|
||||||
{
|
{
|
||||||
var logoutParameter = (LogoutParameter)navigationData;
|
var logoutParameter = (LogoutParameter)navigationData;
|
||||||
|
|
||||||
if (logoutParameter.Logout)
|
if (logoutParameter.Logout)
|
||||||
{
|
{
|
||||||
Logout();
|
Logout();
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using eShopOnContainers.Core.ViewModels.Base;
|
using eShopOnContainers.ViewModels.Base;
|
||||||
using eShopOnContainers.Core.Models.Navigation;
|
using eShopOnContainers.Core.Models.Navigation;
|
||||||
using Xamarin.Forms;
|
using Xamarin.Forms;
|
||||||
using eShopOnContainers.Core.ViewModels.Base;
|
using eShopOnContainers.Core.ViewModels.Base;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using eShopOnContainers.Core.Models.Orders;
|
using eShopOnContainers.Core.Models.Orders;
|
||||||
using eShopOnContainers.Core.ViewModels.Base;
|
using eShopOnContainers.ViewModels.Base;
|
||||||
using eShopOnContainers.Core.Services.Catalog;
|
using eShopOnContainers.Core.Services.Catalog;
|
||||||
using eShopOnContainers.Core.Services.Basket;
|
using eShopOnContainers.Core.Services.Basket;
|
||||||
using eShopOnContainers.Core.Services.Order;
|
using eShopOnContainers.Core.Services.Order;
|
||||||
|
@ -3,7 +3,7 @@ using eShopOnContainers.Core.Helpers;
|
|||||||
using eShopOnContainers.Core.Models.Orders;
|
using eShopOnContainers.Core.Models.Orders;
|
||||||
using eShopOnContainers.Core.Models.User;
|
using eShopOnContainers.Core.Models.User;
|
||||||
using eShopOnContainers.Core.Services.Order;
|
using eShopOnContainers.Core.Services.Order;
|
||||||
using eShopOnContainers.Core.ViewModels.Base;
|
using eShopOnContainers.ViewModels.Base;
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
using eShopOnContainers.Core.ViewModels.Base;
|
using eShopOnContainers.ViewModels.Base;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using Xamarin.Forms;
|
using Xamarin.Forms;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
@ -71,7 +71,7 @@ namespace eShopOnContainers.Core.ViewModels
|
|||||||
|
|
||||||
private void MockServices()
|
private void MockServices()
|
||||||
{
|
{
|
||||||
ViewModelLocator.UpdateDependencies(!UseAzureServices);
|
ViewModelLocator.Instance.UpdateDependencies(!UseAzureServices);
|
||||||
UpdateInfo();
|
UpdateInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,11 +1,9 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
|
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||||
x:Class="eShopOnContainers.Core.Views.BasketView"
|
x:Class="eShopOnContainers.Core.Views.BasketView"
|
||||||
xmlns:viewModelBase="clr-namespace:eShopOnContainers.Core.ViewModels.Base;assembly=eShopOnContainers.Core"
|
|
||||||
xmlns:behaviors="clr-namespace:eShopOnContainers.Core.Behaviors;assembly=eShopOnContainers.Core"
|
xmlns:behaviors="clr-namespace:eShopOnContainers.Core.Behaviors;assembly=eShopOnContainers.Core"
|
||||||
xmlns:templates="clr-namespace:eShopOnContainers.Core.Views.Templates;assembly=eShopOnContainers.Core"
|
xmlns:templates="clr-namespace:eShopOnContainers.Core.Views.Templates;assembly=eShopOnContainers.Core"
|
||||||
viewModelBase:ViewModelLocator.AutoWireViewModel="true"
|
|
||||||
Title="Cart">
|
Title="Cart">
|
||||||
<ContentPage.Resources>
|
<ContentPage.Resources>
|
||||||
<ResourceDictionary>
|
<ResourceDictionary>
|
||||||
|
@ -1,14 +1,12 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
|
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||||
x:Class="eShopOnContainers.Core.Views.CatalogView"
|
x:Class="eShopOnContainers.Core.Views.CatalogView"
|
||||||
xmlns:templates="clr-namespace:eShopOnContainers.Core.Views.Templates;assembly=eShopOnContainers.Core"
|
xmlns:templates="clr-namespace:eShopOnContainers.Core.Views.Templates;assembly=eShopOnContainers.Core"
|
||||||
xmlns:views="clr-namespace:eShopOnContainers.Core.Views;assembly=eShopOnContainers.Core"
|
xmlns:views="clr-namespace:eShopOnContainers.Core.Views;assembly=eShopOnContainers.Core"
|
||||||
xmlns:viewModelBase="clr-namespace:eShopOnContainers.Core.ViewModels.Base;assembly=eShopOnContainers.Core"
|
|
||||||
xmlns:animations="clr-namespace:eShopOnContainers.Core.Animations;assembly=eShopOnContainers.Core"
|
xmlns:animations="clr-namespace:eShopOnContainers.Core.Animations;assembly=eShopOnContainers.Core"
|
||||||
xmlns:triggers="clr-namespace:eShopOnContainers.Core.Triggers;assembly=eShopOnContainers.Core"
|
xmlns:triggers="clr-namespace:eShopOnContainers.Core.Triggers;assembly=eShopOnContainers.Core"
|
||||||
xmlns:behaviors="clr-namespace:eShopOnContainers.Core.Behaviors;assembly=eShopOnContainers.Core"
|
xmlns:behaviors="clr-namespace:eShopOnContainers.Core.Behaviors;assembly=eShopOnContainers.Core"
|
||||||
viewModelBase:ViewModelLocator.AutoWireViewModel="true"
|
|
||||||
Title="Catalog">
|
Title="Catalog">
|
||||||
<ContentPage.Resources>
|
<ContentPage.Resources>
|
||||||
<ResourceDictionary>
|
<ResourceDictionary>
|
||||||
|
@ -47,8 +47,7 @@ namespace eShopOnContainers.Core.Views
|
|||||||
{
|
{
|
||||||
base.OnBindingContextChanged();
|
base.OnBindingContextChanged();
|
||||||
|
|
||||||
if (_filterView != null)
|
_filterView.BindingContext = BindingContext;
|
||||||
_filterView.BindingContext = BindingContext;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnFilterChanged(object sender, EventArgs e)
|
private void OnFilterChanged(object sender, EventArgs e)
|
||||||
|
@ -1,10 +1,8 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
|
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||||
x:Class="eShopOnContainers.Core.Views.CheckoutView"
|
x:Class="eShopOnContainers.Core.Views.CheckoutView"
|
||||||
xmlns:viewModelBase="clr-namespace:eShopOnContainers.Core.ViewModels.Base;assembly=eShopOnContainers.Core"
|
xmlns:templates="clr-namespace:eShopOnContainers.Core.Views.Templates;assembly=eShopOnContainers.Core"
|
||||||
xmlns:templates="clr-namespace:eShopOnContainers.Core.Views.Templates;assembly=eShopOnContainers.Core"
|
|
||||||
viewModelBase:ViewModelLocator.AutoWireViewModel="true"
|
|
||||||
Title="Checkout">
|
Title="Checkout">
|
||||||
<ContentPage.Resources>
|
<ContentPage.Resources>
|
||||||
<ResourceDictionary>
|
<ResourceDictionary>
|
||||||
|
@ -2,11 +2,9 @@
|
|||||||
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
|
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||||
x:Class="eShopOnContainers.Core.Views.LoginView"
|
x:Class="eShopOnContainers.Core.Views.LoginView"
|
||||||
xmlns:viewModelBase="clr-namespace:eShopOnContainers.Core.ViewModels.Base;assembly=eShopOnContainers.Core"
|
|
||||||
xmlns:animations="clr-namespace:eShopOnContainers.Core.Animations;assembly=eShopOnContainers.Core"
|
xmlns:animations="clr-namespace:eShopOnContainers.Core.Animations;assembly=eShopOnContainers.Core"
|
||||||
xmlns:triggers="clr-namespace:eShopOnContainers.Core.Triggers;assembly=eShopOnContainers.Core"
|
xmlns:triggers="clr-namespace:eShopOnContainers.Core.Triggers;assembly=eShopOnContainers.Core"
|
||||||
xmlns:behaviors="clr-namespace:eShopOnContainers.Core.Behaviors;assembly=eShopOnContainers.Core"
|
xmlns:behaviors="clr-namespace:eShopOnContainers.Core.Behaviors;assembly=eShopOnContainers.Core">
|
||||||
viewModelBase:ViewModelLocator.AutoWireViewModel="true">
|
|
||||||
<ContentPage.Title>
|
<ContentPage.Title>
|
||||||
<OnPlatform
|
<OnPlatform
|
||||||
x:TypeArguments="x:String"
|
x:TypeArguments="x:String"
|
||||||
|
@ -1,14 +1,12 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms"
|
<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||||
x:Class="eShopOnContainers.Core.Views.MainView"
|
x:Class="eShopOnContainers.Core.Views.MainView"
|
||||||
xmlns:views="clr-namespace:eShopOnContainers.Core.Views;assembly=eShopOnContainers.Core"
|
xmlns:views="clr-namespace:eShopOnContainers.Core.Views;assembly=eShopOnContainers.Core"
|
||||||
xmlns:viewModelBase="clr-namespace:eShopOnContainers.Core.ViewModels.Base;assembly=eShopOnContainers.Core"
|
|
||||||
xmlns:controls="clr-namespace:eShopOnContainers.Core.Controls;assembly=eShopOnContainers.Core"
|
xmlns:controls="clr-namespace:eShopOnContainers.Core.Controls;assembly=eShopOnContainers.Core"
|
||||||
BarBackgroundColor="{StaticResource DarkGreenColor}"
|
BarBackgroundColor="{StaticResource DarkGreenColor}"
|
||||||
BackgroundColor="{StaticResource BackgroundColor}"
|
BackgroundColor="{StaticResource BackgroundColor}"
|
||||||
BarTextColor="{StaticResource WhiteColor}"
|
BarTextColor="{StaticResource WhiteColor}">
|
||||||
viewModelBase:ViewModelLocator.AutoWireViewModel="true">
|
|
||||||
<TabbedPage.Title>
|
<TabbedPage.Title>
|
||||||
<OnPlatform
|
<OnPlatform
|
||||||
x:TypeArguments="x:String"
|
x:TypeArguments="x:String"
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
using eShopOnContainers.Core.ViewModels;
|
using eShopOnContainers.Core.ViewModels;
|
||||||
using eShopOnContainers.Core.ViewModels.Base;
|
using eShopOnContainers.Core.ViewModels.Base;
|
||||||
|
using eShopOnContainers.ViewModels.Base;
|
||||||
using Xamarin.Forms;
|
using Xamarin.Forms;
|
||||||
|
|
||||||
namespace eShopOnContainers.Core.Views
|
namespace eShopOnContainers.Core.Views
|
||||||
@ -31,9 +32,17 @@ namespace eShopOnContainers.Core.Views
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
await ((CatalogViewModel)HomeView.BindingContext).InitializeAsync(null);
|
var homeViewModel = ViewModelLocator.Instance.Resolve<CatalogViewModel>();
|
||||||
await ((BasketViewModel)BasketView.BindingContext).InitializeAsync(null);
|
await homeViewModel.InitializeAsync(null);
|
||||||
await ((ProfileViewModel)ProfileView.BindingContext).InitializeAsync(null);
|
HomeView.BindingContext = homeViewModel;
|
||||||
|
|
||||||
|
var basketViewModel = ViewModelLocator.Instance.Resolve<BasketViewModel>();
|
||||||
|
await basketViewModel.InitializeAsync(null);
|
||||||
|
BasketView.BindingContext = basketViewModel;
|
||||||
|
|
||||||
|
var profileViewModel = ViewModelLocator.Instance.Resolve<ProfileViewModel>();
|
||||||
|
await profileViewModel.InitializeAsync(null);
|
||||||
|
ProfileView.BindingContext = profileViewModel;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,10 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
|
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||||
x:Class="eShopOnContainers.Core.Views.OrderDetailView"
|
x:Class="eShopOnContainers.Core.Views.OrderDetailView"
|
||||||
xmlns:viewModelBase="clr-namespace:eShopOnContainers.Core.ViewModels.Base;assembly=eShopOnContainers.Core"
|
|
||||||
xmlns:templates="clr-namespace:eShopOnContainers.Core.Views.Templates;assembly=eShopOnContainers.Core"
|
xmlns:templates="clr-namespace:eShopOnContainers.Core.Views.Templates;assembly=eShopOnContainers.Core"
|
||||||
xmlns:animations="clr-namespace:eShopOnContainers.Core.Animations;assembly=eShopOnContainers.Core"
|
xmlns:animations="clr-namespace:eShopOnContainers.Core.Animations;assembly=eShopOnContainers.Core"
|
||||||
xmlns:triggers="clr-namespace:eShopOnContainers.Core.Triggers;assembly=eShopOnContainers.Core"
|
xmlns:triggers="clr-namespace:eShopOnContainers.Core.Triggers;assembly=eShopOnContainers.Core"
|
||||||
viewModelBase:ViewModelLocator.AutoWireViewModel="true"
|
|
||||||
Title="{Binding Order.OrderNumber}">
|
Title="{Binding Order.OrderNumber}">
|
||||||
<ContentPage.Resources>
|
<ContentPage.Resources>
|
||||||
<ResourceDictionary>
|
<ResourceDictionary>
|
||||||
|
@ -1,13 +1,11 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
|
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||||
x:Class="eShopOnContainers.Core.Views.ProfileView"
|
x:Class="eShopOnContainers.Core.Views.ProfileView"
|
||||||
xmlns:views="clr-namespace:eShopOnContainers.Core.Views;assembly=eShopOnContainers.Core"
|
xmlns:views="clr-namespace:eShopOnContainers.Core.Views;assembly=eShopOnContainers.Core"
|
||||||
xmlns:viewModelBase="clr-namespace:eShopOnContainers.Core.ViewModels.Base;assembly=eShopOnContainers.Core"
|
|
||||||
xmlns:templates="clr-namespace:eShopOnContainers.Core.Views.Templates;assembly=eShopOnContainers.Core"
|
xmlns:templates="clr-namespace:eShopOnContainers.Core.Views.Templates;assembly=eShopOnContainers.Core"
|
||||||
xmlns:behaviors="clr-namespace:eShopOnContainers.Core.Behaviors;assembly=eShopOnContainers.Core"
|
xmlns:behaviors="clr-namespace:eShopOnContainers.Core.Behaviors;assembly=eShopOnContainers.Core"
|
||||||
viewModelBase:ViewModelLocator.AutoWireViewModel="true"
|
Title="My profile">
|
||||||
Title="My profile">
|
|
||||||
<ContentPage.Resources>
|
<ContentPage.Resources>
|
||||||
<ResourceDictionary>
|
<ResourceDictionary>
|
||||||
|
|
||||||
|
@ -1,13 +1,11 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
|
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||||
x:Class="eShopOnContainers.Core.Views.SettingsView"
|
x:Class="eShopOnContainers.Core.Views.SettingsView"
|
||||||
xmlns:viewModelBase="clr-namespace:eShopOnContainers.Core.ViewModels.Base;assembly=eShopOnContainers.Core"
|
|
||||||
xmlns:controls="clr-namespace:eShopOnContainers.Core.Controls;assembly=eShopOnContainers.Core"
|
xmlns:controls="clr-namespace:eShopOnContainers.Core.Controls;assembly=eShopOnContainers.Core"
|
||||||
xmlns:animations="clr-namespace:eShopOnContainers.Core.Animations;assembly=eShopOnContainers.Core"
|
xmlns:animations="clr-namespace:eShopOnContainers.Core.Animations;assembly=eShopOnContainers.Core"
|
||||||
xmlns:triggers="clr-namespace:eShopOnContainers.Core.Triggers;assembly=eShopOnContainers.Core"
|
xmlns:triggers="clr-namespace:eShopOnContainers.Core.Triggers;assembly=eShopOnContainers.Core"
|
||||||
xmlns:behaviors="clr-namespace:eShopOnContainers.Core.Behaviors;assembly=eShopOnContainers.Core"
|
xmlns:behaviors="clr-namespace:eShopOnContainers.Core.Behaviors;assembly=eShopOnContainers.Core"
|
||||||
viewModelBase:ViewModelLocator.AutoWireViewModel="true"
|
|
||||||
Title="Settings">
|
Title="Settings">
|
||||||
<ContentPage.Resources>
|
<ContentPage.Resources>
|
||||||
<ResourceDictionary>
|
<ResourceDictionary>
|
||||||
|
@ -60,6 +60,7 @@
|
|||||||
<Compile Include="Converters\ToUpperConverter.cs" />
|
<Compile Include="Converters\ToUpperConverter.cs" />
|
||||||
<Compile Include="Effects\LineColorEffect.cs" />
|
<Compile Include="Effects\LineColorEffect.cs" />
|
||||||
<Compile Include="Exceptions\ServiceAuthenticationException.cs" />
|
<Compile Include="Exceptions\ServiceAuthenticationException.cs" />
|
||||||
|
<Compile Include="Extensions\AnimationExtension.cs" />
|
||||||
<Compile Include="Extensions\ObservableExtension.cs" />
|
<Compile Include="Extensions\ObservableExtension.cs" />
|
||||||
<Compile Include="GlobalSettings.cs" />
|
<Compile Include="GlobalSettings.cs" />
|
||||||
<Compile Include="Helpers\EasingHelper.cs" />
|
<Compile Include="Helpers\EasingHelper.cs" />
|
||||||
|
Loading…
x
Reference in New Issue
Block a user