Multiple choice technology web technology

What is the use of RelativeSource

  1. To set the source of the style

  2. To define a binding in a style or template

  3. To avoid binding source conflict

  4. To set multiple source for a single control

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

RelativeSource is a MarkupExtension in WPF/XAML binding that allows you to define bindings relative to the target element, particularly useful within styles and templates. It enables binding to the element itself (Self), its parent/ancestor types, or previous data items. Options A, C, and D describe incorrect purposes. RelativeSource is specifically designed to define bindings in styles/templates where the source cannot be directly specified.