Rajanikant Hawaldar
Why and when do we use relativesource in WPF?
By Rajanikant Hawaldar in C# on Dec 18 2020
  • Shweta Lodha
    Jan, 2021 17

    Below are the uses Of Relativesource That I Know Of In Wpf:

    – Getting An Ancestor’S Property:

    {Binding Path=Pathtoproperty,
    Relativesource={Relativesource Ancestortype={X:Type Typeofancestor}}}
    – Binding To Another Property On The Object:

    {Binding Path=Pathtoproperty, Relativesource={Relativesource Self}}
    – Bind To A Property On The Templated Parent:

    {Binding Path=Pathtoproperty, Relativesource={Relativesource Templatedparent}}
    Or
    {Templatebinding Path=Pathtoproperty}

    Original link

    • 2
  • Shweta Lodha
    Jan, 2021 17


Most Popular Job Functions


MOST LIKED QUESTIONS