Skip to content

Instantly share code, notes, and snippets.

@garyjohnson
garyjohnson / ExtensionMethods.cs
Created April 22, 2012 14:22
WinRT Reflection Extension Methods
using System;
using System.Reflection;
namespace SharpSerializer
{
public static class ExtensionMethods
{
public static PropertyInfo GetProperty(this Type type, String propertyName)
{
return type.GetTypeInfo().GetDeclaredProperty(propertyName);
@garyjohnson
garyjohnson / gist:2990006
Created June 25, 2012 17:23
Chart Control Example - Infragistics
<igFramework:SampleContainer x:Class="IGDataChart.Samples.Display.Axes.MultipleAxes"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="500" d:DesignWidth="700"
Title="MultipleAxes Page"
xmlns:ig="http://schemas.infragistics.com/xaml"
xmlns:igFramework="clr-namespace:Infragistics.Samples.Framework;assembly=Infragistics.Samples.Framework"
@garyjohnson
garyjohnson / gist:2990211
Created June 25, 2012 17:56
Chart Control Example - Telerik
<UserControl x:Class="Telerik.Windows.Examples.Chart.MultipleYAxes.Example"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:example="clr-namespace:Telerik.Windows.Examples.Chart.MultipleYAxes"
xmlns:telerikQuickStart="clr-namespace:Telerik.Windows.Controls.QuickStart;assembly=Telerik.Windows.Controls"
xmlns:chart="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Charting"
xmlns:charting="clr-namespace:Telerik.Windows.Controls.Charting;assembly=Telerik.Windows.Controls.Charting">
<UserControl.Resources>
<example:ExampleViewModel x:Key="ViewModel" />
@garyjohnson
garyjohnson / gist:2997211
Created June 26, 2012 17:20
Chart Control Example - Telerik - Grid lines for axis
<UserControl x:Class="Telerik.Windows.Examples.ChartView.Palettes.Example"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:chart="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Chart"
xmlns:charting="clr-namespace:Telerik.Charting;assembly=Telerik.Windows.Controls.Chart"
xmlns:chartView="clr-namespace:Telerik.Windows.Controls.ChartView;assembly=Telerik.Windows.Controls.Chart"
xmlns:telerikQuickStart="clr-namespace:Telerik.Windows.Controls.QuickStart;assembly=Telerik.Windows.Controls"
xmlns:vm="clr-namespace:Telerik.Windows.Examples.ChartView.Palettes"
@garyjohnson
garyjohnson / gist:2997549
Created June 26, 2012 18:04
Chart Control Example - Mindscape
<local:ChartDemoBase x:Class="SampleExplorer.LineChartDemo"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:SampleExplorer"
xmlns:ms="http://namespaces.mindscape.co.nz/wpf">
<local:ChartDemoBase.Resources>
<ResourceDictionary>
<ms:DateTimeAxisValueConverter x:Key="DateTimeScale" />
@garyjohnson
garyjohnson / gist:2997566
Created June 26, 2012 18:06
Chart Control Example - Mindscape - Multiple Axis
<local:ChartDemoBase x:Class="SampleExplorer.AlternateAxesDemo"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:SampleExplorer"
xmlns:ms="http://namespaces.mindscape.co.nz/wpf">
<local:ChartDemoBase.DemoContent>
<ms:Chart Title="Alternate Y Axes">
<ms:Chart.Series>
<ms:LineSeries ItemsSource="{Binding Data1}" SeriesBrush="{Binding Palette[0]}" Title="Primary" LineStyle="{StaticResource ShadowLineStyle}" />
<ms:LineSeries ItemsSource="{Binding Data2}" SeriesBrush="{Binding Palette[1]}" YAxisTitle="Secondary" Title="Secondary" LineStyle="{StaticResource ShadowLineStyle}" />
@garyjohnson
garyjohnson / gist:3012249
Created June 28, 2012 16:17
Chart Control Example - Telerik - Alternating Grid Color
<chart:RadCartesianChart.Grid>
<chartView:CartesianChartGrid MajorLinesVisibility="Y" StripLinesVisibility="Y">
<chartView:CartesianChartGrid.YStripeBrushes>
<SolidColorBrush Color="#FFD7D7D7" Opacity="0.3" />
<SolidColorBrush Color="Transparent" />
</chartView:CartesianChartGrid.YStripeBrushes>
</chartView:CartesianChartGrid>
</chart:RadCartesianChart.Grid>
@garyjohnson
garyjohnson / NanoContainer.cs
Created July 31, 2012 01:44
Small IoC Container
using System;
using System.Collections.Generic;
namespace SharkDice
{
public class NanoContainer
{
private readonly Dictionary<Type, object> _registeredDependencies = new Dictionary<Type, object>();
private readonly Dictionary<Type, Type> _registeredTypes = new Dictionary<Type, Type>();
@garyjohnson
garyjohnson / Chart Control Example - Telerik - Custom Individual Bar Colors.xaml
Created September 17, 2012 18:32
Chart Control Example - Telerik - Custom Individual Bar Colors
<chart:RadCartesianChart Name="radChart1" Palette="Metro" VerticalAlignment="Stretch" Margin="0,0,0,10">
<chartView:BarSeries ItemsSource="{Binding MonthRevenues}" ValueBinding="Actual" CategoryBinding="Month" >
<chartView:BarSeries.PointTemplate>
<DataTemplate>
<Rectangle Fill="{Binding Converter={StaticResource detailedInfoToBrushConverter}, ConverterParameter={StaticResource brushes}}"/>
</DataTemplate>
</chartView:BarSeries.PointTemplate>
</chartView:BarSeries>
<chartView:LineSeries ItemsSource="{Binding MonthRevenues}" ValueBinding="Target" CategoryBinding="Month" Stroke="{StaticResource ChartBrush2}" >
<chartView:LineSeries.PointTemplate>
@garyjohnson
garyjohnson / TelerikAnnotations.xaml
Created November 21, 2012 15:20
Telerik Annotations
<UserControl x:Class="Telerik.Windows.Examples.ChartView.Annotations.MicrosoftChart"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="400">
<UserControl.Resources>