aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Converters/TransitionLinkConverter.cs
blob: d67f3a25936b61449e238a56b8ca71ac23d2eaaa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;

namespace Tango.MachineStudio.Technician.Converters
{
    /// <summary>
    /// Binding converter for converting TransitionControl child Tag to text style.
    /// </summary>
    /// <remarks>
    /// This converter is used by the patient page tabs, changing the selected tab text style to bold/normal.
    /// </remarks>
    public class TransitionLinkConverter : IValueConverter
    {
        /// <summary>
        /// Converts a ContentControl to font style.
        /// </summary>
        /// <param name="value">Content control.</param>
        /// <param name="targetType"></param>
        /// <param name="parameter"></param>
        /// <param name="culture"></param>
        /// <returns>Font style.</returns>
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            ContentControl control = value as ContentControl;

            if (control != null && control.Tag != null && control.Tag.ToString().ToLower() == parameter.ToString().ToLower())
            {
                return FontWeights.Bold;
            }
            else
            {
                return FontWeights.Normal;
            }
        }

        /// <summary>
        /// Not Implemented.
        /// </summary>
        /// <param name="value"></param>
        /// <param name="targetType"></param>
        /// <param name="parameter"></param>
        /// <param name="culture"></param>
        /// <returns></returns>
        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            return value;
        }
    }
}