Skip to content

Instantly share code, notes, and snippets.

@iburlakov
iburlakov / MainWindow.xaml
Created July 17, 2013 16:48
How to show custom template for ListView when it has no items to show.
<Window x:Class="TabControlExp.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
@iburlakov
iburlakov / PathEllipsisConverter.cs
Created June 25, 2013 13:20
Ellipsis path by replacing path parts with some ellipsis const, ... in this particular case.
using System;
using System.IO;
using System.Linq;
using System.Windows.Data;
namespace Converters
{
public class PathEllipsisConverter : IValueConverter
{
private const string EllipsisChars = "...";
@iburlakov
iburlakov / ArbitraryShapeForm.xaml
Created February 22, 2013 13:53
WPF form of arbitrary shape
<Window x:Class="Test.ArbitraryShapeForm"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="ArbitraryShapeForm"
AllowsTransparency="True"
Background="Transparent"
WindowStyle="None">
<Canvas Width="300" Height="300">
<Path Stroke="Gray" StrokeThickness="2">
@iburlakov
iburlakov / CFDictionaryGetValueIfPresent_Sample.c
Created September 27, 2012 19:18
Using of CFDictionaryGetValueIfPresent
CFDictionaryRef dict;
/*
Get some dictionary...
*/
SInt32 intVal = 0;
CFNumberRef cfIntVal;
char* strVal;
CFStringRef cfStrVal;
@iburlakov
iburlakov / Foo.cs
Created December 30, 2011 08:12
Determimes a caller of a method
public class Foo
{
public void Do(int bar, string baz)
{
Console.WriteLine(GetCallerMethodName());
}
public void Do(int bar)
{
this.Do(bar, null);
@iburlakov
iburlakov / LimitFormatter.h
Created August 2, 2011 07:39
Simple implementation of NSFormatter class.
#import <Foundation/Foundation.h>
@interface LimitFormatter : NSFormatter {
}
@property int maxLength;
@end