.net - How can show a pop up to application user writing C# code in a wpf project? -


i'm working on wpf project , wont show pop messagges user when events occur. need via code. i'm trying write code 1 follows:

void foo() {       popup msgpopup = new popup();       textbox tb = new textbox();       tb.acceptsreturn = true;       tb.text = msgpopup + "\n";       msgpopup.child = tb;       mywindow.mystackpanel.children.add(msgpopup);       mywindow.mystackpanel.isenabled = true;       mywindow.activate();       msgpopup.isenabled = true; } 

this code seems have no effects. have seen lot of other discussion threads , posts on pop in wpf , found nothing can me... found on using pop via xaml. thanks.

maybe can use snippet used in 1 of applications

    window waitwindow = new window { height = 100, width = 300,  windowstyle = windowstyle.none };     waitwindow.content = new textblock { text = "fetching data", fontsize = 30, fontweight = fontweights.bold, horizontalalignment = horizontalalignment.center, verticalalignment = verticalalignment.center };      //open window     dispatcher.begininvoke(new action(delegate { waitwindow.showdialog(); }));     //do      //close window     dispatcher.begininvoke(new action(delegate()     {          waitwindow.close();      })); 

Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -