I have a view (parent) that is loading another view (child) as a region. I need to reference a storyboard that is located in the parent view from the child view code behind. Is this possible and how would I do this? Thanks!
Asked
Active
Viewed 29 times
0
-
Why not just make the storyboard a resource and make it available wherever for wherever you need it, especially if it's going to get re-used anyway? – Chris W. Jul 09 '14 at 20:38
1 Answers
0
Try this if you want to:
First: in your parent view (View1) xaml, give a name of your child view like this:
<my:View2 x:Name="MyView2" />
2nd: in your view2.xaml.cs, add property like this:
public View1 MyView1 {get;set;}
3rd: in your view1.xaml.cs, set the property of step 2 in your constructor:
View2 v = MyView2 as View2;
if (v != null)
v.MyView1 = this;

Kenny Yu
- 33
- 5