Skip to content

Instantly share code, notes, and snippets.

[assembly: ExportRenderer(typeof(Label), typeof(LabelRender))]
namespace Mobile.iOS.Renderer
{
public class LabelRender : LabelRenderer
{
private class TouchLabel : UILabel
{
Label Element = null;
public TouchLabel(Label element)
{
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:gesture="clr-namespace:Mobile.Gestures;assembly=Mobile"
x:Class="Mobile.View.MainPage" BackgroundColor="Black">
<Label Text="Press Me" WidthRequest="250" HeightRequest="100" HorizontalTextAlignment="Center" VerticalTextAlignment="Center" TextColor="{Binding TextColor}" BackgroundColor="{Binding BackgroundColor}" VerticalOptions="Center" HorizontalOptions="Center">
<Label.GestureRecognizers>
<gesture:PressedGestureRecognizer Command="{Binding PressedGestureCommand}" />
<gesture:ReleasedGestureRecognizer Command="{Binding ReleasedGestureCommand}" />
<?xml version="1.0" encoding="utf-8" ?>
<Grid xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Tesla.Control.StatusBarLabel" VerticalOptions="FillAndExpand"
RowSpacing="0" ColumnSpacing="0">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Label x:Name="MainLabel" Grid.Row="0" VerticalTextAlignment="Center" HorizontalTextAlignment="Center" VerticalOptions="FillAndExpand" />
var animation = new Animation(callback: d => grid.StatusBar.WidthRequest = d,
start: 0,
end: grid.Width,
easing: Easing.Linear);
animation.Commit(grid, MoveAnimation, rate: Convert.ToUInt32(jumpCount), length: Convert.ToUInt32(Timeout), finished: (length, result) =>
{
if (IsRunning)
{
grid.StatusBar.BackgroundColor = Color.Red;
public class BaseViewModel : Exrin.Framework.ViewModel
{
public BaseViewModel(IDisplayService displayService, INavigationService navigationService,
IErrorHandlingService errorHandlingService, IStackRunner stackRunner, IVisualState visualState)
: base(displayService, navigationService, errorHandlingService, stackRunner, visualState)
{
}
}
<?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="Mobile.Base.BaseView">
</ContentPage>
public partial class BaseView : ContentPage, IView
{
public BaseView()
public class BaseModel: Exrin.Framework.Model
{
public BaseModel(IDisplayService displayService, IApplicationInsights applicationInsights, IErrorHandlingService errorHandlingService, IModelState modelState)
:base(displayService, applicationInsights, errorHandlingService, modelState)
{
}
}
namespace Mobile.Definition.ViewLocator
{
public enum Authentication
{
Pin = 0
}
public enum Main
{
Main = 0
public class AuthenticationStack : BaseStack
{
public AuthenticationStack(INavigationService navigationService)
: base(navigationService, new NavigationContainer(new NavigationPage()), Stacks.Authentication)
{
}
protected override void Map()
{
_navigationService.Map(nameof(Authentication.Pin), typeof(PinPage), typeof(PinViewModel));
public class Injection: IInjection
{
private static ContainerBuilder _builder = null;
private static IContainer Container { get; set; } = null;
private static IList<Type> _registered = new List<Type>();
public void Init()
{