Flyout flyout = new Flyout();
Button button = new Button();
button.Content = "open";
button.Flyout = flyout;
StackPanel stack = new StackPanel();
ComboBox comboBox = new ComboBox();
int[] arr = {0,1,2,3,4,5,6,7,8,9};
comboBox.ItemsSource = arr;
stack.Children.Add(comboBox);
Button closeButton = new Button();
closeButton.Content = "close";
closeButton.Click += delegate(object sender, RoutedEventArgs e)
{
//saving stuff
flyout.Hide();
};
stack.Children.Add(closeButton);
flyout.Content = stack;
当我打开组合框时,它会访问自己的弹出框以让用户选择一个数字。这样做关闭了我所做的弹出。在用户按下closeButton之前,如何阻止我的弹出窗口关闭?