Exemplo n.º 1
0
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            try
            {
                if (!(value is LiveLogViewModel.StatusType))
                {
                    throw new ArgumentException("Value is not of type  LiveLogViewModel.StatusType");
                }

                LiveLogViewModel.StatusType statusType = (LiveLogViewModel.StatusType)value;

                var Theme = new ResourceDictionary();
                Theme.Source = new Uri("pack://application:,,,/Makeathon;component/Theme.xaml",
                                       UriKind.RelativeOrAbsolute);

                if (statusType == LiveLogViewModel.StatusType.ERROR)
                {
                    return(new SolidColorBrush((Color)Theme["MsgErrorForegroundColor"]));
                }
                else
                {
                    return(new SolidColorBrush((Color)Theme["MainAccentColor"]));
                }
            }
            catch (Exception ex)
            {
            }
            return(null);
        }
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            try
            {
                if (!(value is LiveLogViewModel.StatusType))
                {
                    throw new ArgumentException("Value is not of type  LiveLogViewModel.StatusType");
                }

                LiveLogViewModel.StatusType statusType = (LiveLogViewModel.StatusType)value;

                if (statusType == LiveLogViewModel.StatusType.ERROR)
                {
                    return("Error");
                }
                else if (statusType == LiveLogViewModel.StatusType.READY)
                {
                    return("Ready");
                }
                else if (statusType == LiveLogViewModel.StatusType.BUSY)
                {
                    return("Busy");
                }
            }
            catch (Exception ex)
            {
            }
            return(null);
        }
Exemplo n.º 3
0
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            try
            {
                if (!(value is LiveLogViewModel.StatusType))
                {
                    throw new ArgumentException("Value is not of type  LiveLogViewModel.StatusType");
                }

                LiveLogViewModel.StatusType statusType = (LiveLogViewModel.StatusType)value;

                if (statusType == LiveLogViewModel.StatusType.BUSY)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception ex)
            {
            }
            return(false);
        }