示例#1
0
 public AccountItemViewModel(ItemInfoModel item)
 {
     _item    = item;
     ItemImg  = PublicMathods.GetImage(item.IconName);
     ItemName = item.ItemName;
     ChangeSelecState(false);
 }
        public void ChangeSelectState(bool isSelected)
        {
            ImgBkg      = isSelected ? _recordColor : GlobalVariables.MainBackColor;
            FontColor   = isSelected ? GlobalVariables.MainBackColor : Colors.Black;
            AmountColor = isSelected ? GlobalVariables.MainBackColor : _recordColor;
            string iconPath;

            switch (_statisticType)
            {
            case StatisticTypeEnum.ClassFee:
                iconPath = isSelected ? GlobalVariables.ClassPaymentIconPressed : GlobalVariables.ClassPaymentIcon;
                break;

            case StatisticTypeEnum.TeacherFee:
                iconPath = isSelected ? GlobalVariables.TeacherFeeIconPressed : GlobalVariables.TeacherFeeIcon;
                break;

            default:
                iconPath = isSelected ?
                           ItemManagementBussiness.Instance.Items.Where(i => i.ItemID == _normalAccount.ItemID).First().IconNamePressed :
                           ItemManagementBussiness.Instance.Items.Where(i => i.ItemID == _normalAccount.ItemID).First().IconName;
                break;
            }
            Img          = PublicMathods.GetImage(iconPath);
            VisOperation = isSelected ? Visibility.Visible : Visibility.Hidden;
        }
示例#3
0
 public void ChangeSelecState(bool isSelected)
 {
     ItemColor     = isSelected ? (_item.IsIncome ? GlobalVariables.IncomeColor : GlobalVariables.ExpenseColor) : GlobalVariables.MainBackColor;
     ItemForeColor = isSelected ? GlobalVariables.MainBackColor : (_item.IsIncome ? GlobalVariables.IncomeColor : GlobalVariables.ExpenseColor);
     ItemImg       = PublicMathods.GetImage(isSelected ? _item.IconNamePressed : _item.IconName);
 }