Ramón Tomás 7 years ago
parent
commit
7bb14783b1
10 changed files with 47 additions and 20 deletions
  1. +1
    -3
      README.md
  2. BIN
      img/eShopOnContainers_Architecture_Diagram - Old2.png
  3. BIN
      img/eShopOnContainers_Architecture_Diagram.png
  4. +1
    -0
      src/Mobile/eShopOnContainers/eShopOnContainers.Core/App.xaml
  5. +5
    -4
      src/Mobile/eShopOnContainers/eShopOnContainers.Core/App.xaml.cs
  6. +24
    -0
      src/Mobile/eShopOnContainers/eShopOnContainers.Core/Converters/DoubleConverter.cs
  7. +6
    -6
      src/Mobile/eShopOnContainers/eShopOnContainers.Core/Helpers/Settings.cs
  8. +7
    -5
      src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/SettingsViewModel.cs
  9. +2
    -2
      src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/SettingsView.xaml
  10. +1
    -0
      src/Mobile/eShopOnContainers/eShopOnContainers.Core/eShopOnContainers.Core.csproj

+ 1
- 3
README.md View File

@ -14,9 +14,7 @@ However, this sample application should not be considered as an "eCommerce refer
> Read the planned <a href='https://github.com/dotnet/eShopOnContainers/wiki/01.-Roadmap-and-Milestones-for-future-releases'>Roadmap and Milestones for future releases of eShopOnContainers</a> within the Wiki for further info about possible new implementations and provide feedback at the <a href='https://github.com/dotnet/eShopOnContainers/issues'>ISSUES section</a> if you'd like to see any specific scenario implemented or improved. Also, feel free to discuss on any current issue.
**Architecture overview**: This reference application is cross-platform either at the server and client side, thanks to .NET Core services capable of running on Linux or Windows containers depending on your Docker host, and to Xamarin for mobile apps running on Android, iOS or Windows/UWP plus any browser for the client web apps.
The architecture proposes a simplified microservice oriented architecture implementation with multiple autonomous microservices (each one owning its own data/db) and implementing different approaches within each microservice (simple CRUD vs. DDD/CQRS patterns) using Http as the current communication protocol.
<p>
It also supports asynchronous communication for data updates propagation across multiple services based on Integration Events and an Event Bus plus other features defined at the <a href='https://github.com/dotnet/eShopOnContainers/wiki/01.-Roadmap-and-Milestones-for-future-releases'>roadmap</a>.
The architecture proposes a simplified microservice oriented architecture implementation with multiple autonomous microservices (each one owning its own data/db) and implementing different approaches within each microservice (simple CRUD vs. DDD/CQRS patterns) using Http as the communication protocol between the client apps and the microservices and supports asynchronous communication for data updates propagation across multiple services based on Integration Events and an Event Bus (a light message broker, to choose between RabbitMQ or Azure Service Bus, underneath) plus other features defined at the <a href='https://github.com/dotnet/eShopOnContainers/wiki/01.-Roadmap-and-Milestones-for-future-releases'>roadmap</a>.
<p>
<img src="img/eshop_logo.png">
<img src="img/eShopOnContainers_Architecture_Diagram.png">


BIN
img/eShopOnContainers_Architecture_Diagram - Old2.png View File

Before After
Width: 1830  |  Height: 1078  |  Size: 405 KiB

BIN
img/eShopOnContainers_Architecture_Diagram.png View File

Before After
Width: 1830  |  Height: 1078  |  Size: 405 KiB Width: 1830  |  Height: 1125  |  Size: 443 KiB

+ 1
- 0
src/Mobile/eShopOnContainers/eShopOnContainers.Core/App.xaml View File

@ -111,6 +111,7 @@
<converters:WebNavigatingEventArgsConverter x:Key="WebNavigatingEventArgsConverter" />
<converters:WebNavigatedEventArgsConverter x:Key="WebNavigatedEventArgsConverter" />
<converters:StringNullOrEmptyBoolConverter x:Key="StringNullOrEmptyBoolConverter" />
<converters:DoubleConverter x:Key="DoubleConverter" />
<!-- STYLES -->
<Style x:Key="ValidationErrorLabelStyle"


+ 5
- 4
src/Mobile/eShopOnContainers/eShopOnContainers.Core/App.xaml.cs View File

@ -1,4 +1,5 @@
using System;
using System.Globalization;
using eShopOnContainers.Core.Helpers;
using eShopOnContainers.Services;
using eShopOnContainers.Core.ViewModels.Base;
@ -79,8 +80,8 @@ namespace eShopOnContainers
var position = await locator.GetPositionAsync();
Settings.Latitude = position.Latitude;
Settings.Longitude = position.Longitude;
Settings.Latitude = position.Latitude.ToString();
Settings.Longitude = position.Longitude.ToString();
}
else
{
@ -92,8 +93,8 @@ namespace eShopOnContainers
{
var location = new Location
{
Latitude = Settings.Latitude,
Longitude = Settings.Longitude
Latitude = double.Parse(Settings.Latitude, CultureInfo.InvariantCulture),
Longitude = double.Parse(Settings.Longitude, CultureInfo.InvariantCulture)
};
var locationService = ViewModelLocator.Resolve<ILocationService>();


+ 24
- 0
src/Mobile/eShopOnContainers/eShopOnContainers.Core/Converters/DoubleConverter.cs View File

@ -0,0 +1,24 @@
using System;
using System.Globalization;
using Xamarin.Forms;
namespace eShopOnContainers.Core.Converters
{
public class DoubleConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value is double)
return value.ToString();
return value;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
double doub;
if (double.TryParse(value as string, out doub))
return doub;
return value;
}
}
}

+ 6
- 6
src/Mobile/eShopOnContainers/eShopOnContainers.Core/Helpers/Settings.cs View File

@ -69,16 +69,16 @@ namespace eShopOnContainers.Core.Helpers
set => AppSettings.AddOrUpdateValue<bool>(IdUseFakeLocation, value);
}
public static double Latitude
public static string Latitude
{
get => AppSettings.GetValueOrDefault<double>(IdLatitude, FakeLatitudeDefault);
set => AppSettings.AddOrUpdateValue<double>(IdLatitude, value);
get => AppSettings.GetValueOrDefault<string>(IdLatitude, FakeLatitudeDefault.ToString());
set => AppSettings.AddOrUpdateValue<string>(IdLatitude, value);
}
public static double Longitude
public static string Longitude
{
get => AppSettings.GetValueOrDefault<double>(IdLongitude, FakeLongitudeDefault);
set => AppSettings.AddOrUpdateValue<double>(IdLongitude, value);
get => AppSettings.GetValueOrDefault<string>(IdLongitude, FakeLongitudeDefault.ToString());
set => AppSettings.AddOrUpdateValue<string>(IdLongitude, value);
}
public static bool AllowGpsLocation


+ 7
- 5
src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/SettingsViewModel.cs View File

@ -1,4 +1,6 @@
namespace eShopOnContainers.Core.ViewModels
using System.Globalization;
namespace eShopOnContainers.Core.ViewModels
{
using System.Windows.Input;
using Xamarin.Forms;
@ -34,8 +36,8 @@
_useAzureServices = !Settings.UseMocks;
_endpoint = Settings.UrlBase;
_latitude = Settings.Latitude;
_longitude = Settings.Longitude;
_latitude = double.Parse(Settings.Latitude, CultureInfo.CurrentCulture);
_longitude = double.Parse(Settings.Longitude, CultureInfo.CurrentCulture);
_useFakeLocation = Settings.UseFakeLocation;
_allowGpsLocation = Settings.AllowGpsLocation;
_gpsWarningMessage = string.Empty;
@ -325,13 +327,13 @@
private void UpdateLatitude()
{
// Update fake latitude (save to local storage)
Settings.Latitude = _latitude;
Settings.Latitude = _latitude.ToString();
}
private void UpdateLongitude()
{
// Update fake longitude (save to local storage)
Settings.Longitude = _longitude;
Settings.Longitude = _longitude.ToString();
}
private void UpdateAllowGpsLocation()


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

@ -219,7 +219,7 @@
Text="Latitude"
Style="{StaticResource HeaderLabelStyle}"/>
<Entry
Text="{Binding Latitude, Mode=TwoWay}"
Text="{Binding Latitude, Mode=TwoWay, Converter={StaticResource DoubleConverter}}"
Keyboard="Text">
<Entry.Style>
<OnPlatform
@ -233,7 +233,7 @@
Text="Longitude"
Style="{StaticResource HeaderLabelStyle}"/>
<Entry
Text="{Binding Longitude, Mode=TwoWay}"
Text="{Binding Longitude, Mode=TwoWay, Converter={StaticResource DoubleConverter}}"
Keyboard="Text">
<Entry.Style>
<OnPlatform


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

@ -49,6 +49,7 @@
</Compile>
<Compile Include="Controls\CustomTabbedPage.cs" />
<Compile Include="Controls\ToggleButton.cs" />
<Compile Include="Converters\DoubleConverter.cs" />
<Compile Include="Converters\StringNullOrEmptyBoolConverter.cs" />
<Compile Include="Converters\CountToBoolConverter.cs" />
<Compile Include="Converters\DatetimeConverter.cs" />


Loading…
Cancel
Save