-
Reducing executable size: http://developer.xamarin.com/guides/cross-platform/deployment,_testing,_and_metrics/memory_perf_best_practices/#Reducing_Executable_Size
-
Use the linker (iOS [1], Android [2]) to remove unnecessary code from your assemblies [1] https://developer.xamarin.com/guides/ios/advanced_topics/linker [2] https://developer.xamarin.com/guides/android/advanced_topics/linking
-
Reference third-party libraries judiciously
-
Applying constraints to generics may reduce app size, since less code would need to be included (haven’t verified this)
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 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); } | |
} |
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
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, |
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
... | |
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), | |
... |
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
... | |
<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}" /> | |
... |
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
... | |
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), | |
... |
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
<ContentPage ... | |
Visual="Material"> | |
... | |
</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
... | |
Forms.SetFlags("Visual_Experimental"); | |
... |
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
/// XF Project | |
namespace UsingDependencyService | |
{ | |
public interface IToDo { | |
void ToDo (); //note that interface members are public by default | |
} | |
} | |
namespace UsingDependencyService.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 RestService : IRestService | |
{ | |
HttpClient client; | |
... | |
public RestService () | |
{ | |
client = new HttpClient (); // Creating the HTTPClient Object | |
} | |