public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
        {
            string selectedContent;
            bool   isSelectedAndCopied, isSelected;

            SelectionHelper.Initialize(values, out selectedContent, out isSelectedAndCopied, out isSelected);

            var selectedBrush       = new SolidColorBrush(Colors.LightYellow);
            var selectedCopiedBrush = new SolidColorBrush(Colors.LightGreen);
            var notSelectedBrush    = new SolidColorBrush(Colors.White);

            if (selectedContent == null)
            {
                return(notSelectedBrush);
            }

            if (isSelectedAndCopied)
            {
                return(selectedCopiedBrush);
            }

            if (isSelected)
            {
                return(selectedBrush);
            }

            return(notSelectedBrush);
        }
Пример #2
0
        public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
        {
            string selectedContent;
            bool   isSelectedAndCopied, isSelected;

            SelectionHelper.Initialize(values, out selectedContent, out isSelectedAndCopied, out isSelected);

            return(!isSelectedAndCopied ? null : "Copied");
        }