//=============================================================================== // Goal Book. // Copyright © 2009 Mark Brownsword. //=============================================================================== #region Using Statements using System; using System.Collections.Generic; using System.Windows.Data; #endregion namespace GoalBook.Infrastructure.Converters { /// <summary> /// Value Converter for object model item foreign keys. /// </summary> public class BoolToPendingConverter : IValueConverter { private readonly string PENDING_IMAGE_URI = Constants.MenuConstants.MENU_SYNCHRONISE_IMAGE_URI; #region IValueConverter Members /// <summary> /// Convert ID to Lookup Value. /// </summary> public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { string returnValue = string.Empty; bool result = false; if (bool.TryParse(value.ToString(), out result) && result) { returnValue = PENDING_IMAGE_URI; } return returnValue; } public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { return value.ToString() == PENDING_IMAGE_URI ? true : false; } #endregion } }
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.
This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)