(X) Hide this
    • Login
    • Join
      • Say No Bots Generate New Image
        By clicking 'Register' you accept the terms of use .
        Login with Facebook

Watermarked Textbox Part II

(1 votes)
3 comments   /   posted by Phil Middlemiss on Mar 05, 2010
Tags:   silverlight , expression-blend , watermark , textbox
Part II of the tutorial of Phil Middlemiss on building a Watermarked Textbox control is now here. In the first post Phil created the visual elements for the WatermarkedTextbox user control.

Watermarked Textbox imageIn Part II we finish defining the visual elements, and create the animations for the various states the control requires

Comments

  • -_-

    RE: Watermarked Textbox Part II


    posted by SilverFan on Mar 06, 2010 16:07
    The implementation is wrong for multiple reasons.

    1)It should be a control (not usercontrol) so it can be fully customizable.The user cant customize the watermark textblock, the clear button etc.
    Can i localize the button tooltip? no
    Can i change the watermark textblock style? no
    It could even be a TextBox.
    A watermark textbox IS a textbox!!
    2)Following the first every part and state should be documented in the class the way every silverlight control is designed.
    3)It should provide events for pretty much everything (textchanged ,watermarkchanged, clear clicked etc) alongside the MVVM ICommand aproach cause not everybody uses the pattern.
    4)The implementation does not respect bindings.
    The text is not bound to the textbox so it wont validate! if an exception is thrown from the source.No templatebindings also for various properties because its not a stylable control!

    All in all bad impl.I suggest u read more about silvelight and most importantly read good silverlight code from the sl toolkit source code.
  • -_-

    RE: Watermarked Textbox Part II


    posted by micaleel on Mar 15, 2010 13:36
    SiverFan, please back off! There is nothing constructive about your critism, please try to provide positive contributions next time.
  • PhilM

    RE: Watermarked Textbox Part II


    posted by PhilM on Sep 03, 2010 12:52

    SilverFan,

    The article was two parts. In the first part I said I was going to do both a UserControl and a CustomControl. I did the UserControl first because it was the easiest. The context was for a one off application that didn't need re-use.

    The article for the CustomControl version can be found here and resolves all the issues that you would expect a proper control to handle. The source code is free so feel free to download and improve it yourself. Perhaps that way you can make a contribution.

Add Comment

Login to comment:
  *      *       
Login with Facebook

Our News on Twitter