Why Won't the Silverlight ChildWindow Display?

我怕爱的太早我们不能终老 提交于 2019-12-24 20:26:57

问题


I have a simple Silverlight 4 application and have added a child window to it. I am using the below code to open it on a button click. This seems like it should work, does it not?

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

The "About" class looks like this:

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;
        }
    }

回答1:


I don't see any reason why it should not work.

Samples:

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

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

What is your XAML like?




回答2:


Try setting the Width and Height to 600px by 600px of your About Childwindow from xaml.



来源:https://stackoverflow.com/questions/4078370/why-wont-the-silverlight-childwindow-display

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!