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()
View MainPage.xaml
<Page x:Class="DetailsDrawer.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:DetailsDrawer"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:viewModels="using:DetailsDrawer.ViewModels"
mc:Ignorable="d">
<Page.DataContext>
View ThemeModel.cs
[DataContract]
public class ThemeModel : INotifyPropertyChanged
{
private Color backgroundColor;
private Color textColor;
private Color buttonBackgroundColor;
private Color buttonTextColor;
private Color accentColor;
private Color headerColor;
View FadeHeaderBehavior.cs
public class FadeHeaderBehavior : Behavior<FrameworkElement>
{
public static readonly DependencyProperty HeaderElementProperty = DependencyProperty.Register(
"HeaderElement", typeof(UIElement), typeof(FadeHeaderBehavior), new PropertyMetadata(null, PropertyChangedCallback));
public UIElement HeaderElement
{
get { return (UIElement) GetValue(HeaderElementProperty); }
set { SetValue(HeaderElementProperty, value); }
}