diff options
| author | Roy <roy.mail.net@gmail.com> | 2018-02-09 13:41:58 +0200 |
|---|---|---|
| committer | Roy <roy.mail.net@gmail.com> | 2018-02-09 13:41:58 +0200 |
| commit | c8c9606e545f49aae3d9f0524775436adbdf27e9 (patch) | |
| tree | 83d9fe870f652058af96f32b7159186f5b80f491 /Software/Visual_Studio/Tango.Visuals/Converters | |
| parent | bfcefc0cf95f3b8d5243908753129c79bad8dc8b (diff) | |
| download | Tango-c8c9606e545f49aae3d9f0524775436adbdf27e9.tar.gz Tango-c8c9606e545f49aae3d9f0524775436adbdf27e9.zip | |
Added my Controls Library !
Implemented Tech VU Item.
Diffstat (limited to 'Software/Visual_Studio/Tango.Visuals/Converters')
3 files changed, 73 insertions, 0 deletions
diff --git a/Software/Visual_Studio/Tango.Visuals/Converters/BooleanToVisibilityConverter.cs b/Software/Visual_Studio/Tango.Visuals/Converters/BooleanToVisibilityConverter.cs new file mode 100644 index 000000000..8c16aa8b0 --- /dev/null +++ b/Software/Visual_Studio/Tango.Visuals/Converters/BooleanToVisibilityConverter.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Data; + +namespace Tango.Visuals.Converters +{ + internal class BooleanToVisibilityConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + return (bool)value ? Visibility.Visible : Visibility.Collapsed; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/Software/Visual_Studio/Tango.Visuals/Converters/DoubleTunerConverter.cs b/Software/Visual_Studio/Tango.Visuals/Converters/DoubleTunerConverter.cs new file mode 100644 index 000000000..07bd0cb57 --- /dev/null +++ b/Software/Visual_Studio/Tango.Visuals/Converters/DoubleTunerConverter.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Data; + +namespace Tango.Visuals.Converters +{ + internal class DoubleTunerConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) + { + double add = System.Convert.ToDouble(parameter.ToString()); + double num = System.Convert.ToDouble(value.ToString()); + + return num + add; + } + + public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/Software/Visual_Studio/Tango.Visuals/Converters/NullToVisibilityConverter.cs b/Software/Visual_Studio/Tango.Visuals/Converters/NullToVisibilityConverter.cs new file mode 100644 index 000000000..a21585b91 --- /dev/null +++ b/Software/Visual_Studio/Tango.Visuals/Converters/NullToVisibilityConverter.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Data; + +namespace Tango.Visuals.Converters +{ + internal class NullToVisibilityConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + return value != null ? Visibility.Visible : Visibility.Collapsed; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} |
