Find the ScrollViewer which contains a Canvas froom within the Canvas instance

Clash Royale CLAN TAG#URR8PPPFind the ScrollViewer which contains a Canvas froom within the Canvas instance
I have a class which extends Canvas in WPF.
Canvas
This class is placed in a ScrollViewer.
ScrollViewer
Without passing a specific reference to the ScrollViewer into the Canvas, I want to find the ScrollViewer which contains the Canvas from within the Canvas itself.
ScrollViewer
Canvas
ScrollViewer
Canvas
Canvas
The Parent property of the class which extends Canvas is null, and every attempt to use the VisualTreeHelper just returns null as well.
Parent
Canvas
null
VisualTreeHelper
null
Is this possible to achieve?
Example Code:
cs -
public class ExtendedCanvas:Canvas {
//I wish to automatically populate this scroll viewer
//reference to the instance of the scrollviwer which contains
//this ExtendedCanvas instance
private ScrollViewer _containingScrollViewer = null;
}
xaml -
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto" >
<local:ExtendedCanvas x:Name="extendedCanvas" />
</ScrollViewer>
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
Perhaps the person who downvoted this could suggest what I could add to make this a more acceptable question?
– Alex
36 secs ago