Added iOS resources and renderers.
Created Settings view.
@ -112,9 +112,9 @@
|
|||||||
<Setter Property="FontFamily"
|
<Setter Property="FontFamily"
|
||||||
Value="{StaticResource MontserratRegular}" />
|
Value="{StaticResource MontserratRegular}" />
|
||||||
<Setter Property="TextColor"
|
<Setter Property="TextColor"
|
||||||
Value="{StaticResource WhiteColor}" />
|
Value="{StaticResource BlackColor}" />
|
||||||
<Setter Property="PlaceholderColor"
|
<Setter Property="PlaceholderColor"
|
||||||
Value="{StaticResource WhiteColor}" />
|
Value="{StaticResource BlackColor}" />
|
||||||
<Setter Property="FontSize"
|
<Setter Property="FontSize"
|
||||||
Value="{StaticResource LargeSize}" />
|
Value="{StaticResource LargeSize}" />
|
||||||
<Setter Property="HorizontalOptions"
|
<Setter Property="HorizontalOptions"
|
||||||
|
@ -0,0 +1,25 @@
|
|||||||
|
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); }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -154,6 +154,7 @@ namespace eShopOnContainers.Services
|
|||||||
_mappings.Add(typeof(MainViewModel), typeof(MainView));
|
_mappings.Add(typeof(MainViewModel), typeof(MainView));
|
||||||
_mappings.Add(typeof(OrderDetailViewModel), typeof(OrderDetailView));
|
_mappings.Add(typeof(OrderDetailViewModel), typeof(OrderDetailView));
|
||||||
_mappings.Add(typeof(ProfileViewModel), typeof(ProfileView));
|
_mappings.Add(typeof(ProfileViewModel), typeof(ProfileView));
|
||||||
|
_mappings.Add(typeof(SettingsViewModel), typeof(SettingsView));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -41,6 +41,7 @@ namespace eShopOnContainers.ViewModels.Base
|
|||||||
_unityContainer.RegisterType<MainViewModel>();
|
_unityContainer.RegisterType<MainViewModel>();
|
||||||
_unityContainer.RegisterType<OrderDetailViewModel>();
|
_unityContainer.RegisterType<OrderDetailViewModel>();
|
||||||
_unityContainer.RegisterType<ProfileViewModel>();
|
_unityContainer.RegisterType<ProfileViewModel>();
|
||||||
|
_unityContainer.RegisterType<SettingsViewModel>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public T Resolve<T>()
|
public T Resolve<T>()
|
||||||
|
@ -3,11 +3,14 @@ using eShopOnContainers.ViewModels.Base;
|
|||||||
using eShopOnContainers.Core.Models.Navigation;
|
using eShopOnContainers.Core.Models.Navigation;
|
||||||
using Xamarin.Forms;
|
using Xamarin.Forms;
|
||||||
using eShopOnContainers.Core.ViewModels.Base;
|
using eShopOnContainers.Core.ViewModels.Base;
|
||||||
|
using System.Windows.Input;
|
||||||
|
|
||||||
namespace eShopOnContainers.Core.ViewModels
|
namespace eShopOnContainers.Core.ViewModels
|
||||||
{
|
{
|
||||||
public class MainViewModel : ViewModelBase
|
public class MainViewModel : ViewModelBase
|
||||||
{
|
{
|
||||||
|
public ICommand SettingsCommand => new Command(Settings);
|
||||||
|
|
||||||
public override Task InitializeAsync(object navigationData)
|
public override Task InitializeAsync(object navigationData)
|
||||||
{
|
{
|
||||||
IsBusy = true;
|
IsBusy = true;
|
||||||
@ -20,5 +23,10 @@ namespace eShopOnContainers.Core.ViewModels
|
|||||||
|
|
||||||
return base.InitializeAsync(navigationData);
|
return base.InitializeAsync(navigationData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void Settings()
|
||||||
|
{
|
||||||
|
NavigationService.NavigateToAsync<SettingsViewModel>();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -0,0 +1,9 @@
|
|||||||
|
using eShopOnContainers.ViewModels.Base;
|
||||||
|
|
||||||
|
namespace eShopOnContainers.Core.ViewModels
|
||||||
|
{
|
||||||
|
public class SettingsViewModel : ViewModelBase
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -22,6 +22,8 @@
|
|||||||
Value="Fill" />
|
Value="Fill" />
|
||||||
<Setter Property="VerticalOptions"
|
<Setter Property="VerticalOptions"
|
||||||
Value="Fill" />
|
Value="Fill" />
|
||||||
|
<Setter Property="Margin"
|
||||||
|
Value="0, 2" />
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
<Style x:Key="FilterButtonStyle"
|
<Style x:Key="FilterButtonStyle"
|
||||||
|
@ -8,6 +8,19 @@
|
|||||||
BackgroundColor="{StaticResource BackgroundColor}"
|
BackgroundColor="{StaticResource BackgroundColor}"
|
||||||
BarTextColor="{StaticResource WhiteColor}"
|
BarTextColor="{StaticResource WhiteColor}"
|
||||||
Title="eShop on Containers">
|
Title="eShop on Containers">
|
||||||
|
<ContentPage.ToolbarItems>
|
||||||
|
<ToolbarItem
|
||||||
|
Command="{Binding SettingsCommand}"
|
||||||
|
Text="Settings">
|
||||||
|
<ToolbarItem.Icon>
|
||||||
|
<OnPlatform
|
||||||
|
x:TypeArguments="FileImageSource"
|
||||||
|
WinPhone=""
|
||||||
|
Android=""
|
||||||
|
iOS=""/>
|
||||||
|
</ToolbarItem.Icon>
|
||||||
|
</ToolbarItem>
|
||||||
|
</ContentPage.ToolbarItems>
|
||||||
<views:CatalogView
|
<views:CatalogView
|
||||||
x:Name="HomeView">
|
x:Name="HomeView">
|
||||||
<views:CatalogView.Icon>
|
<views:CatalogView.Icon>
|
||||||
|
@ -0,0 +1,86 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||||
|
x:Class="eShopOnContainers.Core.Views.SettingsView"
|
||||||
|
xmlns:controls="clr-namespace:eShopOnContainers.Core.Controls;assembly=eShopOnContainers.Core"
|
||||||
|
Title="Settings">
|
||||||
|
<ContentPage.Resources>
|
||||||
|
<ResourceDictionary>
|
||||||
|
|
||||||
|
<Style x:Key="SettingsTitleStyle"
|
||||||
|
TargetType="{x:Type Label}">
|
||||||
|
<Setter Property="FontFamily"
|
||||||
|
Value="{StaticResource MontserratRegular}" />
|
||||||
|
<Setter Property="FontSize"
|
||||||
|
Value="{StaticResource MediumSize}" />
|
||||||
|
<Setter Property="HorizontalOptions"
|
||||||
|
Value="Start" />
|
||||||
|
<Setter Property="VerticalOptions"
|
||||||
|
Value="Center" />
|
||||||
|
<Setter Property="Margin"
|
||||||
|
Value="12, 0" />
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<Style x:Key="SettingsDescriptionStyle"
|
||||||
|
TargetType="{x:Type Label}"
|
||||||
|
BasedOn="{StaticResource SettingsTitleStyle}">
|
||||||
|
<Setter Property="FontSize"
|
||||||
|
Value="{StaticResource LittleSize}" />
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<Style x:Key="SettingsSwitchStyle"
|
||||||
|
TargetType="{x:Type controls:CustomSwitch}">
|
||||||
|
<Setter Property="VerticalOptions"
|
||||||
|
Value="Center" />
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
</ResourceDictionary>
|
||||||
|
</ContentPage.Resources>
|
||||||
|
<Grid
|
||||||
|
BackgroundColor="{StaticResource BackgroundColor}">
|
||||||
|
<!-- SETTINGS -->
|
||||||
|
<ScrollView>
|
||||||
|
<StackLayout>
|
||||||
|
<!-- MOCK SERVICES -->
|
||||||
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="1" />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="1" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<Grid
|
||||||
|
Grid.Row="0"
|
||||||
|
Grid.Column="0"
|
||||||
|
Grid.ColumnSpan="2"
|
||||||
|
BackgroundColor="Gray"/>
|
||||||
|
<StackLayout
|
||||||
|
Grid.Column="0"
|
||||||
|
Grid.Row="1">
|
||||||
|
<Label
|
||||||
|
Text="Use Mock Services"
|
||||||
|
TextColor="{StaticResource GreenColor}"
|
||||||
|
Style="{StaticResource SettingsTitleStyle}"/>
|
||||||
|
<Label
|
||||||
|
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"
|
||||||
|
Grid.Column="1"
|
||||||
|
Grid.Row="1"
|
||||||
|
Style="{StaticResource SettingsSwitchStyle}"/>
|
||||||
|
<Grid
|
||||||
|
Grid.Row="2"
|
||||||
|
Grid.Column="0"
|
||||||
|
Grid.ColumnSpan="2"
|
||||||
|
BackgroundColor="Gray"/>
|
||||||
|
</Grid>
|
||||||
|
</StackLayout>
|
||||||
|
</ScrollView>
|
||||||
|
</Grid>
|
||||||
|
</ContentPage>
|
@ -0,0 +1,18 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
using Xamarin.Forms;
|
||||||
|
|
||||||
|
namespace eShopOnContainers.Core.Views
|
||||||
|
{
|
||||||
|
public partial class SettingsView : ContentPage
|
||||||
|
{
|
||||||
|
public SettingsView()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -48,6 +48,7 @@
|
|||||||
<Compile Include="Controls\CartButton.xaml.cs">
|
<Compile Include="Controls\CartButton.xaml.cs">
|
||||||
<DependentUpon>CartButton.xaml</DependentUpon>
|
<DependentUpon>CartButton.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="Controls\CustomSwitch.cs" />
|
||||||
<Compile Include="Controls\CustomTabbedPage.cs" />
|
<Compile Include="Controls\CustomTabbedPage.cs" />
|
||||||
<Compile Include="Converters\CountToBoolConverter.cs" />
|
<Compile Include="Converters\CountToBoolConverter.cs" />
|
||||||
<Compile Include="Converters\DatetimeConverter.cs" />
|
<Compile Include="Converters\DatetimeConverter.cs" />
|
||||||
@ -99,6 +100,7 @@
|
|||||||
<Compile Include="ViewModels\MainViewModel.cs" />
|
<Compile Include="ViewModels\MainViewModel.cs" />
|
||||||
<Compile Include="ViewModels\OrderDetailViewModel.cs" />
|
<Compile Include="ViewModels\OrderDetailViewModel.cs" />
|
||||||
<Compile Include="ViewModels\ProfileViewModel.cs" />
|
<Compile Include="ViewModels\ProfileViewModel.cs" />
|
||||||
|
<Compile Include="ViewModels\SettingsViewModel.cs" />
|
||||||
<Compile Include="Views\CartView.xaml.cs">
|
<Compile Include="Views\CartView.xaml.cs">
|
||||||
<DependentUpon>CartView.xaml</DependentUpon>
|
<DependentUpon>CartView.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
@ -126,6 +128,9 @@
|
|||||||
<Compile Include="Views\ProfileView.xaml.cs">
|
<Compile Include="Views\ProfileView.xaml.cs">
|
||||||
<DependentUpon>ProfileView.xaml</DependentUpon>
|
<DependentUpon>ProfileView.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="Views\SettingsView.xaml.cs">
|
||||||
|
<DependentUpon>SettingsView.xaml</DependentUpon>
|
||||||
|
</Compile>
|
||||||
<Compile Include="Views\Templates\CartOrderItemTemplate.xaml.cs">
|
<Compile Include="Views\Templates\CartOrderItemTemplate.xaml.cs">
|
||||||
<DependentUpon>CartOrderItemTemplate.xaml</DependentUpon>
|
<DependentUpon>CartOrderItemTemplate.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
@ -303,6 +308,12 @@
|
|||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<EmbeddedResource Include="Views\SettingsView.xaml">
|
||||||
|
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</EmbeddedResource>
|
||||||
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
|
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
|
||||||
<Import Project="..\..\packages\Xamarin.Forms.2.3.2.127\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets" Condition="Exists('..\..\packages\Xamarin.Forms.2.3.2.127\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets')" />
|
<Import Project="..\..\packages\Xamarin.Forms.2.3.2.127\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets" Condition="Exists('..\..\packages\Xamarin.Forms.2.3.2.127\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets')" />
|
||||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||||
|
@ -0,0 +1,58 @@
|
|||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -203,6 +203,7 @@
|
|||||||
<Compile Include="Effects\EntryLineColorEffect.cs" />
|
<Compile Include="Effects\EntryLineColorEffect.cs" />
|
||||||
<Compile Include="Extensions\ViewExtensions.cs" />
|
<Compile Include="Extensions\ViewExtensions.cs" />
|
||||||
<Compile Include="Renderers\BadgeView.cs" />
|
<Compile Include="Renderers\BadgeView.cs" />
|
||||||
|
<Compile Include="Renderers\CustomSwitchRenderer.cs" />
|
||||||
<Compile Include="Renderers\CustomTabbedPageRenderer.cs" />
|
<Compile Include="Renderers\CustomTabbedPageRenderer.cs" />
|
||||||
<Compile Include="Renderers\SlideDownMenuPageRenderer.cs" />
|
<Compile Include="Renderers\SlideDownMenuPageRenderer.cs" />
|
||||||
<Compile Include="Resources\Resource.Designer.cs" />
|
<Compile Include="Resources\Resource.Designer.cs" />
|
||||||
|
@ -0,0 +1,60 @@
|
|||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -110,6 +110,7 @@
|
|||||||
<DependentUpon>MainPage.xaml</DependentUpon>
|
<DependentUpon>MainPage.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
|
<Compile Include="Renderers\CustomSwitchRenderer.cs" />
|
||||||
<Compile Include="Renderers\CustomTabbedPageRenderer.cs" />
|
<Compile Include="Renderers\CustomTabbedPageRenderer.cs" />
|
||||||
<Compile Include="Renderers\SlideDownMenuPageRenderer.cs" />
|
<Compile Include="Renderers\SlideDownMenuPageRenderer.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
@ -9,6 +9,7 @@ using UIKit;
|
|||||||
using Xamarin.Forms;
|
using Xamarin.Forms;
|
||||||
using Xamarin.Forms.Platform.iOS;
|
using Xamarin.Forms.Platform.iOS;
|
||||||
|
|
||||||
|
[assembly: ResolutionGroupName("eShopOnContainers")]
|
||||||
[assembly: ExportEffect(typeof(EntryLineColorEffect), "EntryLineColorEffect")]
|
[assembly: ExportEffect(typeof(EntryLineColorEffect), "EntryLineColorEffect")]
|
||||||
namespace eShopOnContainers.iOS.Effects
|
namespace eShopOnContainers.iOS.Effects
|
||||||
{
|
{
|
||||||
|
@ -0,0 +1,56 @@
|
|||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,68 @@
|
|||||||
|
using System;
|
||||||
|
using CoreGraphics;
|
||||||
|
using eShopOnContainers.Core.Views;
|
||||||
|
using eShopOnContainers.iOS;
|
||||||
|
using SlideOverKit.iOS;
|
||||||
|
using UIKit;
|
||||||
|
using Xamarin.Forms;
|
||||||
|
using Xamarin.Forms.Platform.iOS;
|
||||||
|
|
||||||
|
[assembly: ExportRenderer(typeof(CatalogView), typeof(SlideDownMenuPageRenderer))]
|
||||||
|
namespace eShopOnContainers.iOS
|
||||||
|
{
|
||||||
|
public class SlideDownMenuPageRenderer : PageRenderer, ISlideOverKitPageRendereriOS
|
||||||
|
{
|
||||||
|
public Action<bool> ViewDidAppearEvent { get; set; }
|
||||||
|
|
||||||
|
public Action<VisualElementChangedEventArgs> OnElementChangedEvent { get; set; }
|
||||||
|
|
||||||
|
public Action ViewDidLayoutSubviewsEvent { get; set; }
|
||||||
|
|
||||||
|
public Action<bool> ViewDidDisappearEvent { get; set; }
|
||||||
|
|
||||||
|
public Action<CGSize, IUIViewControllerTransitionCoordinator> ViewWillTransitionToSizeEvent { get; set; }
|
||||||
|
|
||||||
|
public SlideDownMenuPageRenderer()
|
||||||
|
{
|
||||||
|
new SlideOverKitiOSHandler().Init(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnElementChanged(VisualElementChangedEventArgs e)
|
||||||
|
{
|
||||||
|
base.OnElementChanged(e);
|
||||||
|
|
||||||
|
if (OnElementChangedEvent != null)
|
||||||
|
OnElementChangedEvent(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void ViewDidLayoutSubviews()
|
||||||
|
{
|
||||||
|
base.ViewDidLayoutSubviews();
|
||||||
|
if (ViewDidLayoutSubviewsEvent != null)
|
||||||
|
ViewDidLayoutSubviewsEvent();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void ViewDidAppear(bool animated)
|
||||||
|
{
|
||||||
|
base.ViewDidAppear(animated);
|
||||||
|
if (ViewDidAppearEvent != null)
|
||||||
|
ViewDidAppearEvent(animated);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void ViewDidDisappear(bool animated)
|
||||||
|
{
|
||||||
|
base.ViewDidDisappear(animated);
|
||||||
|
if (ViewDidDisappearEvent != null)
|
||||||
|
ViewDidDisappearEvent(animated);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void ViewWillTransitionToSize(CGSize toSize, IUIViewControllerTransitionCoordinator coordinator)
|
||||||
|
{
|
||||||
|
base.ViewWillTransitionToSize(toSize, coordinator);
|
||||||
|
if (ViewWillTransitionToSizeEvent != null)
|
||||||
|
ViewWillTransitionToSizeEvent(toSize, coordinator);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Before Width: | Height: | Size: 8.7 KiB After Width: | Height: | Size: 88 KiB |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 121 KiB |
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 276 KiB |
Before Width: | Height: | Size: 7.1 KiB After Width: | Height: | Size: 36 KiB |
Before Width: | Height: | Size: 8.2 KiB After Width: | Height: | Size: 97 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 9.6 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 955 B After Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 7.1 KiB After Width: | Height: | Size: 5.3 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 1023 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 1009 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.1 KiB |
@ -24,8 +24,20 @@
|
|||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
<ConsolePause>false</ConsolePause>
|
<ConsolePause>false</ConsolePause>
|
||||||
<MtouchArch>i386, x86_64</MtouchArch>
|
<MtouchArch>i386, x86_64</MtouchArch>
|
||||||
<MtouchLink>None</MtouchLink>
|
<MtouchLink>SdkOnly</MtouchLink>
|
||||||
<MtouchDebug>true</MtouchDebug>
|
<MtouchDebug>True</MtouchDebug>
|
||||||
|
<MtouchSdkVersion>10.1</MtouchSdkVersion>
|
||||||
|
<MtouchProfiling>False</MtouchProfiling>
|
||||||
|
<MtouchFastDev>False</MtouchFastDev>
|
||||||
|
<MtouchUseLlvm>False</MtouchUseLlvm>
|
||||||
|
<MtouchUseThumb>False</MtouchUseThumb>
|
||||||
|
<MtouchEnableBitcode>False</MtouchEnableBitcode>
|
||||||
|
<MtouchUseSGen>False</MtouchUseSGen>
|
||||||
|
<MtouchUseRefCounting>False</MtouchUseRefCounting>
|
||||||
|
<OptimizePNGs>True</OptimizePNGs>
|
||||||
|
<MtouchTlsProvider>Default</MtouchTlsProvider>
|
||||||
|
<MtouchHttpClientHandler>HttpClientHandler</MtouchHttpClientHandler>
|
||||||
|
<MtouchFloat32>False</MtouchFloat32>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' ">
|
||||||
<DebugType>none</DebugType>
|
<DebugType>none</DebugType>
|
||||||
@ -100,7 +112,9 @@
|
|||||||
<BundleResource Include="..\CommonResources\Fonts\SourceSansPro-Regular.ttf">
|
<BundleResource Include="..\CommonResources\Fonts\SourceSansPro-Regular.ttf">
|
||||||
<Link>Resources\fonts\SourceSansPro-Regular.ttf</Link>
|
<Link>Resources\fonts\SourceSansPro-Regular.ttf</Link>
|
||||||
</BundleResource>
|
</BundleResource>
|
||||||
|
<Compile Include="Renderers\CustomSwitchRenderer.cs" />
|
||||||
<Compile Include="Renderers\CustomTabbedPageRenderer.cs" />
|
<Compile Include="Renderers\CustomTabbedPageRenderer.cs" />
|
||||||
|
<Compile Include="Renderers\SlideDownMenuPageRenderer.cs" />
|
||||||
<None Include="app.config" />
|
<None Include="app.config" />
|
||||||
<None Include="Entitlements.plist" />
|
<None Include="Entitlements.plist" />
|
||||||
<None Include="Info.plist" />
|
<None Include="Info.plist" />
|
||||||
@ -246,6 +260,42 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<BundleResource Include="Resources\fake_product_05.png" />
|
<BundleResource Include="Resources\fake_product_05.png" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<BundleResource Include="Resources\menu_cart.png" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<BundleResource Include="Resources\menu_cart%402x.png" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<BundleResource Include="Resources\menu_cart%403x.png" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<BundleResource Include="Resources\menu_filter.png" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<BundleResource Include="Resources\menu_filter%402x.png" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<BundleResource Include="Resources\menu_filter%403x.png" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<BundleResource Include="Resources\menu_profile.png" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<BundleResource Include="Resources\menu_profile%402x.png" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<BundleResource Include="Resources\menu_profile%403x.png" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<BundleResource Include="Resources\product_add.png" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<BundleResource Include="Resources\product_add%402x.png" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<BundleResource Include="Resources\product_add%403x.png" />
|
||||||
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
|
||||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
|