<p>I have a basic form with controls that are databound to an object implementing the <em>INotifyPropertyChanged</em> interface.  I would like to add some validation to a couple of properties but dont want to go through implementing <em>IDataErrorInfo</em> for the sake of validating a couple of properties.</p>

<p>I have created the functions that perform the validation and return the error message (if applicable) in the object.  What I would like to do is call these functions from my form when the relevant properties on the object have changed, and setup the <em>ErrorProvider</em> control in my form with any error messages that have been returned from the validation functions.</p>

<p>I have tried hooking up event handlers to the Validating and LostFocus events, but these seem to fire before my object is updated, and hence they are not validating the correct data.  Its only when I leave the textbox, go back in and then leave again that the validation runs against the correct data.</p>

<p>Is there another event that I can hook into so that I can call these validation functions after the property on my object has been updated?  Or am I better off just implementing the <em>IDataErrorInfo</em> interface?</p>

[{'answer_id': 63085, 'author': 'Phil Wright', 'author_id': 6276, 'author_profile': 'https://Stackoverflow.com/users/6276', 'pm_score': 0, 'selected': False, 'text': '<p>Have you tried drawing a white rectangle to initialize the image before you call the DrawImage method?</p>\n'}, {'answer_id': 63371, 'author': 'solsberg2', 'author_id': 7040, 'author_profile': 'https://Stackoverflow.com/users/7040', 'pm_score': 0, 'selected': False, 'text': '<p>The whole point is that I need the line-drawn graphics behind the image to be visible. I did try filling the rectangle first the with RGBA color of (255, 255, 255, 0) but this does not help. Pixels with an alpha value of zero do get printed as fully transparent but partially transparent pixels are drawn fully opaque.</p>\n'}, {'answer_id': 236901, 'author': 'codeguru', 'author_id': 31476, 'author_profile': 'https://Stackoverflow.com/users/31476', 'pm_score': 1, 'selected': False, 'text': "<p>What kind of printer is that? Regular printers don't print white. Create in-memory image and 'flatten' it (remove alpha channel) and then print the result.</p>\n"}, {'answer_id': 9164488, 'author': 'Coder_Dan', 'author_id': 449295, 'author_profile': 'https://Stackoverflow.com/users/449295', 'pm_score': 0, 'selected': False, 'text': "<p>Thanks for asking this question because I was just thinking of perhaps trying to use GDIplus to see whether it could get me around the problems I'm still facing getting patterned diamond shapes to print correctly.  Although nowadays alpha-blending does appear to work on most printers, there are still some that draw black corners on the diamonds.</p>\n\n<p>Aside from alpha-blending, I've also tried using diamond-shaped clip regions to surround the shape, but normally the printers that don't support alpha-blending don't seem to support polygonal clip-regions either.  I've tried copying from the printer-dc into a bitmap to prime it before drawing the diamond on top, hoping that this will allow me to put back (in the corners) what was there before.  This doesn't work either because it appears that the problem boils down to the fact that the printer driver doesn't actually know what is being printed on what part of the page.</p>\n\n<p>In my case, my next plan is to try using a large bitmap brush for drawing the diamond fill directly to the printer hdc.  I suspect there's a moderate chance that this too will fail for certain printers.  It sounds like it may not be an option for what you were doing.</p>\n"}]
['https://Stackoverflow.com/questions/62686', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/6165/']