Skip to content

Instantly share code, notes, and snippets.

View ceee's full-sized avatar

tobi ceee

View GitHub Profile
@ceee
ceee / CustomExportType.cs
Last active July 13, 2017 09:24
Fixed FormRecordSearcher (Umbraco.Forms) so used methods are public
using System;
using Umbraco.Core;
using Umbraco.Forms.Core;
using Umbraco.Forms.Web.BusinessLogic;
using Umbraco.Forms.Web.Models.Backoffice;
namespace MyNamespace
{
public class CustomExportType : ExportType
{
@ceee
ceee / test.cs
Last active January 30, 2016 11:57
Live Tile Bug, Windows 10 (10586)
TileUpdater updater = TileUpdateManager.CreateTileUpdaterForApplication();
string xml = @"
<tile>
<visual>
<binding template='TileMedium' branding='none'>
<image placement='peek' src='http://placehold.it/400x400' />
<image hint-overlay='40' placement='background' src='http://placehold.it/300x300' />
<text hint-wrap='true'>Test test test</text>
</binding>
@ceee
ceee / gauge-style.xaml
Created December 31, 2014 09:48
Gauge in WinRT
<Style x:Key="Gauge" TargetType="controls:Gauge">
<Setter Property="FontFamily" Value="Segoe WP" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="controls:Gauge">
<Viewbox>
<Grid x:Name="Container" Height="200" Width="200">
<Path Name="PART_Scale" Stroke="{TemplateBinding ScaleBrush}" StrokeThickness="{TemplateBinding ScaleWidth}" />
<Path Name="PART_Trail" Stroke="{TemplateBinding TrailBrush}" StrokeThickness="{TemplateBinding ScaleWidth}" />
@ceee
ceee / gist:b40df3169435abd40a2c
Created August 19, 2014 12:35
Launch store in WinRT
// navigate to store (details of app) page
await Windows.System.Launcher.LaunchUriAsync(new Uri("ms-windows-store:navigate?appid=" + CurrentApp.AppId));
// navigate to review page
await Windows.System.Launcher.LaunchUriAsync(new Uri("ms-windows-store:reviewapp?appid=" + CurrentApp.AppId));
IReadOnlyList<StorageFolder> artistFolders = await KnownFolders.MusicLibrary.GetFoldersAsync();
IEnumerable<Task> tasks = artistFolders.Select(artistFolder => TraverseFolderForFolders(artistFolder));
await Task.WhenAll(tasks);
@ceee
ceee / AudioBackgroundTask.cs
Created July 17, 2014 15:42
Memory efficient TTS background audio in WinRT
using Newtonsoft.Json;
using Poki.Utilities;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Xml.Linq;
@ceee
ceee / MainPage.xaml
Created June 16, 2014 20:14
Render UIElement to PNG
<Page
x:Class="BitmapToPNGTest.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:BitmapToPNGTest"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
public static Uri SaveTile(UserControl control, string filename, double width, double height)
{
string path = tileFolder + filename + ".png";
bool success = true;
Deployment.Current.Dispatcher.BeginInvoke(() =>
{
control.Width = width;
control.Height = height;
control.Measure(new Size(width, height));
@ceee
ceee / gist:7696667e10501a5a2ed1
Created May 19, 2014 08:17
loading control layout (Poki)
<Grid x:Name="LayoutRoot" Width="37" Height="42" Visibility="Collapsed" Opacity="0">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup>
<VisualState x:Name="DefaultState">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="LayoutRoot" Storyboard.TargetProperty="Visibility"
BeginTime="0:0:0.2">
<DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Collapsed"/>
</ObjectAnimationUsingKeyFrames>
<DoubleAnimation Storyboard.TargetName="LayoutRoot" Storyboard.TargetProperty="Opacity"
<phone:Panorama.TitleTemplate>
<DataTemplate>
<!-- You have to assign a width here as the Canvas has no impact on the layout, and therefore it won't stretch the Grid to match it's siblings width.
As the Grid has a calculated width of 0 in your code example, it will get repeated faster (which is visible to you). The problem with the TitleTemplate is, that you can't set HorizontalAlignment="Stretch" (for 100% width), as it won't work here :-S
If you increase the Width, the Logo will move faster, therefore you will get a faster parallax movement -->
<Grid Margin="0,34,0,0" Width="240" Height="134.218">
<!-- I have also removed the Canvas Background, as it won't work anymore with the added width. Just set a Background for the Panorama itself, this will get around this issue (Panorama.Background) -->
<Canvas x:Name="DivvyLogoBranding">
<Path Data="F1M0,0L0,73.195 25.669,0z"
Fill="#FF