I am new to the WPF development.
I am developing a wpf application using MVVM pattern. I had a ‘ComboBox’ and a ‘TextBlock’ controls. On getting focus over ComboBox, the Textblock should display the tool tip of the Combobox. Combobox is binded to view model.
<ComboBox Name="cmbSystemVoltage"
ToolTip="RMS value of phase-phase voltage in kV"
ItemsSource="{Binding Path=SystemVoltageStore}"
SelectedItem="{Binding Path=SelectedSystemVoltage}"
DisplayMemberPath="SystemVoltageLevel"/>
How can I achieve this. Sample code to do so will be much helpful.
Thanks,
Sudhi
Use a
DataTriggerand bind perElementName:EDIT
If you want to show tooltip of multiple controls in a
TextBlockI would rather subscribe toPreviewGotKeyboardFocus Event:.