Instantly share code, notes, and snippets.

View MainPage.xaml
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:SelectionPerPlatform.Portable"
xmlns:telerikInput="clr-namespace:Telerik.XamarinForms.Input;assembly=Telerik.XamarinForms.Input"
x:Class="Example.Portable.MainPage">
<telerikInput:RadEntry local:TelerikValidator.EmptyStringValidator="True"
VerticalOptions="Center"
Margin="10"/>
</ContentPage>
View Program.cs
using System;
using System.Collections.ObjectModel;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Net.Http;
using System.Threading.Tasks;
using static System.Console;
namespace BrotliTest
View DateRangeChangedEventArgs.cs
public class DateRangeChangedEventArgs : System.EventArgs
{
public DateRangeChangedEventArgs(DateTime startDate, DateTime endDate)
{
StartDate = startDate;
EndDate = endDate;
}
public DateTime StartDate { get; set; }
View FileExtensions.cs
public static class FileExtensions
{
private static readonly string LocalFolder;
static FileExtensions()
{
// Gets the target platform's valid save location
LocalFolder = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
}
View StartPage.xaml
<?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:dataControls="clr-namespace:Telerik.XamarinForms.DataControls;assembly=Telerik.XamarinForms.DataControls"
xmlns:input="clr-namespace:Telerik.XamarinForms.Input;assembly=Telerik.XamarinForms.Input"
x:Class="TelerikXamarinApp1.Portable.StartPage">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
View ThemeHelper.cs
using Telerik.XamarinForms.Common;
using Xamarin.Forms;
namespace YourAwesomeApp.Helpers
{
public static class ThemeHelper
{
public static void ChangeTheme(string themeName)
{
if(Application.Current.Resources != null)
View CustomTheme.xaml
<ResourceDictionary xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="TelerikXamarinApp1.Portable.Themes.CustomTheme">
<!-- Chart -->
<Color x:Key="ChartAxisColor">#919191</Color>
<Color x:Key="ChartGridLinesColor">#D9D9D9</Color>
<!-- ListView -->
<Color x:Key="ListViewItemBorderColor">Azure</Color>
View ItemViewModel.cs
public class ItemViewModel
{
public string Title { get; set; }
public string ThumbnailUrl { get; set; }
public List<string> Details { get; set; }
}
View MainViewModel.cs
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using DetailsDrawer.Annotations;
namespace DetailsDrawer.ViewModels
{
public class MainPageViewModel : INotifyPropertyChanged
{
private ObservableCollection<RouteStep> routeSteps;
View MainPage.xaml.cs
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
namespace DetailsDrawer
{
public sealed partial class MainPage : Page
{
public MainPage()