我创建了2个WPF窗口。
对于窗口1:
//Get IC Detail First
COAKeyInAccountICCanvas COAKeyInAccountCanvas = new COAKeyInAccountICCanvas(this, _PrinterIsOn);
COAKeyInAccountCanvas.Topmost = true;
COAKeyInAccountCanvas.Show();
if(CheckCOAKeyInICStatus.checkCOAKeyInAccountICStatus == true)
{
//Check User Ownership
checkCOAOwner.Visibility = Visibility.Visible; // let user to choose whether is owner or representer
}
else
{
accountNumber = "";
checkCOAOwner.Visibility = Visibility.Hidden;
GetAccountCanvas.Visibility = Visibility.Visible;
}
最初,COAKeyinAccountCanvas
窗口会检查并将CheckCOAKeyInICStatus.checkCOAKeyInAccountICStatus
更新为" false "或" true "。
如何在COAKeyInAccountCanvas
窗口完成所有功能之前取消执行if-else语句功能?
答案 0 :(得分:4)
使用:
COAKeyInAccountCanvas.ShowDialog();
代替:
COAKeyInAccountCanvas.Show();