gpt4 book ai didi

c# - WP7中带有图像的消息框

转载 作者:行者123 更新时间:2023-11-30 22:34:30 25 4
gpt4 key购买 nike

您好,目前我正在使用带有图像和两个按钮的网格在我的 WP7 应用程序中显示自定义消息框,该应用程序的可见性最初是折叠的。一切正常,但当可见性可见时,我必须禁用页面后面的所有控件。因此,启用/禁用背后的大量控制会产生相当大的开销。

是否有更好的解决方案来满足我的要求:(1) 显示一个带有图像和两个按钮或文本框的消息框,以及 (2) 它应该出现在页面中间。

提前致谢!

最佳答案

您可以使用内置的 Popup control带有 Kent Boogaart 编写的附加行为,因此它的行为类似于带有 PlacementTargetPlacement 的 WPF Popup 控件:

<Popup b:PopupPlacement.PlacementTarget="{Binding ElementName=someElement}">
<b:Popup.PreferredOrientations>
<b:PopupOrientationCollection>
<b:PopupOrientation Placement="Top" HorizontalAlignment="Center"/>
<b:PopupOrientation Placement="Bottom" HorizontalAlignment="Center"/>
<b:PopupOrientation Placement="Right" VerticalAlignment="Center"/>
<b:PopupOrientation Placement="Right" VerticalAlignment="TopCenter"/>
</b:PopupOrientationCollection>
</b:Popup.PreferredOrientations>

<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>

<TextBlock Grid.Row="0">My popup's contents</TextBlock>
<Image Grid.Row="1" .... />
</Grid>
</Popup>

关于c# - WP7中带有图像的消息框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7792620/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com