我是编程新手所以如果这个问题有点简单,请原谅我 . 我正在使用一个内部有网格的flipview,其中包含一个图像和一个webview . 里面的项目是水平堆叠的 . webview项部分覆盖NextItem按钮 . 任何人都可以告诉我如何将此按钮带到前面 . 香港专业教育学院尝试找到BringToFront方法,但找不到它 .
我尝试的代码是首先编辑flipview的模板,只是为了找到按钮的名称,然后将它应用到我的flipview . 然后我试过这个:
Button btnPrev = (Button)VisualTreeQueryHelper.FindNameFromParent(caseStudyImages, "PreviousButtonHorizontal");
Button btnNext = (Button)VisualTreeQueryHelper.FindNameFromParent(caseStudyImages, "NextButtonHorizontal");
btnNext.BringToFront();
这是flipview的xaml中的数据模板:
<DataTemplate x:Key="DataTemplate1">
<Grid Margin="40,0,0,10">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="1*" />
</Grid.ColumnDefinitions>
<WebView Grid.Column="1" Margin="20,0,40,40" callisto:WebViewExtension.HtmlSource="{Binding NodeValue,Converter={StaticResource DocToString}}" Grid.Row="1"/>
<Image Grid.Column="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<Image.Source>
<BitmapImage UriSource="{Binding Id}"/>
</Image.Source>
</Image>
</Grid>
</DataTemplate>
沿着这些方向,我期待的代码将起作用 .