Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

Tooltip binding

$
0
0

Hello,


I have a simple app, mvvm style, and on a usercontrol i have to display some data, that is inthe form of a name, value and description. This will be displayed in a label, textbox and tooltip.

The problem i'm facing is that i also want to display validation error in the tooltip, is there a way to have something like:

<Label Content="Email:" /><TextBox x:Name="emailTextBox" Text="{Binding Email}"><TextBox.ToolTip><StackPanel><TextBlock Text="{Binding Tooltip.Email.Description}" /><TextBlock Text="{Binding Path=(Validation.Errors)[0].ErrorContent, ElementName=emailTextBox}" /></StackPanel></TextBox.ToolTip></TextBox>

Email and Tooltip are properties in my viewmodel.

Thanks



Frederico Regateiro


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>