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
private static double GetStringWidth(string text, Control control) | |
{ | |
Typeface typeface = new Typeface(control.FontFamily, control.FontStyle, control.FontWeight, control.FontStretch); | |
GlyphTypeface glyphTypeface; | |
if (!typeface.TryGetGlyphTypeface(out glyphTypeface)) | |
throw new InvalidOperationException("No glyph typeface found"); | |
double size = control.FontSize; |
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 class SimpleCommand<T> : ICommand | |
{ | |
public Predicate<T> CanExecuteDelegate { get; set; } | |
public Action<T> ExecuteDelegate { get; set; } | |
#region ICommand Members | |
public bool CanExecute(object parameter) | |
{ | |
if (CanExecuteDelegate != null) |