is to traverse all, some words will not be generated, no words to generate a, and the first is a parameter, and finally the window event.
changedistingwordofselected MW = NULL;
foreach (Window winIn APP. Current. Windows)
{
If (Win is changedistingwordofselected)
{
MW = win as changedistingwordofselected;
}
}
if (MW = = null)
{
MW = new changedistingwordofselected ();
Mw. Windowstartuplocation = Windowstartuplocation. Manual;
Mw. left =1025;//Location of window generation
Mw. left = Mouse. GetPosition (Globalhelper._mainwindow). X;
Mw. Top = Mouse. GetPosition (This). Y;
Mw. Show ();
}
Else
{
Mw. Visibility = System. Windows. Visibility. Visible;
Mw. topmost = True;
}
Mw. BTN_OK. Click + = delegate//to determine the replacement word
{
Listresult[currentlineindex]. Linetxtinfo[currenttxtindex]. Txtresult = MW. Changedword. Text;//Change the selected word;
observablecollection<string> strnewlinetxt = new Observablecollection<string> ();
Strnewlinetxt. Clear ();
for (int l =0; L < Listresult[currentlineindex]. Linetxtinfo.count; l++)
{
Strnewlinetxt }
this Mw }
< Span class= "Hljs-preprocessor" >< Span class= "hljs-comment" > < Span class= "hljs-comment" > 2, can also be a new global window object, each time checking whether the current object is empty
if (Drawingsoftware_wnd = =Null
{
Double height =This. Height;
Double width =This. Width;
Drawingsoftware_wnd =New Drawingsoftware_popup (This, height, width);
Drawingsoftware_wnd. Owner =This
}
if (!drawingsoftware_wnd. IsVisible)
{
Drawingsoftware_wnd. Show ();
This . Hide ();
}
Else
{
Drawingsoftware_wnd. Hide ();
}
WPF keeps only one window and displays it in front