1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Data;
- using System.Windows.Media;
- namespace CyberX8_MainPages.Converters
- {
- public class MiddleStatusToColor : IValueConverter
- {
- public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
- {
- if(value==null)
- {
- return new SolidColorBrush(Colors.Gray);
- }
- else
- {
- int status = (int)value;
- if(status==1)
- {
- return new SolidColorBrush(Colors.Lime);
- }
- else if(status==0)
- {
- return new SolidColorBrush(Colors.Gray);
- }
- else
- {
- return new SolidColorBrush(Colors.Yellow);
- }
- }
- }
- public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
- {
- return null;
- }
- }
- }
|