如何从子框架控制网格的可见性?
How to control the visibility of a grid from child frame?
我是 UWP 的新手,当我单击框架内的按钮时,我需要在父级按钮的顶部打开一个屏幕 page.I 已将网格放入框架内并且它有效但打开的页面不是全屏。所以我需要将网格放在父页面上,以便打开(可能改变可见性)处于全屏状态。无论如何要从框架内部访问父元素?我试过从框架调用父函数并执行它,但网格可见性不是 changed.Any idea?
在父页面的构造函数或 onLoaded 中,将该网格分配给 public static 成员;
public static Grid PublicParentGrid;// this will be the static field within your parent page.
public ParentPage()
{
InitializeComponent();
PublicParentGrid = ParentGrid;// ParentGrid is the x:Name you defined for your grid.
}
now this publicparentgrid can be accessed from child page which is within the frame, like ParentPage.PublicParentGrid.Visibility .....
我是 UWP 的新手,当我单击框架内的按钮时,我需要在父级按钮的顶部打开一个屏幕 page.I 已将网格放入框架内并且它有效但打开的页面不是全屏。所以我需要将网格放在父页面上,以便打开(可能改变可见性)处于全屏状态。无论如何要从框架内部访问父元素?我试过从框架调用父函数并执行它,但网格可见性不是 changed.Any idea?
在父页面的构造函数或 onLoaded 中,将该网格分配给 public static 成员;
public static Grid PublicParentGrid;// this will be the static field within your parent page.
public ParentPage()
{
InitializeComponent();
PublicParentGrid = ParentGrid;// ParentGrid is the x:Name you defined for your grid.
}
now this publicparentgrid can be accessed from child page which is within the frame, like ParentPage.PublicParentGrid.Visibility .....