Skip to content

Instantly share code, notes, and snippets.

Avatar
🐼
Thinking

Tuğçe Arar stugcearar

🐼
Thinking
View GitHub Profile
@stugcearar
stugcearar / gist:a0bf9eaa92925e77da2141f2209cc15c
Created Feb 5, 2017 — forked from brianmed/gist:4e458d9116889b798a8c
Xamarin Forms custom webView renderer with activity load
View gist:a0bf9eaa92925e77da2141f2209cc15c
***
In Shared code:
public class WebViewPage : ContentPage
{
}
...
await Navigation.PushAsync (new WebViewPage());
View EmptyCollectionContractResolver.cs
class EmptyCollectionContractResolver : DefaultContractResolver {
protected override JsonProperty CreateProperty(MemberInfo member, MemberSerialization memberSerialization) {
JsonProperty property = base.CreateProperty(member, memberSerialization);
Predicate<object> shouldSerialize = property.ShouldSerialize;
property.ShouldSerialize = obj => (shouldSerialize == null || shouldSerialize(obj)) && !IsEmptyCollection(property, obj);
return property;
}
private bool IsEmptyCollection(JsonProperty property, object target) {
@stugcearar
stugcearar / Badge.cs
Created Apr 11, 2018 — forked from rudyryk/Badge.cs
C# — Xamarin.Forms custom simple badge view + rounded box view via custom renderer
View Badge.cs
//
// Badge.cs
// Created by Alexey Kinev on 19 Jan 2015.
//
// Licensed under The MIT License (MIT)
// http://opensource.org/licenses/MIT
//
// Copyright (c) 2015 Alexey Kinev <alexey.rudy@gmail.com>
//
using System;
You can’t perform that action at this time.