This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MoreObservableCollection<T> : ObservableCollection<T> | |
{ | |
public MoreObservableCollection() | |
: base() | |
{ | |
CollectionChanged += new NotifyCollectionChangedEventHandler(ObservableCollection_CollectionChanged); | |
} | |
public MoreObservableCollection(IEnumerable<T> collection) | |
: base(collection) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class BoolToInvisibilityConverter : IValueConverter | |
{ | |
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) | |
{ | |
bool isInvisible = (bool)value; | |
if (BoolToVisibilityConverter.IsVisibilityInverted(parameter)) | |
isInvisible = !isInvisible; | |
return (isInvisible ? Visibility.Collapsed : Visibility.Visible); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public sealed class StringFormatConverter : IValueConverter | |
{ | |
public object Convert(object value, Type targetType, object parameter, string language) | |
{ | |
if (value == null) | |
return null; | |
if (parameter == null) | |
return value; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Style TargetType="controls:Clock"> | |
<Setter Property="Template"> | |
<Setter.Value> | |
<ControlTemplate TargetType="controls:Clock"> | |
<TextBlock Text="{Binding DateTime, | |
StringFormat=T, | |
RelativeSource={RelativeSource TemplatedParent}}" /> | |
</ControlTemplate> | |
</Setter.Value> | |
</Setter> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\*{2}(?<Year>\d{4})\*{2}\r?\n\r?\n(?<Read>- \*{2}(?<Day>\d{1,2})-(?<Month>\w{3})\*{2} (?<Title>.*) by (?<Author>.*)\r\n)+ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@font-face { | |
font-family: 'FontAwesome'; | |
src: url("/blog/font/fontawesome-webfont.eot"); | |
src: url("/blog/font/fontawesome-webfont.eot?#iefix") format("embedded-opentype"), | |
url("/blog/font/fontawesome-webfont.woff") format("woff"), | |
url("/blog/font/fontawesome-webfont.ttf") format("truetype"), | |
url("/blog/font/fontawesome-webfont.svgz#FontAwesomeRegular") format("svg"), | |
url("/blog/font/fontawesome-webfont.svg#FontAwesomeRegular") format("svg"); | |
font-weight: normal; | |
font-style: normal; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% gist 92b3fce859806a435a96 %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class PercentageConverter : IValueConverter | |
{ | |
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) | |
{ | |
var fraction = decimal.Parse(value.ToString()); | |
return fraction.ToString("P1"); | |
} | |
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ListBox ItemsSource="{Binding List}" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface IObservableContainerItem<T> | |
{ | |
T Observed { get; set; } | |
} |
OlderNewer