|
- using BPA.Message.Enum;
- using System;
- using System.Collections.Generic;
- using System.Globalization;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Data;
- using System.Windows.Media;
-
- namespace BPASmartClient.CustomResource.Converters
- {
- public class ColorConverter : IValueConverter
- {
- public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
- {
- SolidColorBrush returnValue = new SolidColorBrush(Color.FromArgb(255, 0, 204, 255));
- switch ((ORDER_STATUS)value)
- {
- case ORDER_STATUS.WAIT:
- returnValue = new SolidColorBrush(Color.FromArgb(255, 0, 204, 255));
- break;
- case ORDER_STATUS.COOKING:
- returnValue = new SolidColorBrush(Color.FromArgb(255, 0, 255, 127));
- break;
- case ORDER_STATUS.COMPLETED_COOK:
- returnValue = new SolidColorBrush(Color.FromArgb(255, 255, 215, 00));
- break;
- case ORDER_STATUS.COMPLETED_TAKE:
- returnValue = new SolidColorBrush(Color.FromArgb(255, 102, 204, 153));
- break;
- case ORDER_STATUS.ERR_NOT_REPLY_WHEN_COOKING:
- returnValue = new SolidColorBrush(Color.FromArgb(255, 255, 0, 0));
- break;
- default:
- break;
- }
- return returnValue;
- }
-
- public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
- {
- throw new NotImplementedException();
- }
- }
- }
|