Browse Source

Completed Settings View

Init Rest API integration
pull/49/merge
Javier Suárez Ruiz 8 years ago
parent
commit
7438d9b432
52 changed files with 1037 additions and 344 deletions
  1. +0
    -25
      src/Mobile/eShopOnContainers/eShopOnContainers.Core/Controls/CustomSwitch.cs
  2. +148
    -0
      src/Mobile/eShopOnContainers/eShopOnContainers.Core/Controls/ToggleButton.cs
  3. +18
    -0
      src/Mobile/eShopOnContainers/eShopOnContainers.Core/Exceptions/ServiceAuthenticationException.cs
  4. +2
    -0
      src/Mobile/eShopOnContainers/eShopOnContainers.Core/GlobalSettings.cs
  5. +54
    -0
      src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Catalog/CatalogService.cs
  6. +17
    -0
      src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/RequestProvider/IRequestProvider.cs
  7. +102
    -0
      src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/RequestProvider/RequestProvider.cs
  8. +2
    -2
      src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/Base/ViewModelLocator.cs
  9. +3
    -3
      src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/MainView.xaml
  10. +26
    -8
      src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/SettingsView.xaml
  11. +22
    -1
      src/Mobile/eShopOnContainers/eShopOnContainers.Core/eShopOnContainers.Core.csproj
  12. +3
    -0
      src/Mobile/eShopOnContainers/eShopOnContainers.Core/packages.config
  13. +0
    -58
      src/Mobile/eShopOnContainers/eShopOnContainers.Droid/Renderers/CustomSwitchRenderer.cs
  14. +1
    -1
      src/Mobile/eShopOnContainers/eShopOnContainers.Droid/Renderers/CustomTabbedPageRenderer.cs
  15. +111
    -105
      src/Mobile/eShopOnContainers/eShopOnContainers.Droid/Resources/Resource.Designer.cs
  16. BIN
      src/Mobile/eShopOnContainers/eShopOnContainers.Droid/Resources/drawable-hdpi/app_settings.png
  17. BIN
      src/Mobile/eShopOnContainers/eShopOnContainers.Droid/Resources/drawable-hdpi/toggle_azure.png
  18. BIN
      src/Mobile/eShopOnContainers/eShopOnContainers.Droid/Resources/drawable-hdpi/toggle_local.png
  19. BIN
      src/Mobile/eShopOnContainers/eShopOnContainers.Droid/Resources/drawable-xhdpi/app_settings.png
  20. BIN
      src/Mobile/eShopOnContainers/eShopOnContainers.Droid/Resources/drawable-xhdpi/toggle_azure.png
  21. BIN
      src/Mobile/eShopOnContainers/eShopOnContainers.Droid/Resources/drawable-xhdpi/toggle_local.png
  22. BIN
      src/Mobile/eShopOnContainers/eShopOnContainers.Droid/Resources/drawable-xxhdpi/app_settings.png
  23. BIN
      src/Mobile/eShopOnContainers/eShopOnContainers.Droid/Resources/drawable-xxhdpi/toggle_azure.png
  24. BIN
      src/Mobile/eShopOnContainers/eShopOnContainers.Droid/Resources/drawable-xxhdpi/toggle_local.png
  25. BIN
      src/Mobile/eShopOnContainers/eShopOnContainers.Droid/Resources/drawable-xxxhdpi/background.png
  26. BIN
      src/Mobile/eShopOnContainers/eShopOnContainers.Droid/Resources/drawable-xxxhdpi/icon.png
  27. BIN
      src/Mobile/eShopOnContainers/eShopOnContainers.Droid/Resources/drawable-xxxhdpi/menu_cart.png
  28. BIN
      src/Mobile/eShopOnContainers/eShopOnContainers.Droid/Resources/drawable-xxxhdpi/user_profile.png
  29. +13
    -9
      src/Mobile/eShopOnContainers/eShopOnContainers.Droid/app.config
  30. +26
    -12
      src/Mobile/eShopOnContainers/eShopOnContainers.Droid/eShopOnContainers.Droid.csproj
  31. +2
    -1
      src/Mobile/eShopOnContainers/eShopOnContainers.Droid/eShopOnContainers.Droid.csproj.bak
  32. +309
    -1
      src/Mobile/eShopOnContainers/eShopOnContainers.Windows/App.xaml
  33. BIN
      src/Mobile/eShopOnContainers/eShopOnContainers.Windows/Assets/app_settings.png
  34. BIN
      src/Mobile/eShopOnContainers/eShopOnContainers.Windows/Assets/toggle_azure.png
  35. BIN
      src/Mobile/eShopOnContainers/eShopOnContainers.Windows/Assets/toggle_local.png
  36. +65
    -0
      src/Mobile/eShopOnContainers/eShopOnContainers.Windows/Controls/TabItem.xaml
  37. +51
    -0
      src/Mobile/eShopOnContainers/eShopOnContainers.Windows/Controls/TabItem.xaml.cs
  38. +0
    -60
      src/Mobile/eShopOnContainers/eShopOnContainers.Windows/Renderers/CustomSwitchRenderer.cs
  39. +21
    -0
      src/Mobile/eShopOnContainers/eShopOnContainers.Windows/Renderers/CustomTabbedPageRenderer.cs
  40. +10
    -1
      src/Mobile/eShopOnContainers/eShopOnContainers.Windows/eShopOnContainers.Windows.csproj
  41. +0
    -56
      src/Mobile/eShopOnContainers/eShopOnContainers.iOS/Renderers/CustomSwitchRenderer.cs
  42. BIN
      src/Mobile/eShopOnContainers/eShopOnContainers.iOS/Resources/app_settings.png
  43. BIN
      src/Mobile/eShopOnContainers/eShopOnContainers.iOS/Resources/app_settings@2x.png
  44. BIN
      src/Mobile/eShopOnContainers/eShopOnContainers.iOS/Resources/app_settings@3x.png
  45. BIN
      src/Mobile/eShopOnContainers/eShopOnContainers.iOS/Resources/toggle_azure.png
  46. BIN
      src/Mobile/eShopOnContainers/eShopOnContainers.iOS/Resources/toggle_azure@2x.png
  47. BIN
      src/Mobile/eShopOnContainers/eShopOnContainers.iOS/Resources/toggle_azure@3x.png
  48. BIN
      src/Mobile/eShopOnContainers/eShopOnContainers.iOS/Resources/toggle_local.png
  49. BIN
      src/Mobile/eShopOnContainers/eShopOnContainers.iOS/Resources/toggle_local@2x.png
  50. BIN
      src/Mobile/eShopOnContainers/eShopOnContainers.iOS/Resources/toggle_local@3x.png
  51. +4
    -0
      src/Mobile/eShopOnContainers/eShopOnContainers.iOS/app.config
  52. +27
    -1
      src/Mobile/eShopOnContainers/eShopOnContainers.iOS/eShopOnContainers.iOS.csproj

+ 0
- 25
src/Mobile/eShopOnContainers/eShopOnContainers.Core/Controls/CustomSwitch.cs View File

@ -1,25 +0,0 @@
using Xamarin.Forms;
namespace eShopOnContainers.Core.Controls
{
public class CustomSwitch : Switch
{
public static readonly BindableProperty TextOnProperty = BindableProperty.Create("TextOn",
typeof(string), typeof(CustomSwitch), string.Empty);
public static readonly BindableProperty TextOffProperty = BindableProperty.Create("TextOff",
typeof(string), typeof(CustomSwitch), string.Empty);
public string TextOn
{
get { return (string)this.GetValue(TextOnProperty); }
set { this.SetValue(TextOnProperty, value); }
}
public string TextOff
{
get { return (string)this.GetValue(TextOffProperty); }
set { this.SetValue(TextOffProperty, value); }
}
}
}

+ 148
- 0
src/Mobile/eShopOnContainers/eShopOnContainers.Core/Controls/ToggleButton.cs View File

@ -0,0 +1,148 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
using Xamarin.Forms;
namespace eShopOnContainers.Core.Controls
{
public class ToggleButton : ContentView
{
public static readonly BindableProperty CommandProperty =
BindableProperty.Create("Command", typeof(ICommand), typeof(ToggleButton), null);
public static readonly BindableProperty CommandParameterProperty =
BindableProperty.Create("CommandParameter", typeof(object), typeof(ToggleButton), null);
public static readonly BindableProperty CheckedProperty =
BindableProperty.Create("Checked", typeof(bool), typeof(ToggleButton), false, BindingMode.TwoWay,
null, propertyChanged: OnCheckedChanged);
public static readonly BindableProperty AnimateProperty =
BindableProperty.Create("Animate", typeof(bool), typeof(ToggleButton), false);
public static readonly BindableProperty CheckedImageProperty =
BindableProperty.Create("CheckedImage", typeof(ImageSource), typeof(ToggleButton), null);
public static readonly BindableProperty UnCheckedImageProperty =
BindableProperty.Create("UnCheckedImage", typeof(ImageSource), typeof(ToggleButton), null);
private ICommand _toggleCommand;
private Image _toggleImage;
public ToggleButton()
{
Initialize();
}
public ICommand Command
{
get { return (ICommand)GetValue(CommandProperty); }
set { SetValue(CommandProperty, value); }
}
public object CommandParameter
{
get { return GetValue(CommandParameterProperty); }
set { SetValue(CommandParameterProperty, value); }
}
public bool Checked
{
get { return (bool)GetValue(CheckedProperty); }
set { SetValue(CheckedProperty, value); }
}
public bool Animate
{
get { return (bool)GetValue(AnimateProperty); }
set { SetValue(CheckedProperty, value); }
}
public ImageSource CheckedImage
{
get { return (ImageSource)GetValue(CheckedImageProperty); }
set { SetValue(CheckedImageProperty, value); }
}
public ImageSource UnCheckedImage
{
get { return (ImageSource)GetValue(UnCheckedImageProperty); }
set { SetValue(UnCheckedImageProperty, value); }
}
public ICommand ToogleCommand
{
get
{
return _toggleCommand
?? (_toggleCommand = new Command(() =>
{
if (Checked)
{
Checked = false;
}
else
{
Checked = true;
}
if (Command != null)
{
Command.Execute(CommandParameter);
}
}));
}
}
private void Initialize()
{
_toggleImage = new Image();
Animate = true;
GestureRecognizers.Add(new TapGestureRecognizer
{
Command = ToogleCommand
});
_toggleImage.Source = UnCheckedImage;
Content = _toggleImage;
}
protected override void OnParentSet()
{
base.OnParentSet();
_toggleImage.Source = UnCheckedImage;
Content = _toggleImage;
}
private static async void OnCheckedChanged(BindableObject bindable, object oldValue, object newValue)
{
var toggleButton = (ToggleButton)bindable;
if (Equals(newValue, null) && !Equals(oldValue, null))
return;
if (toggleButton.Checked)
{
toggleButton._toggleImage.Source = toggleButton.CheckedImage;
}
else
{
toggleButton._toggleImage.Source = toggleButton.UnCheckedImage;
}
toggleButton.Content = toggleButton._toggleImage;
if (toggleButton.Animate)
{
await toggleButton.ScaleTo(0.9, 50, Easing.Linear);
await Task.Delay(100);
await toggleButton.ScaleTo(1, 50, Easing.Linear);
}
}
}
}

+ 18
- 0
src/Mobile/eShopOnContainers/eShopOnContainers.Core/Exceptions/ServiceAuthenticationException.cs View File

@ -0,0 +1,18 @@
using System;
namespace eShopOnContainers.Core.Exceptions
{
public class ServiceAuthenticationException : Exception
{
public string Content { get; }
public ServiceAuthenticationException()
{
}
public ServiceAuthenticationException(string content)
{
Content = content;
}
}
}

+ 2
- 0
src/Mobile/eShopOnContainers/eShopOnContainers.Core/GlobalSettings.cs View File

@ -3,5 +3,7 @@
public static class GlobalSetting
{
public const string RegisterWebsite = "http://104.40.62.65/Account/Register";
public const string CatalogEndpoint = "http://104.40.62.65:5101/api/v1/catalog";
}
}

+ 54
- 0
src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Catalog/CatalogService.cs View File

@ -0,0 +1,54 @@
using System;
using System.Collections.ObjectModel;
using System.Threading.Tasks;
using eShopOnContainers.Core.Models.Catalog;
using eShopOnContainers.Core.Services.RequestProvider;
using System.Collections.Generic;
using eShopOnContainers.Core.Extensions;
namespace eShopOnContainers.Core.Services.Catalog
{
public class CatalogService : ICatalogService
{
private readonly IRequestProvider _requestProvider;
public CatalogService(IRequestProvider requestProvider)
{
_requestProvider = requestProvider;
}
public Task<ObservableCollection<CatalogItem>> FilterAsync(string catalogBrand, string catalogType)
{
throw new NotImplementedException();
}
public async Task<ObservableCollection<CatalogItem>> GetCatalogAsync()
{
UriBuilder builder = new UriBuilder(GlobalSetting.CatalogEndpoint);
builder.Path = "/items";
string uri = builder.ToString();
IEnumerable<CatalogItem> catalogItems =
await _requestProvider.GetAsync<IEnumerable<CatalogItem>>(uri);
return catalogItems.ToObservableCollection();
}
public Task<ObservableCollection<CatalogBrand>> GetCatalogBrandAsync()
{
throw new NotImplementedException();
}
public Task<CatalogItem> GetCatalogItemAsync(string id)
{
throw new NotImplementedException();
}
public Task<ObservableCollection<CatalogType>> GetCatalogTypeAsync()
{
throw new NotImplementedException();
}
}
}

+ 17
- 0
src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/RequestProvider/IRequestProvider.cs View File

@ -0,0 +1,17 @@
using System.Threading.Tasks;
namespace eShopOnContainers.Core.Services.RequestProvider
{
public interface IRequestProvider
{
Task<TResult> GetAsync<TResult>(string uri);
Task<TResult> PostAsync<TResult>(string uri, TResult data);
Task<TResult> PostAsync<TRequest, TResult>(string uri, TRequest data);
Task<TResult> PutAsync<TResult>(string uri, TResult data);
Task<TResult> PutAsync<TRequest, TResult>(string uri, TRequest data);
}
}

+ 102
- 0
src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/RequestProvider/RequestProvider.cs View File

@ -0,0 +1,102 @@
using eShopOnContainers.Core.Exceptions;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Serialization;
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
namespace eShopOnContainers.Core.Services.RequestProvider
{
public class RequestProvider : IRequestProvider
{
private readonly JsonSerializerSettings _serializerSettings;
public RequestProvider()
{
_serializerSettings = new JsonSerializerSettings
{
ContractResolver = new CamelCasePropertyNamesContractResolver(),
DateTimeZoneHandling = DateTimeZoneHandling.Utc,
NullValueHandling = NullValueHandling.Ignore
};
_serializerSettings.Converters.Add(new StringEnumConverter());
}
public async Task<TResult> GetAsync<TResult>(string uri)
{
HttpClient httpClient = CreateHttpClient();
HttpResponseMessage response = await httpClient.GetAsync(uri);
await HandleResponse(response);
string serialized = await response.Content.ReadAsStringAsync();
TResult result = await Task.Run(() => JsonConvert.DeserializeObject<TResult>(serialized, _serializerSettings));
return result;
}
public Task<TResult> PostAsync<TResult>(string uri, TResult data)
{
return PostAsync<TResult, TResult>(uri, data);
}
public async Task<TResult> PostAsync<TRequest, TResult>(string uri, TRequest data)
{
HttpClient httpClient = CreateHttpClient();
string serialized = await Task.Run(() => JsonConvert.SerializeObject(data, _serializerSettings));
HttpResponseMessage response = await httpClient.PostAsync(uri, new StringContent(serialized, Encoding.UTF8, "application/json"));
await HandleResponse(response);
string responseData = await response.Content.ReadAsStringAsync();
return await Task.Run(() => JsonConvert.DeserializeObject<TResult>(responseData, _serializerSettings));
}
public Task<TResult> PutAsync<TResult>(string uri, TResult data)
{
return PutAsync<TResult, TResult>(uri, data);
}
public async Task<TResult> PutAsync<TRequest, TResult>(string uri, TRequest data)
{
HttpClient httpClient = CreateHttpClient();
string serialized = await Task.Run(() => JsonConvert.SerializeObject(data, _serializerSettings));
HttpResponseMessage response = await httpClient.PutAsync(uri, new StringContent(serialized, Encoding.UTF8, "application/json"));
await HandleResponse(response);
string responseData = await response.Content.ReadAsStringAsync();
return await Task.Run(() => JsonConvert.DeserializeObject<TResult>(responseData, _serializerSettings));
}
private HttpClient CreateHttpClient()
{
var httpClient = new HttpClient();
httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
return httpClient;
}
private async Task HandleResponse(HttpResponseMessage response)
{
if (!response.IsSuccessStatusCode)
{
var content = await response.Content.ReadAsStringAsync();
if (response.StatusCode == HttpStatusCode.Forbidden || response.StatusCode == HttpStatusCode.Unauthorized)
{
throw new ServiceAuthenticationException(content);
}
throw new HttpRequestException(content);
}
}
}
}

+ 2
- 2
src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/Base/ViewModelLocator.cs View File

@ -24,7 +24,7 @@ namespace eShopOnContainers.ViewModels.Base
{
_unityContainer = new UnityContainer();
// services
// Services
_unityContainer.RegisterType<IDialogService, DialogService>();
RegisterSingleton<INavigationService, NavigationService>();
_unityContainer.RegisterType<IOpenUrlService, OpenUrlService>();
@ -33,7 +33,7 @@ namespace eShopOnContainers.ViewModels.Base
_unityContainer.RegisterType<IOrdersService, OrdersMockService>();
_unityContainer.RegisterType<IUserService, UserMockService>();
// view models
// View models
_unityContainer.RegisterType<CartViewModel>();
_unityContainer.RegisterType<CatalogViewModel>();
_unityContainer.RegisterType<CheckoutViewModel>();


+ 3
- 3
src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/MainView.xaml View File

@ -15,9 +15,9 @@
<ToolbarItem.Icon>
<OnPlatform
x:TypeArguments="FileImageSource"
WinPhone=""
Android=""
iOS=""/>
WinPhone="Assets/app_settings.png"
Android="app_settings"
iOS="app_settings"/>
</ToolbarItem.Icon>
</ToolbarItem>
</ContentPage.ToolbarItems>


+ 26
- 8
src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/SettingsView.xaml View File

@ -27,11 +27,17 @@
<Setter Property="FontSize"
Value="{StaticResource LittleSize}" />
</Style>
<Style x:Key="SettingsSwitchStyle"
TargetType="{x:Type controls:CustomSwitch}">
<Style x:Key="SettingsToggleButtonStyle"
TargetType="{x:Type controls:ToggleButton}">
<Setter Property="HeightRequest"
Value="48" />
<Setter Property="WidthRequest"
Value="48" />
<Setter Property="VerticalOptions"
Value="Center" />
<Setter Property="Margin"
Value="12, 0" />
</Style>
</ResourceDictionary>
@ -60,7 +66,7 @@
<StackLayout
Grid.Column="0"
Grid.Row="1">
<Label
<Label
Text="Use Mock Services"
TextColor="{StaticResource GreenColor}"
Style="{StaticResource SettingsTitleStyle}"/>
@ -68,12 +74,24 @@
Text="Mock Services are simulated objects that mimic the behavior of real services in controlled ways"
Style="{StaticResource SettingsDescriptionStyle}"/>
</StackLayout>
<controls:CustomSwitch
TextOn="Mock"
TextOff="Azure"
<controls:ToggleButton
Grid.Column="1"
Grid.Row="1"
Style="{StaticResource SettingsSwitchStyle}"/>
Animate="True"
Style="{StaticResource SettingsToggleButtonStyle}">
<controls:ToggleButton.CheckedImage>
<OnPlatform x:TypeArguments="ImageSource"
Android="toggle_azure"
iOS="toggle_azure"
WinPhone="Assets/toggle_azure.png"/>
</controls:ToggleButton.CheckedImage>
<controls:ToggleButton.UnCheckedImage>
<OnPlatform x:TypeArguments="ImageSource"
Android="toggle_local"
iOS="toggle_local"
WinPhone="Assets/toggle_local.png"/>
</controls:ToggleButton.UnCheckedImage>
</controls:ToggleButton>
<Grid
Grid.Row="2"
Grid.Column="0"


+ 22
- 1
src/Mobile/eShopOnContainers/eShopOnContainers.Core/eShopOnContainers.Core.csproj View File

@ -48,8 +48,8 @@
<Compile Include="Controls\CartButton.xaml.cs">
<DependentUpon>CartButton.xaml</DependentUpon>
</Compile>
<Compile Include="Controls\CustomSwitch.cs" />
<Compile Include="Controls\CustomTabbedPage.cs" />
<Compile Include="Controls\ToggleButton.cs" />
<Compile Include="Converters\CountToBoolConverter.cs" />
<Compile Include="Converters\DatetimeConverter.cs" />
<Compile Include="Converters\ImageConverter.cs" />
@ -58,6 +58,7 @@
<Compile Include="Converters\ItemTappedConverter.cs" />
<Compile Include="Converters\ToUpperConverter.cs" />
<Compile Include="Effects\LineColorEffect.cs" />
<Compile Include="Exceptions\ServiceAuthenticationException.cs" />
<Compile Include="Extensions\AnimationExtension.cs" />
<Compile Include="Extensions\ObservableExtension.cs" />
<Compile Include="GlobalSettings.cs" />
@ -72,6 +73,7 @@
<Compile Include="Models\Catalog\CatalogItem.cs" />
<Compile Include="Models\User\User.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Services\Catalog\CatalogService.cs" />
<Compile Include="Services\Dialog\DialogService.cs" />
<Compile Include="Services\Dialog\IDialogService.cs" />
<Compile Include="Services\Navigation\INavigationService.cs" />
@ -82,6 +84,8 @@
<Compile Include="Services\Orders\IOrdersService.cs" />
<Compile Include="Services\Catalog\CatalogMockService.cs" />
<Compile Include="Services\Catalog\ICatalogService.cs" />
<Compile Include="Services\RequestProvider\IRequestProvider.cs" />
<Compile Include="Services\RequestProvider\RequestProvider.cs" />
<Compile Include="Services\User\IUserService.cs" />
<Compile Include="Services\User\UserMockService.cs" />
<Compile Include="Triggers\BeginAnimation.cs" />
@ -201,6 +205,18 @@
<HintPath>..\..\packages\Splat.1.6.2\lib\Portable-net45+win+wpa81+wp80\Splat.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Net.Http, Version=1.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\..\packages\Microsoft.Net.Http.2.2.29\lib\portable-net40+sl4+win8+wp71+wpa81\System.Net.Http.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Net.Http.Extensions, Version=1.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\..\packages\Microsoft.Net.Http.2.2.29\lib\portable-net40+sl4+win8+wp71+wpa81\System.Net.Http.Extensions.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Net.Http.Primitives, Version=1.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\..\packages\Microsoft.Net.Http.2.2.29\lib\portable-net40+sl4+win8+wp71+wpa81\System.Net.Http.Primitives.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Xamarin.Forms.Core, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\Xamarin.Forms.2.3.2.127\lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.Core.dll</HintPath>
<Private>True</Private>
@ -324,4 +340,9 @@
<Error Condition="!Exists('..\..\packages\StyleCop.MSBuild.5.0.0-alpha01\build\StyleCop.MSBuild.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\StyleCop.MSBuild.5.0.0-alpha01\build\StyleCop.MSBuild.targets'))" />
</Target>
<Import Project="..\..\packages\StyleCop.MSBuild.5.0.0-alpha01\build\StyleCop.MSBuild.targets" Condition="Exists('..\..\packages\StyleCop.MSBuild.5.0.0-alpha01\build\StyleCop.MSBuild.targets')" />
<Import Project="..\..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets" Condition="Exists('..\..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets')" />
<Target Name="EnsureBclBuildImported" BeforeTargets="BeforeBuild" Condition="'$(BclBuildImported)' == ''">
<Error Condition="!Exists('..\..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets')" Text="This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=317567." HelpKeyword="BCLBUILD2001" />
<Error Condition="Exists('..\..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets')" Text="The build restored NuGet packages. Build the project again to include these packages in the build. For more information, see http://go.microsoft.com/fwlink/?LinkID=317568." HelpKeyword="BCLBUILD2002" />
</Target>
</Project>

+ 3
- 0
src/Mobile/eShopOnContainers/eShopOnContainers.Core/packages.config View File

@ -2,6 +2,9 @@
<packages>
<package id="Acr.UserDialogs" version="6.3.1" targetFramework="portable45-net45+win8+wp8+wpa81" />
<package id="CommonServiceLocator" version="1.3" targetFramework="portable45-net45+win8+wp8+wpa81" />
<package id="Microsoft.Bcl" version="1.1.10" targetFramework="portable45-net45+win8+wp8+wpa81" />
<package id="Microsoft.Bcl.Build" version="1.0.14" targetFramework="portable45-net45+win8+wp8+wpa81" />
<package id="Microsoft.Net.Http" version="2.2.29" targetFramework="portable45-net45+win8+wp8+wpa81" />
<package id="modernhttpclient" version="2.4.2" targetFramework="portable45-net45+win8+wp8+wpa81" />
<package id="Newtonsoft.Json" version="8.0.3" targetFramework="portable45-net45+win8+wp8+wpa81" />
<package id="SlideOverKit" version="2.1.4" targetFramework="portable45-net45+win8+wp8+wpa81" />


+ 0
- 58
src/Mobile/eShopOnContainers/eShopOnContainers.Droid/Renderers/CustomSwitchRenderer.cs View File

@ -1,58 +0,0 @@
using System;
using Xamarin.Forms.Platform.Android;
using Xamarin.Forms;
using eShopOnContainers.Core.Controls;
namespace eShopOnContainers.Droid.Renderers
{
public class CustomSwitchRenderer : ViewRenderer<CustomSwitch, Android.Widget.Switch>
{
protected override void OnElementChanged(ElementChangedEventArgs<CustomSwitch> e)
{
base.OnElementChanged(e);
if (e.OldElement != null)
{
this.Element.Toggled -= ElementToggled;
return;
}
if (this.Element == null)
{
return;
}
var switchControl = new Android.Widget.Switch(Forms.Context)
{
TextOn = this.Element.TextOn,
TextOff = this.Element.TextOff
};
switchControl.CheckedChange += ControlValueChanged;
this.Element.Toggled += ElementToggled;
this.SetNativeControl(switchControl);
}
protected override void Dispose(bool disposing)
{
if (disposing)
{
this.Control.CheckedChange -= this.ControlValueChanged;
this.Element.Toggled -= ElementToggled;
}
base.Dispose(disposing);
}
private void ElementToggled(object sender, ToggledEventArgs e)
{
this.Control.Checked = this.Element.IsToggled;
}
private void ControlValueChanged(object sender, EventArgs e)
{
this.Element.IsToggled = this.Control.Checked;
}
}
}

+ 1
- 1
src/Mobile/eShopOnContainers/eShopOnContainers.Droid/Renderers/CustomTabbedPageRenderer.cs View File

@ -35,7 +35,7 @@ namespace eShopOnContainers.Droid.Renderers
if (_tabLayout == null)
{
Console.WriteLine("No TabLayout found. Bedge not added.");
Console.WriteLine("No TabLayout found. Badge not added.");
return;
}


+ 111
- 105
src/Mobile/eShopOnContainers/eShopOnContainers.Droid/Resources/Resource.Designer.cs View File

@ -2021,313 +2021,319 @@ namespace eShopOnContainers.Droid
public const int abc_textfield_search_material = 2130837578;
// aapt resource value: 0x7f02004b
public const int background = 2130837579;
public const int app_settings = 2130837579;
// aapt resource value: 0x7f02004c
public const int design_fab_background = 2130837580;
public const int background = 2130837580;
// aapt resource value: 0x7f02004d
public const int design_snackbar_background = 2130837581;
public const int design_fab_background = 2130837581;
// aapt resource value: 0x7f02004e
public const int fake_product_01 = 2130837582;
public const int design_snackbar_background = 2130837582;
// aapt resource value: 0x7f02004f
public const int fake_product_02 = 2130837583;
public const int fake_product_01 = 2130837583;
// aapt resource value: 0x7f020050
public const int fake_product_03 = 2130837584;
public const int fake_product_02 = 2130837584;
// aapt resource value: 0x7f020051
public const int fake_product_04 = 2130837585;
public const int fake_product_03 = 2130837585;
// aapt resource value: 0x7f020052
public const int fake_product_05 = 2130837586;
public const int fake_product_04 = 2130837586;
// aapt resource value: 0x7f020053
public const int ic_audiotrack = 2130837587;
public const int fake_product_05 = 2130837587;
// aapt resource value: 0x7f020054
public const int ic_audiotrack_light = 2130837588;
public const int ic_audiotrack = 2130837588;
// aapt resource value: 0x7f020055
public const int ic_bluetooth_grey = 2130837589;
public const int ic_audiotrack_light = 2130837589;
// aapt resource value: 0x7f020056
public const int ic_bluetooth_white = 2130837590;
public const int ic_bluetooth_grey = 2130837590;
// aapt resource value: 0x7f020057
public const int ic_cast_dark = 2130837591;
public const int ic_bluetooth_white = 2130837591;
// aapt resource value: 0x7f020058
public const int ic_cast_disabled_light = 2130837592;
public const int ic_cast_dark = 2130837592;
// aapt resource value: 0x7f020059
public const int ic_cast_grey = 2130837593;
public const int ic_cast_disabled_light = 2130837593;
// aapt resource value: 0x7f02005a
public const int ic_cast_light = 2130837594;
public const int ic_cast_grey = 2130837594;
// aapt resource value: 0x7f02005b
public const int ic_cast_off_light = 2130837595;
public const int ic_cast_light = 2130837595;
// aapt resource value: 0x7f02005c
public const int ic_cast_on_0_light = 2130837596;
public const int ic_cast_off_light = 2130837596;
// aapt resource value: 0x7f02005d
public const int ic_cast_on_1_light = 2130837597;
public const int ic_cast_on_0_light = 2130837597;
// aapt resource value: 0x7f02005e
public const int ic_cast_on_2_light = 2130837598;
public const int ic_cast_on_1_light = 2130837598;
// aapt resource value: 0x7f02005f
public const int ic_cast_on_light = 2130837599;
public const int ic_cast_on_2_light = 2130837599;
// aapt resource value: 0x7f020060
public const int ic_cast_white = 2130837600;
public const int ic_cast_on_light = 2130837600;
// aapt resource value: 0x7f020061
public const int ic_close_dark = 2130837601;
public const int ic_cast_white = 2130837601;
// aapt resource value: 0x7f020062
public const int ic_close_light = 2130837602;
public const int ic_close_dark = 2130837602;
// aapt resource value: 0x7f020063
public const int ic_collapse = 2130837603;
public const int ic_close_light = 2130837603;
// aapt resource value: 0x7f020064
public const int ic_collapse_00000 = 2130837604;
public const int ic_collapse = 2130837604;
// aapt resource value: 0x7f020065
public const int ic_collapse_00001 = 2130837605;
public const int ic_collapse_00000 = 2130837605;
// aapt resource value: 0x7f020066
public const int ic_collapse_00002 = 2130837606;
public const int ic_collapse_00001 = 2130837606;
// aapt resource value: 0x7f020067
public const int ic_collapse_00003 = 2130837607;
public const int ic_collapse_00002 = 2130837607;
// aapt resource value: 0x7f020068
public const int ic_collapse_00004 = 2130837608;
public const int ic_collapse_00003 = 2130837608;
// aapt resource value: 0x7f020069
public const int ic_collapse_00005 = 2130837609;
public const int ic_collapse_00004 = 2130837609;
// aapt resource value: 0x7f02006a
public const int ic_collapse_00006 = 2130837610;
public const int ic_collapse_00005 = 2130837610;
// aapt resource value: 0x7f02006b
public const int ic_collapse_00007 = 2130837611;
public const int ic_collapse_00006 = 2130837611;
// aapt resource value: 0x7f02006c
public const int ic_collapse_00008 = 2130837612;
public const int ic_collapse_00007 = 2130837612;
// aapt resource value: 0x7f02006d
public const int ic_collapse_00009 = 2130837613;
public const int ic_collapse_00008 = 2130837613;
// aapt resource value: 0x7f02006e
public const int ic_collapse_00010 = 2130837614;
public const int ic_collapse_00009 = 2130837614;
// aapt resource value: 0x7f02006f
public const int ic_collapse_00011 = 2130837615;
public const int ic_collapse_00010 = 2130837615;
// aapt resource value: 0x7f020070
public const int ic_collapse_00012 = 2130837616;
public const int ic_collapse_00011 = 2130837616;
// aapt resource value: 0x7f020071
public const int ic_collapse_00013 = 2130837617;
public const int ic_collapse_00012 = 2130837617;
// aapt resource value: 0x7f020072
public const int ic_collapse_00014 = 2130837618;
public const int ic_collapse_00013 = 2130837618;
// aapt resource value: 0x7f020073
public const int ic_collapse_00015 = 2130837619;
public const int ic_collapse_00014 = 2130837619;
// aapt resource value: 0x7f020074
public const int ic_errorstatus = 2130837620;
public const int ic_collapse_00015 = 2130837620;
// aapt resource value: 0x7f020075
public const int ic_expand = 2130837621;
public const int ic_errorstatus = 2130837621;
// aapt resource value: 0x7f020076
public const int ic_expand_00000 = 2130837622;
public const int ic_expand = 2130837622;
// aapt resource value: 0x7f020077
public const int ic_expand_00001 = 2130837623;
public const int ic_expand_00000 = 2130837623;
// aapt resource value: 0x7f020078
public const int ic_expand_00002 = 2130837624;
public const int ic_expand_00001 = 2130837624;
// aapt resource value: 0x7f020079
public const int ic_expand_00003 = 2130837625;
public const int ic_expand_00002 = 2130837625;
// aapt resource value: 0x7f02007a
public const int ic_expand_00004 = 2130837626;
public const int ic_expand_00003 = 2130837626;
// aapt resource value: 0x7f02007b
public const int ic_expand_00005 = 2130837627;
public const int ic_expand_00004 = 2130837627;
// aapt resource value: 0x7f02007c
public const int ic_expand_00006 = 2130837628;
public const int ic_expand_00005 = 2130837628;
// aapt resource value: 0x7f02007d
public const int ic_expand_00007 = 2130837629;
public const int ic_expand_00006 = 2130837629;
// aapt resource value: 0x7f02007e
public const int ic_expand_00008 = 2130837630;
public const int ic_expand_00007 = 2130837630;
// aapt resource value: 0x7f02007f
public const int ic_expand_00009 = 2130837631;
public const int ic_expand_00008 = 2130837631;
// aapt resource value: 0x7f020080
public const int ic_expand_00010 = 2130837632;
public const int ic_expand_00009 = 2130837632;
// aapt resource value: 0x7f020081
public const int ic_expand_00011 = 2130837633;
public const int ic_expand_00010 = 2130837633;
// aapt resource value: 0x7f020082
public const int ic_expand_00012 = 2130837634;
public const int ic_expand_00011 = 2130837634;
// aapt resource value: 0x7f020083
public const int ic_expand_00013 = 2130837635;
public const int ic_expand_00012 = 2130837635;
// aapt resource value: 0x7f020084
public const int ic_expand_00014 = 2130837636;
public const int ic_expand_00013 = 2130837636;
// aapt resource value: 0x7f020085
public const int ic_expand_00015 = 2130837637;
public const int ic_expand_00014 = 2130837637;
// aapt resource value: 0x7f020086
public const int ic_media_pause = 2130837638;
public const int ic_expand_00015 = 2130837638;
// aapt resource value: 0x7f020087
public const int ic_media_play = 2130837639;
public const int ic_media_pause = 2130837639;
// aapt resource value: 0x7f020088
public const int ic_media_route_disabled_mono_dark = 2130837640;
public const int ic_media_play = 2130837640;
// aapt resource value: 0x7f020089
public const int ic_media_route_off_mono_dark = 2130837641;
public const int ic_media_route_disabled_mono_dark = 2130837641;
// aapt resource value: 0x7f02008a
public const int ic_media_route_on_0_mono_dark = 2130837642;
public const int ic_media_route_off_mono_dark = 2130837642;
// aapt resource value: 0x7f02008b
public const int ic_media_route_on_1_mono_dark = 2130837643;
public const int ic_media_route_on_0_mono_dark = 2130837643;
// aapt resource value: 0x7f02008c
public const int ic_media_route_on_2_mono_dark = 2130837644;
public const int ic_media_route_on_1_mono_dark = 2130837644;
// aapt resource value: 0x7f02008d
public const int ic_media_route_on_mono_dark = 2130837645;
public const int ic_media_route_on_2_mono_dark = 2130837645;
// aapt resource value: 0x7f02008e
public const int ic_pause_dark = 2130837646;
public const int ic_media_route_on_mono_dark = 2130837646;
// aapt resource value: 0x7f02008f
public const int ic_pause_light = 2130837647;
public const int ic_pause_dark = 2130837647;
// aapt resource value: 0x7f020090
public const int ic_play_dark = 2130837648;
public const int ic_pause_light = 2130837648;
// aapt resource value: 0x7f020091
public const int ic_play_light = 2130837649;
public const int ic_play_dark = 2130837649;
// aapt resource value: 0x7f020092
public const int ic_speaker_dark = 2130837650;
public const int ic_play_light = 2130837650;
// aapt resource value: 0x7f020093
public const int ic_speaker_group_dark = 2130837651;
public const int ic_speaker_dark = 2130837651;
// aapt resource value: 0x7f020094
public const int ic_speaker_group_light = 2130837652;
public const int ic_speaker_group_dark = 2130837652;
// aapt resource value: 0x7f020095
public const int ic_speaker_light = 2130837653;
public const int ic_speaker_group_light = 2130837653;
// aapt resource value: 0x7f020096
public const int ic_successstatus = 2130837654;
public const int ic_speaker_light = 2130837654;
// aapt resource value: 0x7f020097
public const int ic_tv_dark = 2130837655;
public const int ic_successstatus = 2130837655;
// aapt resource value: 0x7f020098
public const int ic_tv_light = 2130837656;
public const int ic_tv_dark = 2130837656;
// aapt resource value: 0x7f020099
public const int icon = 2130837657;
public const int ic_tv_light = 2130837657;
// aapt resource value: 0x7f02009a
public const int menu_cart = 2130837658;
public const int icon = 2130837658;
// aapt resource value: 0x7f02009b
public const int menu_filter = 2130837659;
public const int menu_cart = 2130837659;
// aapt resource value: 0x7f02009c
public const int menu_profile = 2130837660;
public const int menu_filter = 2130837660;
// aapt resource value: 0x7f02009d
public const int mr_dialog_material_background_dark = 2130837661;
public const int menu_profile = 2130837661;
// aapt resource value: 0x7f02009e
public const int mr_dialog_material_background_light = 2130837662;
public const int mr_dialog_material_background_dark = 2130837662;
// aapt resource value: 0x7f02009f
public const int mr_ic_audiotrack_light = 2130837663;
public const int mr_dialog_material_background_light = 2130837663;
// aapt resource value: 0x7f0200a0
public const int mr_ic_cast_dark = 2130837664;
public const int mr_ic_audiotrack_light = 2130837664;
// aapt resource value: 0x7f0200a1
public const int mr_ic_cast_light = 2130837665;
public const int mr_ic_cast_dark = 2130837665;
// aapt resource value: 0x7f0200a2
public const int mr_ic_close_dark = 2130837666;
public const int mr_ic_cast_light = 2130837666;
// aapt resource value: 0x7f0200a3
public const int mr_ic_close_light = 2130837667;
public const int mr_ic_close_dark = 2130837667;
// aapt resource value: 0x7f0200a4
public const int mr_ic_media_route_connecting_mono_dark = 2130837668;
public const int mr_ic_close_light = 2130837668;
// aapt resource value: 0x7f0200a5
public const int mr_ic_media_route_connecting_mono_light = 2130837669;
public const int mr_ic_media_route_connecting_mono_dark = 2130837669;
// aapt resource value: 0x7f0200a6
public const int mr_ic_media_route_mono_dark = 2130837670;
public const int mr_ic_media_route_connecting_mono_light = 2130837670;
// aapt resource value: 0x7f0200a7
public const int mr_ic_media_route_mono_light = 2130837671;
public const int mr_ic_media_route_mono_dark = 2130837671;
// aapt resource value: 0x7f0200a8
public const int mr_ic_pause_dark = 2130837672;
public const int mr_ic_media_route_mono_light = 2130837672;
// aapt resource value: 0x7f0200a9
public const int mr_ic_pause_light = 2130837673;
public const int mr_ic_pause_dark = 2130837673;
// aapt resource value: 0x7f0200aa
public const int mr_ic_play_dark = 2130837674;
public const int mr_ic_pause_light = 2130837674;
// aapt resource value: 0x7f0200ab
public const int mr_ic_play_light = 2130837675;
// aapt resource value: 0x7f0200b1
public const int notification_template_icon_bg = 2130837681;
public const int mr_ic_play_dark = 2130837675;
// aapt resource value: 0x7f0200ac
public const int product_add = 2130837676;
public const int mr_ic_play_light = 2130837676;
// aapt resource value: 0x7f0200b3
public const int notification_template_icon_bg = 2130837683;
// aapt resource value: 0x7f0200ad
public const int roundedbg = 2130837677;
public const int product_add = 2130837677;
// aapt resource value: 0x7f0200ae
public const int roundedbgdark = 2130837678;
public const int roundedbg = 2130837678;
// aapt resource value: 0x7f0200af
public const int splash_drawable = 2130837679;
public const int roundedbgdark = 2130837679;
// aapt resource value: 0x7f0200b0
public const int user_profile = 2130837680;
public const int splash_drawable = 2130837680;
// aapt resource value: 0x7f0200b1
public const int toggle_azure = 2130837681;
// aapt resource value: 0x7f0200b2
public const int toggle_local = 2130837682;
static Drawable()
{


BIN
src/Mobile/eShopOnContainers/eShopOnContainers.Droid/Resources/drawable-hdpi/app_settings.png View File

Before After
Width: 256  |  Height: 256  |  Size: 3.4 KiB

BIN
src/Mobile/eShopOnContainers/eShopOnContainers.Droid/Resources/drawable-hdpi/toggle_azure.png View File

Before After
Width: 256  |  Height: 256  |  Size: 2.3 KiB

BIN
src/Mobile/eShopOnContainers/eShopOnContainers.Droid/Resources/drawable-hdpi/toggle_local.png View File

Before After
Width: 256  |  Height: 256  |  Size: 1.6 KiB

BIN
src/Mobile/eShopOnContainers/eShopOnContainers.Droid/Resources/drawable-xhdpi/app_settings.png View File

Before After
Width: 341  |  Height: 341  |  Size: 5.5 KiB

BIN
src/Mobile/eShopOnContainers/eShopOnContainers.Droid/Resources/drawable-xhdpi/toggle_azure.png View File

Before After
Width: 341  |  Height: 341  |  Size: 3.5 KiB

BIN
src/Mobile/eShopOnContainers/eShopOnContainers.Droid/Resources/drawable-xhdpi/toggle_local.png View File

Before After
Width: 341  |  Height: 341  |  Size: 2.6 KiB

BIN
src/Mobile/eShopOnContainers/eShopOnContainers.Droid/Resources/drawable-xxhdpi/app_settings.png View File

Before After
Width: 512  |  Height: 512  |  Size: 9.3 KiB

BIN
src/Mobile/eShopOnContainers/eShopOnContainers.Droid/Resources/drawable-xxhdpi/toggle_azure.png View File

Before After
Width: 512  |  Height: 512  |  Size: 5.5 KiB

BIN
src/Mobile/eShopOnContainers/eShopOnContainers.Droid/Resources/drawable-xxhdpi/toggle_local.png View File

Before After
Width: 512  |  Height: 512  |  Size: 3.5 KiB

BIN
src/Mobile/eShopOnContainers/eShopOnContainers.Droid/Resources/drawable-xxxhdpi/background.png View File

Before After
Width: 1280  |  Height: 1920  |  Size: 234 KiB

BIN
src/Mobile/eShopOnContainers/eShopOnContainers.Droid/Resources/drawable-xxxhdpi/icon.png View File

Before After
Width: 192  |  Height: 192  |  Size: 13 KiB

BIN
src/Mobile/eShopOnContainers/eShopOnContainers.Droid/Resources/drawable-xxxhdpi/menu_cart.png View File

Before After
Width: 45  |  Height: 37  |  Size: 1.6 KiB

BIN
src/Mobile/eShopOnContainers/eShopOnContainers.Droid/Resources/drawable-xxxhdpi/user_profile.png View File

Before After
Width: 35  |  Height: 35  |  Size: 1.6 KiB

+ 13
- 9
src/Mobile/eShopOnContainers/eShopOnContainers.Droid/app.config View File

@ -1,22 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Net.Http" publicKeyToken="B03F5F7F11D50A3A" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0"/>
<assemblyIdentity name="System.Net.Http" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.ObjectModel" publicKeyToken="B03F5F7F11D50A3A" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0"/>
<assemblyIdentity name="System.ObjectModel" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime" publicKeyToken="B03F5F7F11D50A3A" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0"/>
<assemblyIdentity name="System.Runtime" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0"/>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.5.0.0" newVersion="1.5.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>


+ 26
- 12
src/Mobile/eShopOnContainers/eShopOnContainers.Droid/eShopOnContainers.Droid.csproj View File

@ -17,7 +17,7 @@
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
<AndroidUseLatestPlatformSdk>true</AndroidUseLatestPlatformSdk>
<TargetFrameworkVersion>v6.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v7.0</TargetFrameworkVersion>
<AndroidSupportedAbis>armeabi,armeabi-v7a,x86</AndroidSupportedAbis>
<AndroidStoreUncompressedFileExtensions />
<MandroidI18n />
@ -203,7 +203,6 @@
<Compile Include="Effects\EntryLineColorEffect.cs" />
<Compile Include="Extensions\ViewExtensions.cs" />
<Compile Include="Renderers\BadgeView.cs" />
<Compile Include="Renderers\CustomSwitchRenderer.cs" />
<Compile Include="Renderers\CustomTabbedPageRenderer.cs" />
<Compile Include="Renderers\SlideDownMenuPageRenderer.cs" />
<Compile Include="Resources\Resource.Designer.cs" />
@ -300,34 +299,49 @@
<AndroidResource Include="Resources\drawable-hdpi\product_add.png" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\drawable-xxxhdpi\user_profile.png" />
<AndroidResource Include="Resources\values\colors.xml" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\values\colors.xml" />
<AndroidResource Include="Resources\drawable-hdpi\background.png" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\drawable-xxxhdpi\menu_cart.png" />
<AndroidResource Include="Resources\drawable-xhdpi\background.png" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\drawable-xxxhdpi\icon.png" />
<AndroidResource Include="Resources\drawable-xxhdpi\background.png" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\drawable-hdpi\background.png" />
<AndroidResource Include="Resources\drawable\fake_product_04.png" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\drawable-xhdpi\background.png" />
<AndroidResource Include="Resources\drawable\fake_product_05.png" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\drawable-xxhdpi\background.png" />
<AndroidResource Include="Resources\drawable-hdpi\toggle_local.png" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\drawable-xxxhdpi\background.png" />
<AndroidResource Include="Resources\drawable-xhdpi\toggle_local.png" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\drawable\fake_product_04.png" />
<AndroidResource Include="Resources\drawable-xxhdpi\toggle_local.png" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\drawable\fake_product_05.png" />
<AndroidResource Include="Resources\drawable-hdpi\app_settings.png" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\drawable-xhdpi\app_settings.png" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\drawable-xxhdpi\app_settings.png" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\drawable-hdpi\toggle_azure.png" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\drawable-xxhdpi\toggle_azure.png" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\drawable-xhdpi\toggle_azure.png" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
<Import Project="..\..\packages\Xamarin.Android.Support.Vector.Drawable.23.3.0\build\Xamarin.Android.Support.Vector.Drawable.targets" Condition="Exists('..\..\packages\Xamarin.Android.Support.Vector.Drawable.23.3.0\build\Xamarin.Android.Support.Vector.Drawable.targets')" />


+ 2
- 1
src/Mobile/eShopOnContainers/eShopOnContainers.Droid/eShopOnContainers.Droid.csproj.bak View File

@ -17,7 +17,7 @@
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
<AndroidUseLatestPlatformSdk>true</AndroidUseLatestPlatformSdk>
<TargetFrameworkVersion>v7.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v6.0</TargetFrameworkVersion>
<AndroidSupportedAbis>armeabi,armeabi-v7a,x86</AndroidSupportedAbis>
<AndroidStoreUncompressedFileExtensions />
<MandroidI18n />
@ -203,6 +203,7 @@
<Compile Include="Effects\EntryLineColorEffect.cs" />
<Compile Include="Extensions\ViewExtensions.cs" />
<Compile Include="Renderers\BadgeView.cs" />
<Compile Include="Renderers\CustomSwitchRenderer.cs" />
<Compile Include="Renderers\CustomTabbedPageRenderer.cs" />
<Compile Include="Renderers\SlideDownMenuPageRenderer.cs" />
<Compile Include="Resources\Resource.Designer.cs" />


+ 309
- 1
src/Mobile/eShopOnContainers/eShopOnContainers.Windows/App.xaml View File

@ -284,8 +284,316 @@
</Setter>
</Style>
<Style TargetType="Pivot">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Pivot">
<Grid x:Name="RootElement"
HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
VerticalAlignment="{TemplateBinding VerticalAlignment}"
Background="{TemplateBinding Background}">
<Grid.Resources>
<Style x:Key="BaseContentControlStyle" TargetType="ContentControl">
<Setter Property="FontFamily" Value="Segoe UI" />
<Setter Property="FontWeight" Value="SemiBold" />
<Setter Property="FontSize" Value="15" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ContentControl">
<ContentPresenter
Margin="{TemplateBinding Padding}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"
ContentTransitions="{TemplateBinding ContentTransitions}"
OpticalMarginAlignment="TrimSideBearings" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="TitleContentControlStyle" BasedOn="{StaticResource BaseContentControlStyle}" TargetType="ContentControl">
<Setter Property="FontWeight" Value="SemiLight" />
<Setter Property="FontSize" Value="24" />
</Style>
<!-- While used here to remove the spacing between header items, the PivotHeaderItem template can also be used to
display custom 'selected' visuals -->
<Style TargetType="PivotHeaderItem">
<Setter Property="Padding" Value="0" />
</Style>
</Grid.Resources>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="Orientation">
<VisualState x:Name="Portrait">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="TitleContentControl" Storyboard.TargetProperty="Margin">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource PivotPortraitThemePadding}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Landscape">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="TitleContentControl" Storyboard.TargetProperty="Margin">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource PivotLandscapeThemePadding}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="NavigationButtonsVisibility">
<VisualState x:Name="NavigationButtonsHidden" />
<VisualState x:Name="NavigationButtonsVisible">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="NextButton" Storyboard.TargetProperty="Opacity">
<DiscreteObjectKeyFrame KeyTime="0" Value="1" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="NextButton" Storyboard.TargetProperty="IsEnabled">
<DiscreteObjectKeyFrame KeyTime="0" Value="True" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="PreviousButton" Storyboard.TargetProperty="Opacity">
<DiscreteObjectKeyFrame KeyTime="0" Value="1" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="PreviousButton" Storyboard.TargetProperty="IsEnabled">
<DiscreteObjectKeyFrame KeyTime="0" Value="True" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="HeaderStates">
<VisualState x:Name="HeaderDynamic" />
<VisualState x:Name="HeaderStatic">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="Header" Storyboard.TargetProperty="Visibility">
<DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="StaticHeader" Storyboard.TargetProperty="Visibility">
<DiscreteObjectKeyFrame KeyTime="0" Value="Visible" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<ContentControl x:Name="TitleContentControl"
Margin="{StaticResource PivotPortraitThemePadding}"
Content="{TemplateBinding Title}"
ContentTemplate="{TemplateBinding TitleTemplate}"
IsTabStop="False"
Style="{StaticResource TitleContentControlStyle}"
Visibility="Collapsed" />
<Grid Grid.Row="1">
<Grid.Resources>
<ResourceDictionary>
<ResourceDictionary.ThemeDictionaries>
<ResourceDictionary x:Key="Default">
<SolidColorBrush x:Key="SystemControlPageBackgroundChromeMediumBrush" Color="{ThemeResource SystemChromeMediumColor}" />
<SolidColorBrush x:Key="SystemControlForegroundChromeMediumBrush" Color="{ThemeResource SystemChromeMediumColor}" />
</ResourceDictionary>
<ResourceDictionary x:Key="Light">
<SolidColorBrush x:Key="SystemControlPageBackgroundChromeMediumBrush" Color="{ThemeResource SystemChromeMediumColor}" />
<SolidColorBrush x:Key="SystemControlForegroundChromeMediumBrush" Color="{ThemeResource SystemChromeMediumColor}" />
</ResourceDictionary>
<ResourceDictionary x:Key="HighContrast">
<SolidColorBrush x:Key="SystemControlPageBackgroundChromeMediumBrush" Color="{ThemeResource SystemColorWindowColor}" />
<SolidColorBrush x:Key="SystemControlForegroundChromeMediumBrush" Color="{ThemeResource SystemColorButtonTextColor}" />
</ResourceDictionary>
</ResourceDictionary.ThemeDictionaries>
<ControlTemplate x:Key="NextTemplate" TargetType="Button">
<Border x:Name="Root"
Background="{ThemeResource SystemControlBackgroundBaseMediumLowBrush}"
BorderBrush="{ThemeResource SystemControlForegroundTransparentBrush}"
BorderThickness="{ThemeResource PivotNavButtonBorderThemeThickness}">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal" />
<VisualState x:Name="PointerOver">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="Root" Storyboard.TargetProperty="Background">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightBaseMediumBrush}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="Arrow" Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightAltAltMediumHighBrush}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Pressed">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="Root" Storyboard.TargetProperty="Background">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightBaseMediumHighBrush}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="Arrow" Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightAltAltMediumHighBrush}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<FontIcon x:Name="Arrow"
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontFamily="{ThemeResource SymbolThemeFontFamily}"
FontSize="12"
Foreground="{ThemeResource SystemControlForegroundAltMediumHighBrush}"
Glyph="&#xE0E3;"
MirroredWhenRightToLeft="True"
UseLayoutRounding="False" />
</Border>
</ControlTemplate>
<ControlTemplate x:Key="PreviousTemplate" TargetType="Button">
<Border x:Name="Root"
Background="{ThemeResource SystemControlBackgroundBaseMediumLowBrush}"
BorderBrush="{ThemeResource SystemControlForegroundTransparentBrush}"
BorderThickness="{ThemeResource PivotNavButtonBorderThemeThickness}">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal" />
<VisualState x:Name="PointerOver">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="Root" Storyboard.TargetProperty="Background">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightBaseMediumBrush}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="Arrow" Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightAltAltMediumHighBrush}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Pressed">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="Root" Storyboard.TargetProperty="Background">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightBaseMediumHighBrush}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="Arrow" Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightAltAltMediumHighBrush}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<FontIcon x:Name="Arrow"
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontFamily="{ThemeResource SymbolThemeFontFamily}"
FontSize="12"
Foreground="{ThemeResource SystemControlForegroundAltMediumHighBrush}"
Glyph="&#xE0E2;"
MirroredWhenRightToLeft="True"
UseLayoutRounding="False" />
</Border>
</ControlTemplate>
</ResourceDictionary>
</Grid.Resources>
<ScrollViewer x:Name="ScrollViewer"
Margin="{TemplateBinding Padding}"
VerticalContentAlignment="Stretch"
BringIntoViewOnFocusChange="False"
HorizontalScrollBarVisibility="Hidden"
HorizontalSnapPointsAlignment="Center"
HorizontalSnapPointsType="MandatorySingle"
Template="{StaticResource ScrollViewerScrollBarlessTemplate}"
VerticalScrollBarVisibility="Disabled"
VerticalScrollMode="Disabled"
VerticalSnapPointsType="None"
ZoomMode="Disabled">
<PivotPanel x:Name="Panel"
VerticalAlignment="Stretch">
<Grid x:Name="PivotLayoutElement" >
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<!-- By setting the column definitions to *,Auto,* allows the tabs to be centered by default -->
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RenderTransform>
<CompositeTransform x:Name="PivotLayoutElementTranslateTransform" />
</Grid.RenderTransform>
<!-- This border is used as a backplate for the header area -->
<Border
Grid.ColumnSpan="3"
Background="{ThemeResource SystemControlPageBackgroundChromeMediumBrush}"
BorderBrush="{ThemeResource SystemControlForegroundChromeMediumBrush}"
BorderThickness="0,0,0,1" />
<ContentPresenter x:Name="LeftHeaderPresenter"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Content="{TemplateBinding LeftHeader}"
ContentTemplate="{TemplateBinding LeftHeaderTemplate}" />
<ContentControl x:Name="HeaderClipper"
Grid.Column="1"
HorizontalContentAlignment="Stretch"
UseSystemFocusVisuals="True">
<ContentControl.Clip>
<RectangleGeometry x:Name="HeaderClipperGeometry" />
</ContentControl.Clip>
<Grid Background="Transparent">
<PivotHeaderPanel x:Name="StaticHeader" Visibility="Collapsed" />
<PivotHeaderPanel x:Name="Header">
<PivotHeaderPanel.RenderTransform>
<TransformGroup>
<CompositeTransform x:Name="HeaderTranslateTransform" />
<CompositeTransform x:Name="HeaderOffsetTranslateTransform" />
</TransformGroup>
</PivotHeaderPanel.RenderTransform>
</PivotHeaderPanel>
</Grid>
</ContentControl>
<Button x:Name="PreviousButton"
Grid.Column="1"
Width="20"
Height="36"
Margin="{ThemeResource PivotNavButtonMargin}"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Background="Transparent"
IsEnabled="False"
IsTabStop="False"
Opacity="0"
Template="{StaticResource PreviousTemplate}"
UseSystemFocusVisuals="False" />
<Button x:Name="NextButton"
Grid.Column="1"
Width="20"
Height="36"
Margin="{ThemeResource PivotNavButtonMargin}"
HorizontalAlignment="Right"
VerticalAlignment="Top"
Background="Transparent"
IsEnabled="False"
IsTabStop="False"
Opacity="0"
Template="{StaticResource NextTemplate}"
UseSystemFocusVisuals="False" />
<ContentPresenter x:Name="RightHeaderPresenter"
Grid.Column="2"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Content="{TemplateBinding RightHeader}"
ContentTemplate="{TemplateBinding RightHeaderTemplate}" />
<ItemsPresenter x:Name="PivotItemPresenter" Grid.Row="1" Grid.ColumnSpan="3">
<ItemsPresenter.RenderTransform>
<TransformGroup>
<TranslateTransform x:Name="ItemsPresenterTranslateTransform" />
<CompositeTransform x:Name="ItemsPresenterCompositeTransform" />
</TransformGroup>
</ItemsPresenter.RenderTransform>
</ItemsPresenter>
</Grid>
</PivotPanel>
</ScrollViewer>
</Grid>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
</Application.Resources>
</Application>

BIN
src/Mobile/eShopOnContainers/eShopOnContainers.Windows/Assets/app_settings.png View File

Before After
Width: 409  |  Height: 409  |  Size: 7.5 KiB

BIN
src/Mobile/eShopOnContainers/eShopOnContainers.Windows/Assets/toggle_azure.png View File

Before After
Width: 409  |  Height: 409  |  Size: 4.7 KiB

BIN
src/Mobile/eShopOnContainers/eShopOnContainers.Windows/Assets/toggle_local.png View File

Before After
Width: 409  |  Height: 409  |  Size: 3.4 KiB

+ 65
- 0
src/Mobile/eShopOnContainers/eShopOnContainers.Windows/Controls/TabItem.xaml View File

@ -0,0 +1,65 @@
<UserControl
x:Class="eShopOnContainers.Windows.Controls.TabItem"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:eShopOnContainers.Windows.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
d:DesignHeight="300"
d:DesignWidth="400">
<UserControl.Resources>
<ResourceDictionary>
<Style x:Key="TabIconStyle" TargetType="Image">
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="Margin" Value="0,12,0,0" />
</Style>
<Style x:Key="TabTextStyle" TargetType="TextBlock">
<Setter Property="FontFamily" Value="Segoe UI" />
<Setter Property="LineStackingStrategy" Value="BlockLineHeight" />
<Setter Property="LineHeight" Value="14" />
<Setter Property="MaxLines" Value="2" />
<Setter Property="TextAlignment" Value="Center" />
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="Margin" Value="2,5,2,7" />
</Style>
<Style x:Key="TabBadgeStyle" TargetType="Grid">
<Setter Property="Height" Value="24" />
<Setter Property="Width" Value="24" />
<Setter Property="CornerRadius" Value="24" />
<Setter Property="HorizontalAlignment" Value="Right" />
<Setter Property="VerticalAlignment" Value="Top" />
</Style>
<Style x:Key="BadgeTextStyle" TargetType="TextBlock">
<Setter Property="FontSize" Value="10" />
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="VerticalAlignment" Value="Center" />
</Style>
</ResourceDictionary>
</UserControl.Resources>
<Grid>
<StackPanel>
<!-- TAB ICON -->
<Image
Source="{Binding Icon}"
Style="{StaticResource TabIconStyle}"/>
<!-- TAB TEXT -->
<TextBlock
Text="{Binding Label}"
Style="{StaticResource TabTextStyle}" />
</StackPanel>
<!-- TAB BADGE -->
<Grid
Background="{Binding BadgeColor}"
Style="{StaticResource TabBadgeStyle}">
<TextBlock
Text="{Binding BadgeText}"
Style="{StaticResource BadgeTextStyle}"/>
</Grid>
</Grid>
</UserControl>

+ 51
- 0
src/Mobile/eShopOnContainers/eShopOnContainers.Windows/Controls/TabItem.xaml.cs View File

@ -0,0 +1,51 @@
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
namespace eShopOnContainers.Windows.Controls
{
public sealed partial class TabItem : UserControl
{
public static readonly DependencyProperty IconProperty =
DependencyProperty.Register("Icon", typeof(string), typeof(TabItem), null);
public string Icon
{
get { return GetValue(IconProperty) as string; }
set { SetValue(IconProperty, value); }
}
public static readonly DependencyProperty LabelProperty =
DependencyProperty.Register("Label", typeof(string), typeof(TabItem), null);
public string BadgeText
{
get { return GetValue(BadgeTextProperty) as string; }
set { SetValue(BadgeTextProperty, value); }
}
public static readonly DependencyProperty BadgeTextProperty =
DependencyProperty.Register("BadgeText", typeof(string), typeof(TabItem), null);
public string BadgeColor
{
get { return GetValue(BadgeColorProperty) as string; }
set { SetValue(BadgeColorProperty, value); }
}
public static readonly DependencyProperty BadgeColorProperty =
DependencyProperty.Register("BadgeColor", typeof(string), typeof(TabItem), null);
public string Label
{
get { return GetValue(LabelProperty) as string; }
set { SetValue(LabelProperty, value); }
}
public TabItem()
{
this.InitializeComponent();
this.DataContext = this;
}
}
}

+ 0
- 60
src/Mobile/eShopOnContainers/eShopOnContainers.Windows/Renderers/CustomSwitchRenderer.cs View File

@ -1,60 +0,0 @@
using eShopOnContainers.Core.Controls;
using eShopOnContainers.Windows.Renderers;
using Windows.UI.Xaml.Controls;
using Xamarin.Forms;
using Xamarin.Forms.Platform.UWP;
[assembly: ExportRenderer(typeof(CustomSwitch), typeof(CustomSwitchRenderer))]
namespace eShopOnContainers.Windows.Renderers
{
public class CustomSwitchRenderer : ViewRenderer<CustomSwitch, ToggleSwitch>
{
protected override void OnElementChanged(ElementChangedEventArgs<CustomSwitch> e)
{
base.OnElementChanged(e);
if (this.Element == null)
{
return;
}
if (e.OldElement != null)
{
this.Element.Toggled -= ElementToggled;
return;
}
var toggleSwitchControl = new ToggleSwitch
{
OnContent = this.Element.TextOn,
OffContent = this.Element.TextOff
};
toggleSwitchControl.Toggled += ControlToggled;
this.Element.Toggled += ElementToggled;
this.SetNativeControl(toggleSwitchControl);
}
protected override void Dispose(bool disposing)
{
if (disposing)
{
this.Control.Toggled -= this.ControlToggled;
this.Element.Toggled -= ElementToggled;
}
base.Dispose(disposing);
}
private void ElementToggled(object sender, ToggledEventArgs e)
{
this.Control.IsOn = this.Element.IsToggled;
}
private void ControlToggled(object sender, global::Windows.UI.Xaml.RoutedEventArgs e)
{
this.Element.IsToggled = this.Control.IsOn;
}
}
}

+ 21
- 0
src/Mobile/eShopOnContainers/eShopOnContainers.Windows/Renderers/CustomTabbedPageRenderer.cs View File

@ -1,4 +1,5 @@
using eShopOnContainers.Windows.Renderers;
using System.Diagnostics;
using Xamarin.Forms;
using Xamarin.Forms.Internals;
using Xamarin.Forms.Platform.UWP;
@ -9,5 +10,25 @@ namespace eShopOnContainers.Windows.Renderers
[Preserve]
public class CustomTabbedPageRenderer : TabbedPageRenderer
{
protected override void OnElementChanged(VisualElementChangedEventArgs e)
{
base.OnElementChanged(e);
if (Control == null)
{
Debug.WriteLine("No TabLayout found. Badge not added.");
return;
}
for (var i = 0; i < Control.Items.Count; i++)
{
AddTabBadge(i);
}
}
private void AddTabBadge(int tabIndex)
{
}
}
}

+ 10
- 1
src/Mobile/eShopOnContainers/eShopOnContainers.Windows/eShopOnContainers.Windows.csproj View File

@ -105,12 +105,14 @@
<Compile Include="App.xaml.cs">
<DependentUpon>App.xaml</DependentUpon>
</Compile>
<Compile Include="Controls\TabItem.xaml.cs">
<DependentUpon>TabItem.xaml</DependentUpon>
</Compile>
<Compile Include="Effects\EntryLineColorEffect.cs" />
<Compile Include="MainPage.xaml.cs">
<DependentUpon>MainPage.xaml</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Renderers\CustomSwitchRenderer.cs" />
<Compile Include="Renderers\CustomTabbedPageRenderer.cs" />
<Compile Include="Renderers\SlideDownMenuPageRenderer.cs" />
</ItemGroup>
@ -121,6 +123,7 @@
<None Include="Windows_TemporaryKey.pfx" />
</ItemGroup>
<ItemGroup>
<Content Include="Assets\app_settings.png" />
<Content Include="Assets\circle_button_background.png" />
<Content Include="Assets\fake_product_01.png" />
<Content Include="Assets\fake_product_02.png" />
@ -131,6 +134,8 @@
<Content Include="Assets\menu_filter.png" />
<Content Include="Assets\menu_profile.png" />
<Content Include="Assets\product_add.png" />
<Content Include="Assets\toggle_azure.png" />
<Content Include="Assets\toggle_local.png" />
<Content Include="Properties\Default.rd.xml" />
<Content Include="Assets\LockScreenLogo.scale-200.png" />
<Content Include="Assets\SplashScreen.scale-200.png" />
@ -145,6 +150,10 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
<Page Include="Controls\TabItem.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="MainPage.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>


+ 0
- 56
src/Mobile/eShopOnContainers/eShopOnContainers.iOS/Renderers/CustomSwitchRenderer.cs View File

@ -1,56 +0,0 @@
using eShopOnContainers.Core.Controls;
using eShopOnContainers.iOS.Renderers;
using UIKit;
using Xamarin.Forms;
using Xamarin.Forms.Platform.iOS;
[assembly: ExportRenderer(typeof(CustomSwitch), typeof(CustomSwitchRenderer))]
namespace eShopOnContainers.iOS.Renderers
{
public class CustomSwitchRenderer : ViewRenderer<CustomSwitch, UISwitch>
{
protected override void OnElementChanged(ElementChangedEventArgs<CustomSwitch> e)
{
base.OnElementChanged(e);
if (e.OldElement != null)
{
this.Element.Toggled -= ElementToggled;
return;
}
if (this.Element == null)
{
return;
}
var uiSwitchControl = new UISwitch();
uiSwitchControl.ValueChanged += ControlValueChanged;
this.Element.Toggled += ElementToggled;
this.SetNativeControl(uiSwitchControl);
}
protected override void Dispose(bool disposing)
{
if (disposing)
{
this.Control.ValueChanged -= this.ControlValueChanged;
this.Element.Toggled -= ElementToggled;
}
base.Dispose(disposing);
}
private void ElementToggled(object sender, ToggledEventArgs e)
{
this.Control.On = Element.IsToggled;
}
private void ControlValueChanged(object sender, System.EventArgs e)
{
this.Element.IsToggled = this.Control.On;
}
}
}

BIN
src/Mobile/eShopOnContainers/eShopOnContainers.iOS/Resources/app_settings.png View File

Before After
Width: 170  |  Height: 170  |  Size: 1.9 KiB

BIN
src/Mobile/eShopOnContainers/eShopOnContainers.iOS/Resources/app_settings@2x.png View File

Before After
Width: 341  |  Height: 341  |  Size: 5.5 KiB

BIN
src/Mobile/eShopOnContainers/eShopOnContainers.iOS/Resources/app_settings@3x.png View File

Before After
Width: 512  |  Height: 512  |  Size: 9.3 KiB

BIN
src/Mobile/eShopOnContainers/eShopOnContainers.iOS/Resources/toggle_azure.png View File

Before After
Width: 170  |  Height: 170  |  Size: 1.2 KiB

BIN
src/Mobile/eShopOnContainers/eShopOnContainers.iOS/Resources/toggle_azure@2x.png View File

Before After
Width: 341  |  Height: 341  |  Size: 3.5 KiB

BIN
src/Mobile/eShopOnContainers/eShopOnContainers.iOS/Resources/toggle_azure@3x.png View File

Before After
Width: 512  |  Height: 512  |  Size: 5.5 KiB

BIN
src/Mobile/eShopOnContainers/eShopOnContainers.iOS/Resources/toggle_local.png View File

Before After
Width: 170  |  Height: 170  |  Size: 1.1 KiB

BIN
src/Mobile/eShopOnContainers/eShopOnContainers.iOS/Resources/toggle_local@2x.png View File

Before After
Width: 341  |  Height: 341  |  Size: 2.6 KiB

BIN
src/Mobile/eShopOnContainers/eShopOnContainers.iOS/Resources/toggle_local@3x.png View File

Before After
Width: 512  |  Height: 512  |  Size: 3.5 KiB

+ 4
- 0
src/Mobile/eShopOnContainers/eShopOnContainers.iOS/app.config View File

@ -6,6 +6,10 @@
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.5.0.0" newVersion="1.5.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

+ 27
- 1
src/Mobile/eShopOnContainers/eShopOnContainers.iOS/eShopOnContainers.iOS.csproj View File

@ -112,7 +112,6 @@
<BundleResource Include="..\CommonResources\Fonts\SourceSansPro-Regular.ttf">
<Link>Resources\fonts\SourceSansPro-Regular.ttf</Link>
</BundleResource>
<Compile Include="Renderers\CustomSwitchRenderer.cs" />
<Compile Include="Renderers\CustomTabbedPageRenderer.cs" />
<Compile Include="Renderers\SlideDownMenuPageRenderer.cs" />
<None Include="app.config" />
@ -296,6 +295,33 @@
<ItemGroup>
<BundleResource Include="Resources\product_add%403x.png" />
</ItemGroup>
<ItemGroup>
<BundleResource Include="Resources\toggle_local.png" />
</ItemGroup>
<ItemGroup>
<BundleResource Include="Resources\toggle_local%402x.png" />
</ItemGroup>
<ItemGroup>
<BundleResource Include="Resources\toggle_local%403x.png" />
</ItemGroup>
<ItemGroup>
<BundleResource Include="Resources\app_settings%403x.png" />
</ItemGroup>
<ItemGroup>
<BundleResource Include="Resources\app_settings.png" />
</ItemGroup>
<ItemGroup>
<BundleResource Include="Resources\app_settings%402x.png" />
</ItemGroup>
<ItemGroup>
<BundleResource Include="Resources\toggle_azure%402x.png" />
</ItemGroup>
<ItemGroup>
<BundleResource Include="Resources\toggle_azure%403x.png" />
</ItemGroup>
<ItemGroup>
<BundleResource Include="Resources\toggle_azure.png" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>


Loading…
Cancel
Save