mirror of
https://github.com/VitalickS/BrightSharp.Toolkit.git
synced 2026-03-21 10:21:16 +00:00
35 lines
901 B
C#
35 lines
901 B
C#
using System;
|
|
using System.ComponentModel;
|
|
using System.Globalization;
|
|
using System.Windows;
|
|
using System.Windows.Controls;
|
|
using System.Windows.Data;
|
|
|
|
namespace BrightSharp.Diagrams
|
|
{
|
|
|
|
[ToolboxItem(false)]
|
|
public class SizeChrome : Control
|
|
{
|
|
static SizeChrome()
|
|
{
|
|
DefaultStyleKeyProperty.OverrideMetadata(typeof(SizeChrome), new FrameworkPropertyMetadata(typeof(SizeChrome)));
|
|
}
|
|
}
|
|
|
|
public class DoubleFormatConverter : IValueConverter
|
|
{
|
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
double d = (double)value;
|
|
if (double.IsNaN(d)) return "(Auto)";
|
|
return Math.Round(d);
|
|
}
|
|
|
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
return null;
|
|
}
|
|
}
|
|
}
|