Sandkassa2

From Maria GDK Wiki
Revision as of 14:07, 3 August 2022 by Mbu (talk | contribs)
Jump to navigation Jump to search

Tester syntaxhighlight....

using System;
using System.Globalization;
using System.Windows.Data;
using TPG.GDK.Windows.Common;

namespace MariaGDKTester
{
    public class ColorConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var cColor = (TPG.GDK.CommonCore.Primitives.Color)value;
            return Utils.ToWinColor(cColor);
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var wColor = (System.Windows.Media.Color)value;
            return Utils.FromWinColor(wColor);
        }
    }
}