public object Convert(object value, System.Type targetType, object parameter, System.Globalization.CultureInfo culture) { var pu = value as ProfileUser; if (pu != null) { return(OperatorManager.GetByGuId(pu.User_ID)); } return(null); }
// name of this method MUST match the naming: Get{PropertyName} public static Operator GetUser(UIElement element) { var dtx = element.DataContext as ProfileUser; if (dtx == null) { return(null); } return(OperatorManager.GetByGuId(dtx.User_ID)); // this is it! }