为什么不显示Silverlight ChildWindow? [英] Why Won't the Silverlight ChildWindow Display?

查看:15
本文介绍了为什么不显示Silverlight ChildWindow?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个简单的Silverlight 4应用程序,并在其中添加了一个子窗口。我正在使用下面的代码来打开它在一个按钮上点击。这看起来应该行得通,不是吗?

public void btnAbout_Click(object sender, RoutedEventArgs e)
        {
            About aboutThis = new About();
            aboutThis.Show();
        }

"About"类如下所示:

public partial class About : ChildWindow
    {
        public About()
        {
            InitializeComponent();
        }

        private void OKButton_Click(object sender, RoutedEventArgs e)
        {
            this.DialogResult = true;
        }

        private void CancelButton_Click(object sender, RoutedEventArgs e)
        {
            this.DialogResult = false;
        }
    }

推荐答案

我认为它没有任何理由不起作用。

样本:

http://www.tanguay.info/web/index.php?pg=codeExamples&id=135

http://www.silverlighttoys.com/Tutorials.aspx?tutorial=2

您的XAML是什么样的?

这篇关于为什么不显示Silverlight ChildWindow?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆