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 static class ColorConverter | |
{ | |
public static NSColor FromColor(Color c) | |
{ | |
float red = IntToFloat(c.R); | |
float green = IntToFloat(c.G); | |
float blue = IntToFloat(c.B); | |
return NSColor.FromDeviceRgba(red, green, blue, 1); | |
} |
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
[<AutoOpen>] | |
module StateMachine = | |
type State = | |
| StateA | |
| StateB | |
| StateC | |
| StateD | |
| End |
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.IO; | |
using System.Reflection; | |
using System.Collections.Generic; | |
using SkiaSharp; | |
using SkiaSharp.Views.Forms; | |
using Xamarin.Forms; | |
namespace Components | |
{ |
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 Xamarin.Forms; | |
namespace Taimila | |
{ | |
public class CardView : ContentView | |
{ | |
public static readonly BindableProperty CornerRadiusProperty = BindableProperty.Create( | |
propertyName: "CornerRadius", | |
returnType: typeof(int), | |
declaringType: typeof(CardView), |
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 static class ExtraAnimations | |
{ | |
public static async Task<bool> HeightTo(this View view, double height, uint duration = 250, Easing easing = null) | |
{ | |
var tcs = new TaskCompletionSource<bool>(); | |
var heightAnimation = new Animation(x => view.HeightRequest = x, view.Height, height); | |
heightAnimation.Commit(view, "HeightAnimation", 10, duration, easing, (finalValue, finished) => { tcs.SetResult(finished); }); | |
return await tcs.Task; |
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 Xamarin.Forms; | |
using System.Linq; | |
using System.Threading.Tasks; | |
namespace ExampleApp | |
{ | |
/// <summary> | |
/// Base content page that provides navigation mechanism that | |
/// allows view models to navigate from one view model to another |
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 Xamarin.Essentials; | |
using Xamarin.Forms; | |
namespace NamespaceOfYourApp | |
{ | |
/// <summary> | |
/// Utility to get more information on screen configuration, type and size on iOS devices. | |
/// </summary> | |
public class Screen |
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
import Foundation | |
enum Feature: String, CaseIterable { | |
case newThing | |
case otherThing | |
var isEnabled: Bool { | |
return UserDefaults.standard.bool(forKey: "feature-\(self.rawValue)") | |
} | |