Skip to content

Instantly share code, notes, and snippets.

💾
Bashing __(ง'̀-'́)ง__ bugs

Lance McCarthy LanceMcCarthy

Block or report user

Report or block LanceMcCarthy

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@LanceMcCarthy
LanceMcCarthy / ThemeHelper.cs
Created Feb 19, 2018
Helper class to change theme resources at runtime
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)
@LanceMcCarthy
LanceMcCarthy / CustomTheme.xaml
Created Feb 19, 2018
Custom Theme for UI for Xamarin
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>
@LanceMcCarthy
LanceMcCarthy / ItemViewModel.cs
Created Dec 2, 2017
FlyoutPresenter with Acrylic Brush Background
View ItemViewModel.cs
public class ItemViewModel
{
public string Title { get; set; }
public string ThumbnailUrl { get; set; }
public List<string> Details { get; set; }
}
@LanceMcCarthy
LanceMcCarthy / MainViewModel.cs
Created Jan 10, 2017
ManiulationDrawer demo view model and model
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;
@LanceMcCarthy
LanceMcCarthy / MainPage.xaml.cs
Created Jan 10, 2017
ManipulationDrawer demo main page code behind
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()
@LanceMcCarthy
LanceMcCarthy / MainPage.xaml
Last active Jan 10, 2017
ManipulatedDrawer XAML
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>
@LanceMcCarthy
LanceMcCarthy / ThemeModel.cs
Created Sep 22, 2016
Custom Themeing model for Xamarin Forms' DynamicResource
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;
@LanceMcCarthy
LanceMcCarthy / FadeHeaderBehavior.cs
Last active Dec 1, 2018
Fading ListView or GridView Header
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); }
}
View OnTargetPlatform
public class OnTargetPlatform<T> : OnPlatform<T>
{
public T Windows { get; set; }
public static implicit operator T(OnTargetPlatform<T> onPlatform) => Device.OS == TargetPlatform.Windows ? onPlatform.Windows : (OnPlatform<T>) onPlatform;
}
View ParallaxWithOpacityBehavior.cs
public class ParallaxWithOpacityBehavior : Behavior<FrameworkElement>
{
#region DependencyProperties
/// <summary>
/// Gets or sets the element that will parallax while scrolling.
/// </summary>
public UIElement ParallaxContent
{
get { return (UIElement)GetValue(ParallaxContentProperty); }
You can’t perform that action at this time.