Skip to content

Instantly share code, notes, and snippets.

View luismts's full-sized avatar
🚀
Kaizen

Luis Matos luismts

🚀
Kaizen
View GitHub Profile
@luismts
luismts / BooleanToObjectConverter.cs
Created December 12, 2020 03:22 — forked from QiMata/BooleanToObjectConverter.cs
A list of useful converters for Xamarin Forms
public class BooleanToObjectConverter : BindableObject, IValueConverter
{
public static readonly BindableProperty TrueObjectProperty = BindableProperty.Create<BooleanToObjectConverter, Object>(x => x.TrueObject, null);
public static readonly BindableProperty FalseObjectProperty = BindableProperty.Create<BooleanToObjectConverter, Object>(x => x.FalseObject, null);
public object FalseObject
{
get { return GetValue(FalseObjectProperty); }
set { SetValue(FalseObjectProperty, value); }
}
@luismts
luismts / basic-example-clasic-cs.cs
Last active May 8, 2020 16:04
A comparison between classic C#, C# markup, and XAML for creating UI
var grid = new Grid();
var label = new Label { Text = "Code:" };
grid.Children.Add(label, 0, 1);
var entry = new Entry
{
Placeholder = "Enter number",
Keyboard = Keyboard.Numeric,
BackgroundColor = Color.AliceBlue,
@luismts
luismts / XamarinReduceAppSize.md
Last active January 10, 2020 14:36 — forked from jgold6/gist:a1e60e0bb24ccdd2b2b8
Xamarin Reduce App Size
@luismts
luismts / Entry.cs
Last active December 10, 2019 14:54
...
new Entry { Placeholder = "Sigueme en las redes @luismatosluna", Keyboard = Keyboard.Numeric,
Margin = myMargin, HeightRequest = 20 }
.Grid.Row(2) .Grid.ColumnSpan(2)
.Bind(nameof(vm.RegistrationCode), BindingMode.TwoWay),
...
@luismts
luismts / Entry.xaml
Last active December 10, 2019 14:54
...
<Entry Placeholder="Sigueme en las redes @luismatosluna" Keyboard="Numeric"
Margin="{StaticResource myMargin}" HeightRequest="20"
Grid.Row="2" Grid.ColumnSpan="2"
Text="{Binding RegistrationCode, Mode=TwoWay}" />
...
...
new Entry { Placeholder = "Sigueme en las redes @luismatosluna", Keyboard = Keyboard.Numeric }
.Grid.Row(2) .Grid.ColumnSpan(2) .Margin(myMargin) .Height(20)
.Bind(nameof(vm.RegistrationCode), BindingMode.TwoWay),
...
<ContentPage ...
Visual="Material">
...
</ContentPage>
...
Forms.SetFlags("Visual_Experimental");
...
/// XF Project
namespace UsingDependencyService
{
public interface IToDo {
void ToDo (); //note that interface members are public by default
}
}
namespace UsingDependencyService.Service
{
public class RestService : IRestService
{
HttpClient client;
...
public RestService ()
{
client = new HttpClient (); // Creating the HTTPClient Object
}