This file contains hidden or 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
/// <summary> | |
/// Forces a new line in a <see cref="WrapPanel"/> | |
/// </summary> | |
public class WrapPanelLineBreak : FrameworkElement { | |
public WrapPanelLineBreak() { | |
Height = 0; | |
var binding = new Binding { | |
RelativeSource = new RelativeSource(RelativeSourceMode.FindAncestor, typeof(WrapPanel), 1), | |
Path = new PropertyPath("ActualWidth") | |
}; |
This file contains hidden or 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
using System; | |
using System.Globalization; | |
using System.Windows; | |
using System.Windows.Data; | |
namespace Converter | |
{ | |
public class DoubleCompareConverter : IValueConverter | |
{ |
This file contains hidden or 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
[SuppressMessage("ReSharper", "VirtualMemberNeverOverridden.Global", Justification = "Public API")] | |
[SuppressMessage("ReSharper", "UnusedMember.Global", Justification = "Public API")] | |
public class NotifyPropertyChangedBase : INotifyPropertyChanged { | |
/// <summary> | |
/// Sets a backing field value and if it's changed raise a notification. | |
/// </summary> | |
/// <typeparam name="T">The type of the value being set.</typeparam> | |
/// <param name="oldValue">A reference to the field to update.</param> | |
/// <param name="newValue">The new value.</param> |
This file contains hidden or 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
<d:DesignProperties.DataContext> | |
<$ViewModel$ /> | |
</d:DesignProperties.DataContext> | |
d:DataContext="{d:DesignInstance Type=$ViewModel$, IsDesignTimeCreatable=False}" |
This file contains hidden or 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
// http://jake.ginnivan.net/pack-uri-in-unit-tests/ | |
PackUriHelper.Create(new Uri("reliable://0")); // register pack-uri |
This file contains hidden or 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
// Source: https://gist.github.com/SchreinerK/73002d709fe6ee365cd3d7b43186300c#file-mockservices-cs | |
// Version: 1.6 | |
using System; | |
using System.Collections.Generic; | |
using System.Reflection; | |
using System.Runtime.Serialization; | |
// ReSharper disable LocalizableElement | |
// ReSharper disable CheckNamespace |
This file contains hidden or 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
var dpd = DependencyPropertyDescriptor.FromProperty(TextEditor.IsModifiedProperty, typeof(TextEditor)); | |
dpd.AddValueChanged(_textEditor, TextEditor_IsModifiedChanged); | |
dpd.RemoveValueChanged(_textEditor, TextEditor_IsModifiedChanged); |
This file contains hidden or 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 static string GenerateFullTypeName(Type type) | |
{ | |
var retType = new StringBuilder(); | |
if (type.IsGenericType) | |
{ | |
var parentType = type.FullName.Split('`'); | |
var arguments = type.GetGenericArguments(); | |
var argList = new StringBuilder(); |