Closed myusrn closed 11 years ago
The Parent of the UC wouldn't necessarily be the root SettingsFlyout element, but rather the container in the control template that houses it. You could walk the visual tree to find the ancestor that you want.
Thanks for response. I guess the issue is that if the this.Parent and VisualTreeHelper.GetParent(this) both return null then walking up the visual tree is not going to be possible. Am I perhaps overlooking some other property that supports walking up the tree?
You just have to find the right tree element. Using Callisto you could do:
SettingsFlyout sf = this.Ancestors<SettingsFlyout>().FirstOrDefault() as SettingsFlyout;
sf.IsOpen = false;
is there a way i can I access the callisto SettingsFlyout from SettingsFlyout.Content [ UserControl ]?
I was using (this.Parent as SettingsFlyout) but that is null sometimes and not other times.
I'm looking to do something like this from withing the settings flyout user control submit button handler.
(this.Parent as SettingsFlyout).IsOpen = false
similar to how in an html/js settings flyout I would execute SettingsFlyoutDiv.winControl.hide();