Skip to content

Instantly share code, notes, and snippets.

View VincentH-Net's full-sized avatar
🔥
Innovating full stack development with C#

Vincent Hoogendoorn VincentH-Net

🔥
Innovating full stack development with C#
View GitHub Profile
@VincentH-Net
VincentH-Net / MainView.cs
Last active December 26, 2015 07:29
Main view code for Android Cloud Auction example app, built with MvvmQuickCross
using Android.App;
using Android.Views;
using Android.OS;
using Android.Content.PM;
using MvvmQuickCross;
using CloudAuction.Shared;
using CloudAuction.Shared.ViewModels;
namespace CloudAuction
{
@VincentH-Net
VincentH-Net / MainView.axml
Created October 23, 2013 09:03
Main view markup for Android Cloud Auction example app, built with MvvmQuickCross
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/MainView"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<FrameLayout
android:id="@+id/MainView_TabFragmentContainer"
android:layout_width="match_parent"
android:layout_height="0dip"
@VincentH-Net
VincentH-Net / MainMenu.xml
Created October 23, 2013 09:16
Main view menu markup for Android Cloud Auction example app, built with MvvmQuickCross
<?xml version="1.0" encoding="utf-8" ?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@+id/LogoutMenuItem"
android:title="Logout"
android:showAsAction="ifRoom" />
</menu>
@VincentH-Net
VincentH-Net / AuctionView.axml
Created October 23, 2013 13:39
Auction view markup for Android Cloud Auction example app, built with MvvmQuickCross
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/AuctionView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fillViewport="true">
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
@VincentH-Net
VincentH-Net / ViewDataBindings.UI.cs
Last active December 26, 2015 08:09
MvvmQuickCross data-binding support code for MultiImageView Xamarin Store component. Insert in MvvmQuickCross\ViewDataBindings.UI.cs in the UpdateView(View view, object value) method, directly below the comment that says: // TODO: Add cases here for specialized view types, as needed
// TODO: Add cases here for specialized view types, as needed
case "Macaw.UIComponents.MultiImageView":
{
if (value is Uri) value = ((Uri)value).AbsoluteUri;
var multiImageView = (Macaw.UIComponents.MultiImageView)view;
multiImageView.LoadImageList(value == null ? null : new[] { (string)value });
multiImageView.LoadImage();
}
break;
@VincentH-Net
VincentH-Net / OrderView.axml
Created October 24, 2013 08:45
Order view markup for Android Cloud Auction example app, built with MvvmQuickCross
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/OrderView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fillViewport="true">
<TableLayout
android:stretchColumns="1,2"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
@VincentH-Net
VincentH-Net / TextListItem.axml
Created October 24, 2013 09:23
Simple text list item view markup for Android Cloud Auction example app, built with MvvmQuickCross
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/TextListItem"
android:textAppearance="?android:attr/textAppearanceMedium"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
@VincentH-Net
VincentH-Net / OrderResultView.axml
Created October 24, 2013 12:37
OrderResult view markup for Android Cloud Auction example app, built with MvvmQuickCross
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/OrderResultView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fillViewport="true">
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
@VincentH-Net
VincentH-Net / KeyboardDismissGestureRecognizer.cs
Created January 10, 2014 13:52
KeyboardDismissGestureRecognizer automatically dismisses the onscreen keyboard in Xamarin.iOS when a user taps outside an editable view. Simply add a KeyboardDismissGestureRecognizer to your application's main window in FinishedLaunching.
/// <summary>
/// To automatically dismiss the onscreen keyboard in iOS when a user taps outside an editable view,
/// add a KeyboardDismissGestureRecognizer to your application's main window in FinishedLaunching, e.g.:
/// Window.AddGestureRecognizer(new KeyboardDismissGestureRecognizer());
/// </summary>
public class KeyboardDismissGestureRecognizer : UITapGestureRecognizer
{
public KeyboardDismissGestureRecognizer() : base(() => { }) { CancelsTouchesInView = false; }
public override void TouchesBegan(NSSet touches, UIEvent evt)
@VincentH-Net
VincentH-Net / FormsBinding.sketchcs.cs
Last active March 21, 2016 18:09
Xamarin Forms Sketch demonstrating data binding (without strings, to nested objects, to unlimited number of fields) and common app/sketch code. Note: remove the .cs from the file name, it is only there to make GitHub format it as C#
using Xamarin.Forms;
// Additional guidance: see http://vincenth.net/blog/archive/2014/11/27/how-to-share-xamarin-forms-data-binding-code-across-xamarin-sketches-and-apps-without-using-strings.aspx
// NOTE: Once support for creating classes is added to Xamarin Sketches,
// there is no need for this Tuple + enum + BindName + regular expression workaround;
// you can then simply create design data classes in the Sketch and bind to that using
// the same syntax in both projects and sketches, e.g.:
// SetBinding(..., (Person boundPerson) => boundPerson.Name)
// BindName helper function for use with binding to design data in Sketches.