This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections; | |
using System.Windows.Input; | |
using Android.Content; | |
using Android.Runtime; | |
using Android.Support.V7.Widget; | |
using Android.Util; | |
using MvvmCross.Binding.Attributes; | |
using MvvmCross.Binding.Droid.Views; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class BaseViewModel : MvxViewModel, IBackViewModel | |
{ | |
#region InvokeOnMainThreadAsync | |
protected Task InvokeOnMainThreadAsync(Action action) | |
{ | |
var tcs = new TaskCompletionSource<bool>(); | |
if (Dispatcher != null) | |
{ | |
Dispatcher.RequestMainThreadAction(() => | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public sealed class ActivityLifecycleHelper : IDisposable | |
{ | |
private readonly ActivityLifecycleCallbacksHelper activityLifecycle = new ActivityLifecycleCallbacksHelper(); | |
private Android.App.Application application; | |
public Activity TopActivity { get; private set; } | |
public ActivityLifecycleHelper(Android.App.Application application) | |
{ | |
this.application = application; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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:demo="clr-namespace:XamSvg.Demo;assembly=XamSvg.Demo" | |
x:Class="XamSvg.Demo.MainPage" | |
BackgroundColor="#E08080" | |
Title="XamSvg Demo"> | |
<demo:MyButton x:Name="TestButton" Text="TestText" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
internal class MvxJsonTextSerializer : IMvxJsonConverter | |
{ | |
private static readonly JsonSerializerSettings Settings; | |
public static void Register() | |
{ | |
Mvx.RegisterType<IMvxJsonConverter, MvxJsonTextSerializer>(); | |
Mvx.RegisterType<IMvxTextSerializer, MvxJsonTextSerializer>(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public abstract class MvxTargetBinding2 : MvxBinding, IMvxTargetBinding | |
{ | |
private readonly object _target; | |
protected MvxTargetBinding2(object target) | |
{ | |
_target = target; | |
} | |
protected object Target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected static void AddParallaxEffect(UIView back) | |
{ | |
//var frame = back.Frame; | |
//back.Superview.RemoveConstraints(back.Superview.Constraints.Where(c => c.FirstItem == back).ToArray()); | |
//back.Frame = frame; | |
var keypathx = "constraints[0].constant"; | |
var keypathy = "constraints[1].constant"; | |
var xMotionEffect = new UIInterpolatingMotionEffect(keypathx, UIInterpolatingMotionEffectType.TiltAlongHorizontalAxis) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Author: softlion ([email protected]) | |
/// </summary> | |
/// <remarks> | |
/// Thanks to: Stuart Lodge | |
/// </remarks> | |
public class MvxRadioGroupSelectedIndexBinding : MvxAndroidTargetBinding | |
{ | |
bool stopListeningCheckChanged = false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<TextView | |
local:MvxBind="Text PasswordConfirm; ImeAction RegisterCommand" | |
android:textAppearance="?android:attr/textAppearanceLarge" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:hint="Password" | |
android:inputType="textPassword" | |
android:imeOptions="actionSend" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*! | |
* jQuery TextChange Plugin | |
* http://www.zurb.com/playground/jquery-text-change-custom-event | |
* | |
* Copyright 2010, ZURB | |
* Released under the MIT License | |
*/ | |
(function ($) { | |
$.fn.textchanged = function() { |