Click here to Skip to main content
15,113,692 members
Home / Discussions / WPF
   

WPF

 
AnswerRe: Ad Control / monetization Pin
Pete O'Hanlon18-Dec-18 23:17
mvePete O'Hanlon18-Dec-18 23:17 
GeneralRe: Ad Control / monetization Pin
Super Lloyd19-Dec-18 16:40
MemberSuper Lloyd19-Dec-18 16:40 
AnswerRe: Ad Control / monetization Pin
Gerry Schmitz23-Dec-18 10:02
mveGerry Schmitz23-Dec-18 10:02 
GeneralRe: Ad Control / monetization Pin
Super Lloyd23-Dec-18 10:39
MemberSuper Lloyd23-Dec-18 10:39 
GeneralRe: Ad Control / monetization Pin
Gerry Schmitz28-Dec-18 10:39
mveGerry Schmitz28-Dec-18 10:39 
QuestionValidation in WPF Pin
Kevin Marois18-Dec-18 7:59
professionalKevin Marois18-Dec-18 7:59 
AnswerRe: Validation in WPF Pin
Super Lloyd18-Dec-18 14:09
MemberSuper Lloyd18-Dec-18 14:09 
AnswerRe: Validation in WPF Pin
Gerry Schmitz23-Dec-18 9:57
mveGerry Schmitz23-Dec-18 9:57 
Here's my two extension methods for checking if a property or an IDataErrorInfo object has any errors:
/// <summary>
/// Extension method for IDataErrorInfo.
///
/// Uses reflection to get the properties that can be modified,
/// and validates them using the IDataErrorInfo interface.
///
/// Returns false if no errors.
/// </summary>
public static bool HasErrors( this IDataErrorInfo dataObject ) {

   Type dataObjectType = dataObject.GetType();
   PropertyInfo[] pInfo = dataObjectType.GetProperties( BindingFlags.Public | BindingFlags.Instance );

   foreach ( PropertyInfo p in pInfo ) {
      if ( p.CanWrite ) {
         if ( string.IsNullOrEmpty( dataObject[ p.Name ] ) == false ) {
            return true;   // Error detected.
         }
      }
   }  // end foreach.

   return false;     // No error detected.
}

/// <summary>
/// Validates a single property.
/// </summary>
public static bool HasErrors( this IDataErrorInfo dataObject, string name ) {

   if ( string.IsNullOrEmpty( dataObject[ name ] ) == false ) {
      return true;
   }

   return false;     // No error detected.
}
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal

QuestionI dont now what is the error "{"An ItemsControl is inconsistent with its items source.\n See the inner exception for more information."}" Pin
Rabee3-F1.78754516-Dec-18 3:01
MemberRabee3-F1.78754516-Dec-18 3:01 
AnswerRe: I dont now what is the error "{"An ItemsControl is inconsistent with its items source.\n See the inner exception for more information."}" Pin
Super Lloyd16-Dec-18 16:50
MemberSuper Lloyd16-Dec-18 16:50 
GeneralRe: I dont now what is the error "{"An ItemsControl is inconsistent with its items source.\n See the inner exception for more information."}" Pin
Rabee3-F1.78754517-Dec-18 11:22
MemberRabee3-F1.78754517-Dec-18 11:22 
GeneralRe: I dont now what is the error "{"An ItemsControl is inconsistent with its items source.\n See the inner exception for more information."}" Pin
Super Lloyd17-Dec-18 16:28
MemberSuper Lloyd17-Dec-18 16:28 
AnswerRe: I dont now what is the error "{"An ItemsControl is inconsistent with its items source.\n See the inner exception for more information."}" Pin
Richard Deeming17-Dec-18 10:20
mveRichard Deeming17-Dec-18 10:20 
QuestionI dont now what is the error "{"An ItemsControl is inconsistent with its items source.\n See the inner exception for more information."}" Pin
Rabee3-F1.78754516-Dec-18 2:34
MemberRabee3-F1.78754516-Dec-18 2:34 
QuestionReorder Elements in ScrollViewer/Grid Pin
GenJerDan12-Dec-18 10:38
MemberGenJerDan12-Dec-18 10:38 
AnswerRe: Reorder Elements in ScrollViewer/Grid Pin
Super Lloyd12-Dec-18 19:11
MemberSuper Lloyd12-Dec-18 19:11 
GeneralRe: Reorder Elements in ScrollViewer/Grid Pin
GenJerDan12-Dec-18 20:27
MemberGenJerDan12-Dec-18 20:27 
QuestionBorder With Bound Pulsating Color Pin
Kevin Marois10-Dec-18 6:53
professionalKevin Marois10-Dec-18 6:53 
AnswerRe: Border With Bound Pulsating Color Pin
Super Lloyd12-Dec-18 18:06
MemberSuper Lloyd12-Dec-18 18:06 
QuestionBinding To Single List Item Pin
Kevin Marois27-Nov-18 11:23
professionalKevin Marois27-Nov-18 11:23 
AnswerRe: Binding To Single List Item Pin
Meshack Musundi27-Nov-18 21:17
mvaMeshack Musundi27-Nov-18 21:17 
GeneralRe: Binding To Single List Item Pin
Pete O'Hanlon27-Nov-18 22:03
mvePete O'Hanlon27-Nov-18 22:03 
GeneralRe: Binding To Single List Item Pin
Meshack Musundi27-Nov-18 22:12
mvaMeshack Musundi27-Nov-18 22:12 
GeneralRe: Binding To Single List Item Pin
Pete O'Hanlon27-Nov-18 23:19
mvePete O'Hanlon27-Nov-18 23:19 
GeneralRe: Binding To Single List Item Pin
Meshack Musundi27-Nov-18 22:24
mvaMeshack Musundi27-Nov-18 22:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.