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 $ServiceName$Binder : Binder | |
{ | |
public $ServiceName$ Service { get; private set; } | |
public $ServiceName$Binder($ServiceName$ service) | |
{ | |
this.Service = service; | |
} | |
} |
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 MainPage : View | |
{ | |
readonly State<string> Name = ""; | |
readonly State<string> Email = ""; | |
readonly State<string> MessageDetails = ""; | |
[Body] | |
View body() => new VStack(spacing: 10) | |
{ | |
new Text(() => $"Name"), |
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
Show hidden characters
{ | |
"Comet Page View": { | |
"scope": "csharp", | |
"prefix": "mvuPage", | |
"body": [ | |
"public class ${1:PageName} : View \n{\n\t[Body]\n\tView body() => new VStack\n\t{\n\t};\n}" | |
], | |
"description": "Comet Page View" | |
}, | |
"Comet State Field": { |
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
/* | |
Looking at the Samsung Fold, I wanted to see what it would take to support it from a Xamarin.Android app | |
It turns out, not a great deal to test the proof of concept. | |
Step 1. Download the emulator APK at https://developer.samsung.com/galaxy/foldable/test and follow the instructions to install it | |
Step 2. Update the ConfigurationChanges property in the Activity Attribute - see line 24 | |
Step 3. Override OnSaveInstanceState and OnRestoreInstanceState to save/restore state | |
Step 4. Perform any updates (if needed) in OnConfigurationChanged | |
Step 5. Add the MetaData attribute for Allowing Multiple Resumed Activities |
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
// Instead of using calls like DateTime.Now, use TheDateTime.Now instead. In your production code it will default to using | |
// the read details and for testing you would make calls like: | |
// TheDateTime.SwitchToMockDate(new DateTime(2018, 12, 3); | |
// and then test what the outcome would be. It assumes that you have this throughout | |
public static class TheDateTime | |
{ | |
static Lazy<LiveDateTimeFunctions> _liveDates = new Lazy<LiveDateTimeFunctions>(() => new LiveDateTimeFunctions()); | |
static Lazy<MockDateTimeFunctions> _mockDates = new Lazy<MockDateTimeFunctions>(() => new MockDateTimeFunctions()); | |
static IDateTimeFunctions _instance = _liveDates.Value; |
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; | |
namespace PanningAViewCellDemo | |
{ | |
public class PanningViewCell<V1, V2> : ViewCell | |
where V1 : View, new() | |
where V2 : View, new() | |
{ | |
V1 mainView; |
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.Linq; | |
using Xamarin.Forms; | |
using System.Collections.Generic; | |
using System.ComponentModel; | |
namespace SampleApp | |
{ | |
// Inherit from this page to get a multi-select option in XF | |
public class SelectMultipleBasePage<T> : ContentPage |
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
// // Just an example of making a fluent style interface. It's a work in progress but I'd rather not use the NSLayoutContraint code | |
// // As it seems like a poorly designed API. I've wrapped it with some fluent style access for common issues | |
// | |
// var mainButton = new UIButton (); | |
// mainButton.SetTitle ("Click me dude", UIControlState.Normal); | |
// mainButton.BackgroundColor = UIColor.Blue; | |
// Add (mainButton); | |
// | |
// var secondButton = new UIButton (); | |
// secondButton.SetTitle ("The other one", UIControlState.Normal); |
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 enum QualityFormat | |
{ | |
iOSRetina, | |
PNG32, | |
PNG64, | |
PNG128, | |
PNG256, | |
JPG70, | |
JPG80, | |
JPG90 |