This file contains hidden or 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 hidden or 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 CacheableViewModelLocator : MvxDefaultViewModelLocator{ | |
| public override IMvxViewModel Load(Type viewModelType, IMvxBundle parameterValues, IMvxBundle savedState) | |
| { | |
| if (viewModelType.GetInterfaces().Any(x=>x == typeof(ICacheableViewModel))) | |
| { | |
| var cache = Mvx.Resolve<IMvxMultipleViewModelCache>(); | |
| var cachedViewModel = cache.GetAndClear(viewModelType); | |
| if (cachedViewModel == null) | |
| cachedViewModel = base.Load(viewModelType, parameterValues, savedState); |
This file contains hidden or 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 static void Fade (this UIView view, bool isIn, double duration = 0.3, Action onFinished = null) | |
| { | |
| var minAlpha = (nfloat)0.0f; | |
| var maxAlpha = (nfloat)1.0f; | |
| view.Alpha = isIn ? minAlpha : maxAlpha; | |
| view.Transform = CGAffineTransform.MakeIdentity (); | |
| UIView.Animate (duration, 0, UIViewAnimationOptions.CurveEaseInOut, | |
| () => { | |
| view.Alpha = isIn ? maxAlpha : minAlpha; |
This file contains hidden or 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 TableViewController : UITableViewController | |
| { | |
| static readonly NSString CellId = new NSString ("C"); | |
| readonly TableViewSource source = new TableViewSource (); | |
| readonly List<string> rows = new List<string> (); | |
| public override void ViewDidLoad () | |
| { | |
| base.ViewDidLoad (); |
This file contains hidden or 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
| /* | |
| Snippet Name: InlineTableViewSource | |
| Platform: iOS | |
| Function: A subclass of UITableViewSource that allows you to define UITableViewDataSource and UITableViewDelegate methods inline, rather than subclassing. Lets you take advantage of closures and use tableviews where you can't create subclasses, like in Xamarin Sketches (compile and reference). | |
| Funcs/Actions are prefixed with "_", feel free to alter if this disagrees with your styling guidelines. | |
| Usage: | |
| var cellId = new NSString("cell"); |
This file contains hidden or 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 CustomFragmentsPresenter : MvxFragmentsPresenter | |
| { | |
| public interface IMvxFragmentHostEx : IMvxFragmentHost | |
| { | |
| void Close(IMvxViewModel viewModel); | |
| void ChangePresentation (MvxPresentationHint hint); | |
| } | |
| private IMvxNavigationSerializer _serializer; |
This file contains hidden or 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
| Snippet Name: iOS Utils | |
| Platform: Xamarin.iOS | |
| Function: Check if running iOS 8, is phone, is tall, and envoke on UI Thread | |
| Snippet: | |
| public static class Utils | |
| { | |
| public static NSObject Invoker; |
This file contains hidden or 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"?> | |
| <android.support.v7.widget.CardView | |
| android:id="@+id/card_view_friend" | |
| xmlns:android="http://schemas.android.com/apk/res/android" | |
| xmlns:card_view="http://schemas.android.com/apk/res-auto" | |
| android:layout_width="wrap_content" | |
| android:layout_height="wrap_content" | |
| card_view:cardCornerRadius="4dp" | |
| card_view:cardUseCompatPadding="true"> |
This file contains hidden or 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
| [DllImport("/usr/lib/libobjc.dylib")] | |
| extern static IntPtr class_getInstanceMethod(IntPtr classHandle, IntPtr Selector); | |
| [DllImport("/usr/lib/libobjc.dylib")] | |
| extern static IntPtr method_getImplementation(IntPtr method); | |
| [DllImport("/usr/lib/libobjc.dylib")] | |
| extern static IntPtr imp_implementationWithBlock(ref BlockLiteral block); | |
| [DllImport("/usr/lib/libobjc.dylib")] |
This file contains hidden or 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
| 2015-02-16 14:24:38.950 HiJackTest[4944:2813532] Attempting to JIT compile method '(wrapper managed-to-native) System.Func`3<intptr, intptr, intptr>:wrapper_aot_native (intptr&,intptr,intptr)' while running with --aot-only. See http://docs.xamarin.com/ios/about/limitations for more information. | |
| 2015-02-16 14:24:39.002 HiJackTest[4944:2813532] Moving to: <UIStatusBar: 0x154854a00; frame = (0 0; 0 20); opaque = NO; layer = <CALayer: 0x17003e4c0>> | |
| 2015-02-16 14:24:44.716 HiJackTest[4944:2813532] Unhandled managed exception: Object reference not set to an instance of an object (System.NullReferenceException) | |
| at HiJackTest.Application.MyCapture (IntPtr block, IntPtr self, IntPtr uiView) [0x00018] in /Users/dbeattie/HijackTest/HiJackTest/Main.cs:54 | |
| at (wrapper native-to-managed) HiJackTest.Application:MyCapture (intptr,intptr,intptr) | |
| at (wrapper managed-to-native) UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr) | |
| at UIKit.UIApplication.Main (System.String[] args, IntPtr principal, IntPtr |