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 FileChooserWebChromeClient : WebChromeClient | |
{ | |
private Action<IValueCallback, Java.Lang.String, Java.Lang.String> callback; | |
public FileChooserWebChromeClient (Action<IValueCallback, Java.Lang.String, Java.Lang.String> callback) | |
{ | |
callback = callback; | |
} | |
// For Android < 5.0 |
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 MainActivity : FormsAppCompatActivity | |
{ | |
public static IValueCallback UploadMessage; | |
private static int FILECHOOSER_RESULTCODE = 1; | |
public static Android.Net.Uri mCapturedImageURI; | |
protected override void OnCreate (Bundle bundle) | |
{ | |
base.OnCreate (bundle); |
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
private void WebView_OnNavigating (object sender, WebNavigatingEventArgs e) | |
{ | |
var url = e.Url.ToLowerInvariant (); | |
if (url.Contains ("thirdparty.com") || url.Contains ("vimeo.com") || url.Contains ("bid.g.doubleclick.net")) { | |
// Do nothing, links are loaded as embedded | |
} else if (url.StartsWith ("https://getmypdfurl.com", StringComparison.Ordinal)) { | |
e.Cancel = true; | |
if (Device.OS == TargetPlatform.Windows) |
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 UIKit; | |
using Xamarin.Forms; | |
using Xamarin.Forms.Platform.iOS; | |
[assembly: ExportRenderer (typeof (TextCell), typeof (RightDetailSample.iOS.TextCellRenderer))] | |
namespace RightDetailSample.iOS | |
{ | |
public class TextCellRenderer : Xamarin.Forms.Platform.iOS.TextCellRenderer | |
{ |
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.Globalization; | |
using Xamarin.Forms; | |
namespace SampleValueConverters.ValueConverters | |
{ | |
public class PlatformToColorConverter : IValueConverter | |
{ | |
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) | |
{ |
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.Globalization; | |
using SampleValueConverters.Enums; | |
using Xamarin.Forms; | |
namespace SampleValueConverters.ValueConverters | |
{ | |
public class PlatformToColorConverter : IValueConverter | |
{ | |
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) |
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
<?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:SampleValueConverters" x:Class="SampleValueConverters.SampleValueConvertersPage" xmlns:converters="clr-namespace:SampleValueConverters.ValueConverters;assembly=SampleValueConverters"> | |
<ContentPage.Padding> | |
<OnPlatform x:TypeArguments="Thickness"> | |
<On Platform="iOS" Value="0,20,0,0" /> | |
</OnPlatform> | |
</ContentPage.Padding> | |
<ContentPage.Resources> | |
<ResourceDictionary> |
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
<Image Grid.Row="0" Source="MyImage.png" WidthRequest="280" Aspect="AspectFit" Margin="0,0,0,20"> | |
<Image.GestureRecognizers> | |
<TapGestureRecognizer NumberOfTapsRequired="10" Command="{Binding DoSomethingCommand}" /> | |
</Image.GestureRecognizers> | |
</Image> |
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
private readonly ObservableRangeCollection<Breach> _breaches = new ObservableRangeCollection<Breach>(); | |
public ObservableCollection<Breach> Breaches => _breaches; | |
private ICommand refreshCommand; | |
public ICommand RefreshCommand | |
{ | |
get | |
{ | |
return refreshCommand ?? | |
(refreshCommand = new Command(() => LoadBreaches(), () => !IsLoading)); |
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
<?xml version="1.0" encoding="utf-8"?> | |
<ContentPage Title="Akavache sample" xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:local="clr-namespace:AkavacheSample" x:Class="AkavacheSample.AkavacheSamplePage"> | |
<ListView ItemsSource="{Binding Breaches}" IsRefreshing="{Binding IsLoading}" RefreshCommand="{Binding RefreshCommand}" IsPullToRefreshEnabled="true"> | |
<ListView.ItemTemplate> | |
<DataTemplate> | |
<TextCell Text="{Binding Name}" Detail="{Binding NoOfAccounts, StringFormat='{0} of pwned accounts'}" /> | |
</DataTemplate> | |
</ListView.ItemTemplate> | |
</ListView> | |
</ContentPage> |