Example #1
0
 private void WindowEditFun(object sender, EventArgs e)
 {
     if (flowWindow.AllowsTransparency && e != EventArgs.Empty && flowWindow.IsLoaded)//编辑模式
     {
         flowWindow.Close();
         flowWindow = new FlowWindow()
         {
             AllowsTransparency = false, WindowStyle = WindowStyle.SingleBorderWindow, Top = double.Parse(iniData["FlowWindow"]["FlowWindowTop"]) - topOffset, Left = double.Parse(iniData["FlowWindow"]["FlowWindowLeft"]) - leftOffset
         };
         flowWindow.Closed += delegateInstance;
         flowWindow.Show();
     }
     else if (!flowWindow.AllowsTransparency)
     {
         iniData["FlowWindow"]["FlowWindowTop"]  = (flowWindow.Top + topOffset).ToString();
         iniData["FlowWindow"]["FlowWindowLeft"] = (flowWindow.Left + leftOffset).ToString();
         parser.WriteFile("conf.ini", iniData);
         flowWindow.Closed -= delegateInstance;
         flowWindow.Close();
         flowWindow = new FlowWindow()
         {
             AllowsTransparency = true, WindowStyle = WindowStyle.None, Top = double.Parse(iniData["FlowWindow"]["FlowWindowTop"]), Left = double.Parse(iniData["FlowWindow"]["FlowWindowLeft"])
         };
         flowWindow.Show();
     }
 }
Example #2
0
 /// <summary>
 /// 切换弹窗事件触发
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void Switch(object sender, EventArgs e)
 {
     if (flowWindow.IsVisible)
     {
         WindowEdit.Visibility = Visibility.Hidden;
         flowWindow.Hide();
     }
     else
     {
         if (!flowWindow.IsLoaded)
         {
             flowWindow.Close();
             flowWindow = new FlowWindow()
             {
                 Top = double.Parse(iniData["FlowWindow"]["FlowWindowTop"]), Left = double.Parse(iniData["FlowWindow"]["FlowWindowLeft"])
             };
         }
         WindowEdit.Visibility = Visibility.Visible;
         flowWindow.Show();
     }
     if (e == null)
     {
         chkSwitch.IsChecked = (bool)chkSwitch.IsChecked ? false : true;
     }
 }