从按钮点击事件调用用户控件的问题

时间:2011-05-02 13:25:39

标签: wpf

我似乎无法成功调用从按钮事件单击启动用户控件的方法。 当我从其他地方调用相同的方法时它工作正常。 这是方法:

   private void StartWaitCircle()
    {

        WaitCircle waitCircle = new WaitCircle();
        circle.Children.Add(waitCircle);
        waitCircle.IsEnabled = true;
        waitCircle.HorizontalAlignment = System.Windows.HorizontalAlignment.Center;
        waitCircle.VerticalAlignment = System.Windows.VerticalAlignment.Center;
        waitCircle.Visibility = System.Windows.Visibility.Visible;
        waitCircle.Focus();
    }

当我这样做时:

 private void button_Click(object sender, RoutedEventArgs e)
    {
         StartWaitCircle() 
    }

上面的代码调用了该方法,但没有任何反应。

0 个答案:

没有答案