Hi Stephen..

You can bind the Tooltip.TooltipText property of the Textbox to a property
of the ViewModel (assuming MVVM pattern) just like you do for the
TextBox.Text property..

Then you'll have to catch the validation event (or raise the
INotifyPropertyChanged event when validation fails), and put some logic in
the property getter to append the validation error to the textbox..

Hope this helps you on the way.
Grant

On Tue, Sep 14, 2010 at 5:50 PM, Stephen Price <[email protected]>wrote:

> Hey all,
>
> I'm chasing my tail with what I thought would have been fairly trivial to
> do.
>
> Normally with a TextBox, the tooltip shows when you mouse over, and if
> there is a validation error then that tooltip text is replaced with
> the validation error. I'd like to combine the two into a single
> tooltip.
>
> I can't find any examples of this. From memory, tooltips dont use the
> datacontext of the object they are targetting but I think its possible
> to change (I'm sure i've done that before). Anyone done this or seen
> examples?
>
> cheers,
> Stephen
> _______________________________________________
> ozwpf mailing list
> [email protected]
> http://prdlxvm0001.codify.net/mailman/listinfo/ozwpf
>
_______________________________________________
ozwpf mailing list
[email protected]
http://prdlxvm0001.codify.net/mailman/listinfo/ozwpf

Reply via email to