This file contains hidden or 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.ComponentModel; | |
using System.Reflection; | |
namespace YourApp.Extensions; | |
public class ReflectionHelpers | |
{ | |
/// <summary> | |
/// Get's the string value of the DisplayName attribute of a property. | |
/// </summary> |
This file contains hidden or 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.Collections.Generic; | |
using Newtonsoft.Json; | |
namespace YourApp.Models | |
{ | |
/// <Summary> | |
/// Basic Google's geocode information model. | |
/// </Summary> | |
public class Geocode | |
{ |
This file contains hidden or 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
<?xml version="1.0" encoding="utf-8" ?> | |
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" | |
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | |
xmlns:d="http://xamarin.com/schemas/2014/forms/design" | |
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |
mc:Ignorable="d" | |
Title="{Binding Title}" | |
xmlns:converters="clr-namespace:MyApp.Converters" | |
xmlns:google="clr-namespace:Xamarin.Forms.GoogleMaps;assembly=Xamarin.Forms.GoogleMaps" | |
x:Class="MyApp.Views.MapPage"> |
This file contains hidden or 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
<Frame HorizontalOptions="FillAndExpand" Visual="Material"> | |
<StackLayout VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand"> | |
<Image Source="Your_image" VerticalOptions="FillAndExpand" HorizontalOptions="CenterAndExpand" Aspect="AspectFit" /> | |
<Label VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand" HorizontalTextAlignment="Center" Text="Text" /> | |
<StackLayout.GestureRecognizers> | |
<TapGestureRecognizer Command={Binding YourTapCommand} /> | |
</StackLayout.GestureRecognizers> | |
</StackLayout> | |
</Frame> |
This file contains hidden or 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.Globalization; | |
using Xamarin.Forms; | |
using Xamarin.Forms.GoogleMaps; | |
namespace YourNamespace.Framework.Converters | |
{ | |
public class IconBitmapConverter : IValueConverter | |
{ | |
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) |
This file contains hidden or 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
<google:Map MyLocationEnabled="True" ItemsSource="{Binding Items}"> | |
<google:Map.ItemTemplate> | |
<DataTemplate> | |
<google:Pin | |
Type="Place" | |
Position="{Binding Position}" | |
Label="{Binding Name}" | |
Address="{Binding FullAddress}" | |
Icon="{Binding Pin, Converter={StaticResource IconBitmapConverter}}"> | |
</google:Pin> |
This file contains hidden or 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
<?xml version="1.0" encoding="utf-8"?> | |
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:local="clr-namespace:LocalNotifications" x:Class="LocalNotifications.MainPage"> | |
<StackLayout> | |
<!-- Place new controls here --> | |
<Button x:Name="btnNotification" Text="Send Notification in 5 seconds" HorizontalOptions="Center" VerticalOptions="CenterAndExpand" /> | |
</StackLayout> | |
</ContentPage> |
This file contains hidden or 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
// Check for permissions | |
if (UIDevice.CurrentDevice.CheckSystemVersion (10, 0)) { | |
// Ask the user for permission to get notifications on iOS 10.0+ | |
UNUserNotificationCenter.Current.RequestAuthorization ( | |
UNAuthorizationOptions.Alert | UNAuthorizationOptions.Badge | UNAuthorizationOptions.Sound, | |
(approved, error) => { | |
if (approved) { | |
UNUserNotificationCenter.Current.Delegate = new UserNotificationCenterDelegate (); | |
} | |
}); |
This file contains hidden or 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
<?xml version="1.0" encoding="utf-8"?> | |
<ContentPage Title="Barcode Demo" | |
xmlns="http://xamarin.com/schemas/2014/forms" | |
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | |
xmlns:local="clr-namespace:BarcodeScanner" | |
xmlns:viewmodels="clr-namespace:BarcodeScanner.ViewModels;assembly=BarcodeScanner" | |
x:Class="BarcodeScanner.Views.MainPage"> | |
<ContentPage.BindingContext> | |
<viewmodels:MainPageViewModel /> | |
</ContentPage.BindingContext> |
This file contains hidden or 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 override void OnRequestPermissionsResult(int requestCode, string[] permissions, Permission[] grantResults) | |
{ | |
global::ZXing.Net.Mobile.Android.PermissionsHandler.OnRequestPermissionsResult(requestCode, permissions, grantResults); | |
} |
NewerOlder