Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
Merge pull request #185 from dotnet-architecture/xamarin
Browse files Browse the repository at this point in the history
Minor fixes to Xamarin client.
  • Loading branch information
davidbritch authored May 4, 2017
2 parents f43839f + a5fe9ca commit cee9125
Show file tree
Hide file tree
Showing 11 changed files with 26 additions and 159 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public App()

InitApp();

if (Device.OS == TargetPlatform.Windows)
if (Device.RuntimePlatform == Device.Windows)
{
InitNavigation();
}
Expand All @@ -40,7 +40,7 @@ protected override async void OnStart()
{
base.OnStart();

if (Device.OS != TargetPlatform.Windows)
if (Device.RuntimePlatform != Device.Windows)
{
await InitNavigation();
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ public class BasketMockService : IBasketService
BuyerId = "9245fe4a-d402-451c-b9ed-9c1a04247482",
Items = new List<BasketItem>
{
new BasketItem { Id = "1", PictureUrl = Device.OS != TargetPlatform.Windows ? "fake_product_01.png" : "Assets/fake_product_01.png", ProductId = Common.Common.MockCatalogItemId01, ProductName = ".NET Bot Blue Sweatshirt (M)", Quantity = 1, UnitPrice = 19.50M },
new BasketItem { Id = "2", PictureUrl = Device.OS != TargetPlatform.Windows ? "fake_product_04.png" : "Assets/fake_product_04.png", ProductId = Common.Common.MockCatalogItemId04, ProductName = ".NET Black Cupt", Quantity = 1, UnitPrice = 17.00M }
new BasketItem { Id = "1", PictureUrl = Device.RuntimePlatform != Device.Windows ? "fake_product_01.png" : "Assets/fake_product_01.png", ProductId = Common.Common.MockCatalogItemId01, ProductName = ".NET Bot Blue Sweatshirt (M)", Quantity = 1, UnitPrice = 19.50M },
new BasketItem { Id = "2", PictureUrl = Device.RuntimePlatform != Device.Windows ? "fake_product_04.png" : "Assets/fake_product_04.png", ProductId = Common.Common.MockCatalogItemId04, ProductName = ".NET Black Cupt", Quantity = 1, UnitPrice = 17.00M }
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ public class CatalogMockService : ICatalogService

private ObservableCollection<CatalogItem> MockCatalog = new ObservableCollection<CatalogItem>
{
new CatalogItem { Id = Common.Common.MockCatalogItemId01, PictureUri = Device.OS != TargetPlatform.Windows ? "fake_product_01.png" : "Assets/fake_product_01.png", Name = ".NET Bot Blue Sweatshirt (M)", Price = 19.50M, CatalogBrandId = 2, CatalogBrand = "Visual Studio", CatalogTypeId = 2, CatalogType = "T-Shirt" },
new CatalogItem { Id = Common.Common.MockCatalogItemId02, PictureUri = Device.OS != TargetPlatform.Windows ? "fake_product_02.png" : "Assets/fake_product_02.png", Name = ".NET Bot Purple Sweatshirt (M)", Price = 19.50M, CatalogBrandId = 2, CatalogBrand = "Visual Studio", CatalogTypeId = 2, CatalogType = "T-Shirt" },
new CatalogItem { Id = Common.Common.MockCatalogItemId03, PictureUri = Device.OS != TargetPlatform.Windows ? "fake_product_03.png" : "Assets/fake_product_03.png", Name = ".NET Bot Black Sweatshirt (M)", Price = 19.95M, CatalogBrandId = 2, CatalogBrand = "Visual Studio", CatalogTypeId = 2, CatalogType = "T-Shirt" },
new CatalogItem { Id = Common.Common.MockCatalogItemId04, PictureUri = Device.OS != TargetPlatform.Windows ? "fake_product_04.png" : "Assets/fake_product_04.png", Name = ".NET Black Cupt", Price = 17.00M, CatalogBrandId = 2, CatalogBrand = "Visual Studio", CatalogTypeId = 1, CatalogType = "Mug" },
new CatalogItem { Id = Common.Common.MockCatalogItemId05, PictureUri = Device.OS != TargetPlatform.Windows ? "fake_product_05.png" : "Assets/fake_product_05.png", Name = "Azure Black Sweatshirt (M)", Price = 19.50M, CatalogBrandId = 1, CatalogBrand = "Azure", CatalogTypeId = 2, CatalogType = "T-Shirt" }
new CatalogItem { Id = Common.Common.MockCatalogItemId01, PictureUri = Device.RuntimePlatform != Device.Windows ? "fake_product_01.png" : "Assets/fake_product_01.png", Name = ".NET Bot Blue Sweatshirt (M)", Price = 19.50M, CatalogBrandId = 2, CatalogBrand = "Visual Studio", CatalogTypeId = 2, CatalogType = "T-Shirt" },
new CatalogItem { Id = Common.Common.MockCatalogItemId02, PictureUri = Device.RuntimePlatform != Device.Windows ? "fake_product_02.png" : "Assets/fake_product_02.png", Name = ".NET Bot Purple Sweatshirt (M)", Price = 19.50M, CatalogBrandId = 2, CatalogBrand = "Visual Studio", CatalogTypeId = 2, CatalogType = "T-Shirt" },
new CatalogItem { Id = Common.Common.MockCatalogItemId03, PictureUri = Device.RuntimePlatform != Device.Windows ? "fake_product_03.png" : "Assets/fake_product_03.png", Name = ".NET Bot Black Sweatshirt (M)", Price = 19.95M, CatalogBrandId = 2, CatalogBrand = "Visual Studio", CatalogTypeId = 2, CatalogType = "T-Shirt" },
new CatalogItem { Id = Common.Common.MockCatalogItemId04, PictureUri = Device.RuntimePlatform != Device.Windows ? "fake_product_04.png" : "Assets/fake_product_04.png", Name = ".NET Black Cupt", Price = 17.00M, CatalogBrandId = 2, CatalogBrand = "Visual Studio", CatalogTypeId = 1, CatalogType = "Mug" },
new CatalogItem { Id = Common.Common.MockCatalogItemId05, PictureUri = Device.RuntimePlatform != Device.Windows ? "fake_product_05.png" : "Assets/fake_product_05.png", Name = "Azure Black Sweatshirt (M)", Price = 19.50M, CatalogBrandId = 1, CatalogBrand = "Azure", CatalogTypeId = 2, CatalogType = "T-Shirt" }
};

public async Task<ObservableCollection<CatalogItem>> GetCatalogAsync()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ public class OrderMockService : IOrderService

private static List<OrderItem> MockOrderItems = new List<OrderItem>()
{
new OrderItem { OrderId = Guid.NewGuid(), ProductId = Common.Common.MockCatalogItemId01, Discount = 15, ProductName = ".NET Bot Blue Sweatshirt (M)", Quantity = 1, UnitPrice = 16.50M, PictureUrl = Device.OS != TargetPlatform.Windows ? "fake_product_01.png" : "Assets/fake_product_01.png" },
new OrderItem { OrderId = Guid.NewGuid(), ProductId = Common.Common.MockCatalogItemId03, Discount = 0, ProductName = ".NET Bot Black Sweatshirt (M)", Quantity = 2, UnitPrice = 19.95M, PictureUrl = Device.OS != TargetPlatform.Windows ? "fake_product_03.png" : "Assets/fake_product_03.png" }
new OrderItem { OrderId = Guid.NewGuid(), ProductId = Common.Common.MockCatalogItemId01, Discount = 15, ProductName = ".NET Bot Blue Sweatshirt (M)", Quantity = 1, UnitPrice = 16.50M, PictureUrl = Device.RuntimePlatform != Device.Windows ? "fake_product_01.png" : "Assets/fake_product_01.png" },
new OrderItem { OrderId = Guid.NewGuid(), ProductId = Common.Common.MockCatalogItemId03, Discount = 0, ProductName = ".NET Bot Black Sweatshirt (M)", Quantity = 2, UnitPrice = 19.95M, PictureUrl = Device.RuntimePlatform != Device.Windows ? "fake_product_03.png" : "Assets/fake_product_03.png" }
};

private static List<CardType> MockCardTypes = new List<CardType>()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ private void AddCatalogItem(CatalogItem catalogItem)

private async Task FilterAsync()
{
if (Brand == null && Type == null)
if (Brand == null || Type == null)
{
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@
</Grid.RowDefinitions>
<!-- FILTERS -->
<Grid
BackgroundColor="{StaticResource LightGreenColor}"
IsEnabled="{Binding Products.Count, Converter={StaticResource CountToBoolConverter}}">
BackgroundColor="{StaticResource LightGreenColor}">
<Label
Text="FILTER"
Style="{StaticResource FilterLabelStyle}"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<slideOverKit:SlideMenuView
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:slideOverKit="clr-namespace:SlideOverKit"
xmlns:controls="clr-namespace:eShopOnContainers.Core.Controls;assembly=eShopOnContainers.Core"
xmlns:slideOverKit="clr-namespace:SlideOverKit"
x:Class="eShopOnContainers.Core.Views.FiltersView"
MenuOrientations="TopToBottom"
BackgroundColor="{StaticResource BackgroundColor}"
Expand All @@ -13,7 +12,7 @@
<ResourceDictionary>

<Style x:Key="FilterPickerStyle"
TargetType="{x:Type controls:BindablePicker}">
TargetType="{x:Type Picker}">
<Setter Property="HeightRequest"
Value="48" />
<Setter Property="BackgroundColor"
Expand Down Expand Up @@ -70,35 +69,35 @@
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<!-- BRAND -->
<controls:BindablePicker
<Picker
Grid.Row="0"
Title="BRAND"
ItemsSource="{Binding Brands}"
SelectedItem="{Binding Brand, Mode=TwoWay}"
Style="{StaticResource FilterPickerStyle}">
<controls:BindablePicker.HeightRequest>
<Picker.HeightRequest>
<OnPlatform
x:TypeArguments="x:Double"
Android="48"
iOS="48"
WinPhone="36"/>
</controls:BindablePicker.HeightRequest>
</controls:BindablePicker>
</Picker.HeightRequest>
</Picker>
<!-- TYPE -->
<controls:BindablePicker
<Picker
Grid.Row="1"
Title="TYPE"
ItemsSource="{Binding Types}"
SelectedItem="{Binding Type, Mode=TwoWay}"
Style="{StaticResource FilterPickerStyle}">
<controls:BindablePicker.HeightRequest>
<Picker.HeightRequest>
<OnPlatform
x:TypeArguments="x:Double"
Android="48"
iOS="48"
WinPhone="36"/>
</controls:BindablePicker.HeightRequest>
</controls:BindablePicker>
</Picker.HeightRequest>
</Picker>
<Button
Grid.Row="2"
Text="Apply"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ protected override void OnDisappearing()

public async Task AnimateIn()
{
if (Device.OS == TargetPlatform.Windows)
if (Device.RuntimePlatform == Device.Windows)
{
return;
}
Expand Down
1 change: 0 additions & 1 deletion src/Mobile/eShopOnContainers/eShopOnContainers.Core/eShopOnContainers.Core.csproj
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
<Compile Include="Controls\AddBasketButton.xaml.cs">
<DependentUpon>AddBasketButton.xaml</DependentUpon>
</Compile>
<Compile Include="Controls\BindablePicker.cs" />
<Compile Include="Controls\CustomTabbedPage.cs" />
<Compile Include="Controls\ToggleButton.cs" />
<Compile Include="Converters\CountToBoolConverter.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<MtouchArch>i386, x86_64</MtouchArch>
<MtouchLink>SdkOnly</MtouchLink>
<MtouchDebug>True</MtouchDebug>
<MtouchSdkVersion>10.1</MtouchSdkVersion>
<MtouchSdkVersion>10.2</MtouchSdkVersion>
<MtouchProfiling>False</MtouchProfiling>
<MtouchFastDev>False</MtouchFastDev>
<MtouchUseLlvm>False</MtouchUseLlvm>
Expand Down

0 comments on commit cee9125

Please sign in to comment.