我想使用在XAMl中声明的encode4fun AboutPrompt而不是C#。 我需要在我MainPage.XMAL是这样的:Xoding中声明的Coding4fun Toolkit AboutPrompt?
<c4fControls:AboutPrompt x:Name="prompt" Visibility="Collapsed" Title="AboutPrompt declared in XAML" WaterMark="No Watermark">
<c4fControls:AboutPrompt.Body>
<TextBlock Text="This is the first tect in the Body section."/>
</c4fControls:AboutPrompt.Body>
</c4fControls:AboutPrompt>
我想展示AboutPrompt以标准方式之后:
private void aboutPrompt1_Click(object sender, RoutedEventArgs e)
{
prompt.Visibility = visibility.Visible;
prompt.Show();
}
的问题是,我得到的元素已经另一个元素的孩子。例外。
我知道我可以使用VisualTreeHelper来解决这个问题,但我需要一个优雅的解决方案。
谢谢你的帮助。其实这里是一篇关于AboutPrompt的深度文章,以及一个UserControl的解决方法:http://www.windowsphonegeek.com/articles/WP7-AboutPrompt-in-depth – 2011-02-07 13:12:02