System.Windows.Window.Close()

Here are the examples of the csharp api System.Windows.Window.Close() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

1699 Examples 7

19 Source : InGameDisconectorOverlay.xaml.cs
with MIT License
from boonwin

internal static void Close()
        {
            
            _window.Close();
        }

19 Source : DialogWindow.xaml.cs
with The Unlicense
from BuIlDaLiBlE

private void ConfirmButton_Click(object sender, RoutedEventArgs e)
		{
			BpUtility.PlaySound(Properties.Resources.Click);
			DialogResult = true;
			Close();
		}

19 Source : DialogWindow.xaml.cs
with The Unlicense
from BuIlDaLiBlE

private void CloseButton_Click(object sender, RoutedEventArgs e)
		{
			BpUtility.PlaySound(Properties.Resources.Click);
			Close();
		}

19 Source : OutgoingbarView.xaml.cs
with MIT License
from C1rdec

protected override void OnClosed(EventArgs e)
        {
            this._parent.Close();
            base.OnClosed(e);
        }

19 Source : ActivationWindow.xaml.cs
with GNU General Public License v3.0
from cdians

private void CloseWindow()
        {
            this.Close();
        }

19 Source : MetroWindow.xaml.cs
with GNU General Public License v2.0
from Cdorey

void Close(object sender, RoutedEventArgs e)
        {
            Window.GetWindow(sender as FrameworkElement).Close();
        }

19 Source : DisclaimerWindow.xaml.cs
with Apache License 2.0
from CheckPointSW

private void OnLoaded(object sender, RoutedEventArgs routedEventArgs)
        {
            if (!File.Exists(DisclaimerFileName))
            {
                MainWindow.ShowMessage("Product legal doreplacedent is missing.\nCannot run the tool.", MessageTypes.Error);
                Close();
            }
            else
            {
                try
                {
                    var fs = new FileStream(DisclaimerFileName, FileMode.Open, FileAccess.Read);
                    var disclaimerText = new TextRange(DisclaimerText.Doreplacedent.ContentStart, DisclaimerText.Doreplacedent.ContentEnd);

                    disclaimerText.Load(fs, DataFormats.Rtf);
                    AcceptDisclaimer.Focus();
                }
                catch (Exception ex)
                {
                    MainWindow.ShowMessage("Failed to load Product legal doreplacedent.\nCannot run the tool.", MessageTypes.Error);
                    Close();
                }
            }
        }

19 Source : MainWindow.xaml.cs
with Apache License 2.0
from CheckPointSW

private void CloseButton_OnClick(object sender, RoutedEventArgs e)
        {
            Close();
        }

19 Source : MenuWindow.xaml.cs
with Apache License 2.0
from CheckPointSW

private void ShowDisclaimer()
        {
            // Display the disclaimer doreplacedent only once per tool version.
            string version = replacedembly.GetExecutingreplacedembly().GetName().Version.ToString();
            if (!File.Exists(version))
            {
                var disclaimerWindow = new DisclaimerWindow();
                var res = disclaimerWindow.ShowDialog();

                if (res.HasValue && res.Value)
                {
                    // Create a flag file.
                    var fsFlag = new FileStream(version, FileMode.CreateNew, FileAccess.Write);
                    fsFlag.Close();
                }
                else
                {
                    Close();
                }
            }
        }

19 Source : BondPropertyEditor.xaml.cs
with Apache License 2.0
from Chem4Word

private void Cancel_OnClick(object sender, RoutedEventArgs e)
        {
            Close();
        }

19 Source : BondPropertyEditor.xaml.cs
with Apache License 2.0
from Chem4Word

private void Save_OnClick(object sender, RoutedEventArgs e)
        {
            _bondPropertiesModel.Save = true;
            _closedByUser = true;
            Close();
        }

19 Source : MoleculePropertyEditor.xaml.cs
with Apache License 2.0
from Chem4Word

private void Save_OnClick(object sender, RoutedEventArgs e)
        {
            _moleculePropertiesModel.Save = true;
            _closedByUser = true;

            GatherData();
            Close();
        }

19 Source : MoleculePropertyEditor.xaml.cs
with Apache License 2.0
from Chem4Word

private void Close_OnClick(object sender, RoutedEventArgs e)
        {
            Close();
        }

19 Source : PTPopup.xaml.cs
with Apache License 2.0
from Chem4Word

private void PTPicker_ElementSelected(object sender, Controls.VisualPeriodicTable.ElementEventArgs e)
        {
            SelectedElement = e.SelectedElement;
            Close();
        }

19 Source : PTPopup.xaml.cs
with Apache License 2.0
from Chem4Word

private void PTPickerWindow_PreviewKeyDown(object sender, System.Windows.Input.KeyEventArgs e)
        {
            if (e.Key == Key.Escape)
            {
                Close();
            }
        }

19 Source : SettingsHost.xaml.cs
with Apache License 2.0
from Chem4Word

private void UcSettingsOnOnButtonClick(object sender, WpfEventArgs e)
        {
            if (e.Button.Equals("CANCEL"))
            {
                Close();
            }

            if (e.Button.Equals("SAVE"))
            {
                Close();
            }
        }

19 Source : AtomPropertyEditor.xaml.cs
with Apache License 2.0
from Chem4Word

private void Save_OnClick(object sender, RoutedEventArgs e)
        {
            _atomPropertiesModel.Save = true;
            _closedByUser = true;
            Close();
        }

19 Source : InputDialogWindow.xaml.cs
with Apache License 2.0
from chenxuuu

private void OkButton_Click(object sender, RoutedEventArgs e)
        {
            this.DialogResult = true;
            this.Close();
        }

19 Source : InputDialogWindow.xaml.cs
with Apache License 2.0
from chenxuuu

private void CancelButton_Click(object sender, RoutedEventArgs e)
        {
            this.DialogResult = false;
            this.Close();
        }

19 Source : MainWindow.xaml.cs
with Apache License 2.0
from chenxuuu

private void MainWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            Tools.Global.setting.windowLeft = this.Left;
            Tools.Global.setting.windowTop = this.Top;
            Tools.Global.setting.windowWidth = this.Width;
            Tools.Global.setting.windowHeight = this.Height;
            //自动保存脚本
            if (lastLuaFile != "")
                saveLuaFile(lastLuaFile);
            Tools.Global.isMainWindowsClosed = true;
            foreach (Window win in App.Current.Windows)
            {
                if (win != this)
                {
                    win.Close();
                }
            }
            e.Cancel = false;//正常关闭
        }

19 Source : BiliLoginWindowQR.xaml.cs
with GNU General Public License v2.0
from CHKZL

private void ByQRCode_QrCodeStatus_Changed(ByQRCode.QrCodeStatus status, Account account = null)
        {
            if (status == ByQRCode.QrCodeStatus.Success)
            {

                bilibili.BiliUser.account = account;
                InfoLog.InfoPrintf("UID:" + account.Uid + ",登陆成功", InfoLog.InfoClreplaced.进程一般信息);
                //MessageBox.Show("UID:"+account.Uid+",登陆成功");
                MMPU.UID = account.Uid;
                MMPU.写ini配置文件("User", "UID", MMPU.UID, MMPU.BiliUserFile);
                foreach (var item in account.Cookies)
                {
                    MMPU.Cookie = MMPU.Cookie + item + ";";
                }
                MMPU.CookieEX = account.Expires_Cookies;
                MMPU.csrf = account.CsrfToken;
                ;
                MMPU.写ini配置文件("User", "csrf", MMPU.csrf, MMPU.BiliUserFile);
                MMPU.写ini配置文件("User", "Cookie", Encryption.AesStr(MMPU.Cookie, MMPU.AESKey, MMPU.AESVal), MMPU.BiliUserFile);
                MMPU.写ini配置文件("User", "CookieEX", MMPU.CookieEX.ToString("yyyy-MM-dd HH:mm:ss"), MMPU.BiliUserFile);
                Dispatcher.Invoke(new Action(delegate
                {
                    Close();
                }));
            }
        }

19 Source : 增加监控列表.xaml.cs
with GNU General Public License v2.0
from CHKZL

private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            MessageBox.Show("配置文件发生变化,请手动重启DDTV以加载新的配置");
            this.Close();
        }

19 Source : AddMonitoringList.xaml.cs
with GNU General Public License v2.0
from CHKZL

private void Button_Click(object sender, RoutedEventArgs e)
        {
            this.Close();
            //MessageBoxResult dr = System.Windows.MessageBox.Show("确认取消增加?", "取消", MessageBoxButton.OKCancel, MessageBoxImage.Question);
            //if (dr == MessageBoxResult.OK)
            //{
               
            //}
        }

19 Source : AddMonitoringList.xaml.cs
with GNU General Public License v2.0
from CHKZL

private void BT1_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (string.IsNullOrEmpty(平台.SelectedItem.ToString()))
                {
                    MessageBox.Show("未选择平台");
                    return;
                }
            }
            catch (Exception)
            {
                MessageBox.Show("未选择平台");
                return;
            }
            if (string.IsNullOrEmpty(中文名称.Text) || string.IsNullOrEmpty(平台.SelectedItem.ToString()) || string.IsNullOrEmpty(唯一码.Text))
            {
                MessageBox.Show("不能留空");
                return;
            }
            if (this.replacedle == "添加新单推"|| this.replacedle == "从网络添加房间")
            {
                if (平台.SelectedItem.ToString() == "bilibili")
                {
                    foreach (var item in RoomInit.bilibili房间主表)
                    {
                        if (item.唯一码 == 唯一码.Text)
                        {
                            MessageBox.Show("已存在相同的房间号!\r\n" + item.名称 + " " + item.平台 + " " + item.唯一码);
                            return;
                        }
                    }
                }
                else if(平台.SelectedItem.ToString()=="youtube")
                {
                    foreach (var item in RoomInit.youtube房间主表)
                    {
                        if (item.唯一码 == 唯一码.Text)
                        {
                            MessageBox.Show("已存在相同的房间号!\r\n" + item.名称 + " " + item.平台 + " " + item.唯一码);
                            return;
                        }
                    }
                }
                新增V信息 NEWV = new 新增V信息() { CN_Name = 中文名称.Text, LA_Name = 官方名称.Text, Platform = 平台.SelectedItem.ToString(), GUID = 唯一码.Text };
                NewThreadTask.Run(() =>
                {
                    MMPU.TcpSend(Server.RequestCode.GET_NEW_MEMBER_LIST_CONTENT,
                        JsonConvert.SerializeObject(NEWV), true,50);
                });

                RoomBox rlc = JsonConvert.DeserializeObject<RoomBox>(ReadConfigFile(RoomConfigFile));
                RoomBox RB = new RoomBox();
                RB.data = new List<RoomCadr>();
                if (rlc.data != null)
                {
                    foreach (var item in rlc.data)
                    {
                        RB.data.Add(item);
                        if (RoomInit.根据唯一码获取直播状态(item.RoomNumber))
                        {
                            RB.data[RB.data.Count() - 1].LiveStatus = true;
                        }
                    }
                }
                RB.data.Add(new RoomCadr { Name = 中文名称.Text,RoomNumber = 唯一码.Text, Types = 平台.SelectedItem.ToString(), RemindStatus = false, status = false, VideoStatus = false, OfficialName = 官方名称.Text, LiveStatus = RoomInit.根据唯一码获取直播状态(GUID) });
                string JOO = JsonConvert.SerializeObject(RB);
                MMPU.储存文本(JOO, RoomConfigFile);
                if (平台.SelectedItem.ToString() == "bilibili")
                {
                    InitializeRoomList(int.Parse(唯一码.Text), false, false);
                }
                else
                {
                    InitializeRoomList(0, false, false);
                }

                  

                //更新房间列表(平台.SelectedItem.ToString(), 唯一码.Text,1);
                //MessageBox.Show("添加成功");

            }
            else if(this.replacedle=="修改单推属性")
            {
                新增V信息 NEWV = new 新增V信息() { CN_Name = 中文名称.Text, LA_Name = 官方名称.Text, Platform = 平台.SelectedItem.ToString(), GUID = 唯一码.Text };
                NewThreadTask.Run(() =>
                {
                    MMPU.TcpSend(Server.RequestCode.GET_NEW_MEMBER_LIST_CONTENT,
                        JsonConvert.SerializeObject(NEWV), true,50);
                });

                RoomBox rlc = JsonConvert.DeserializeObject<RoomBox>(ReadConfigFile(RoomConfigFile));
                RoomBox RB = new RoomBox();
                RB.data = new List<RoomCadr>();
                if (rlc.data != null)
                {
                    foreach (var item in rlc.data)
                    {
                        if (item.RoomNumber == GUID)
                        {
                            RB.data.Add(item);
                            RB.data[RB.data.Count - 1].Name = 中文名称.Text;
                            RB.data[RB.data.Count - 1].OfficialName = 官方名称.Text;
                            RB.data[RB.data.Count - 1].Types = 平台.SelectedItem.ToString();
                        }
                        else
                        {
                            RB.data.Add(item);
                            if (RoomInit.根据唯一码获取直播状态(item.RoomNumber))
                            {
                                RB.data[RB.data.Count() - 1].LiveStatus = true;
                            }
                        }
                    }
                }
               
                string JOO = JsonConvert.SerializeObject(RB);
                MMPU.储存文本(JOO, RoomConfigFile);
                InitializeRoomList(0,false, false);
                //var rlc2 = JsonConvert.DeserializeObject<RoomBox>(ReadConfigFile(RoomConfigFile));
                //RoomBox RB = new RoomBox();
                //RB.data = new List<RoomCadr>();
                //int rlclen = 房间主表.Count()-1;
                //int 覆盖的编号 = 0;
                //for (int i =0;i< rlclen; i++)
                //{
                //    if(房间主表[i].唯一码==GUID)
                //    {
                //        覆盖的编号 = i;
                //        //房间主表.Remove(房间主表[i]);
                //        //i--;
                //        RB.data.Add(new RoomCadr { Name = 中文名称.Text, RoomNumber = 唯一码.Text, Types = 平台.SelectedItem.ToString(), RemindStatus = false, status = false, VideoStatus = false, OfficialName = 官方名称.Text,LiveStatus= RoomInit.根据唯一码获取直播状态(GUID) });
                //    }
                //    else
                //    {
                //        RB.data.Add(new RoomCadr(){ LiveStatus= 房间主表[i] .直播状态,Name= 房间主表[i] .名称,OfficialName= 房间主表[i] .原名,RoomNumber= 房间主表[i] .唯一码,VideoStatus= 房间主表[i] .是否录制,Types= 房间主表[i] .平台, RemindStatus= 房间主表[i] .是否提醒,status=false });
                //        if (RoomInit.根据唯一码获取直播状态(房间主表[i].唯一码))
                //        {
                //            RB.data[RB.data.Count() - 1].LiveStatus = true;
                //        }
                //    }
                //}
                //房间主表.Clear();
                //foreach (var item in RB.data)
                //{
                //    房间主表.Add(new RL { 名称=item.Name,原名=item.OfficialName,唯一码=item.RoomNumber,平台=item.Types,是否录制=item.VideoStatus,是否提醒=item.RemindStatus,直播状态=item.LiveStatus});
                //}

                //新增V信息 NEWV = new 新增V信息() { CN_Name = 中文名称.Text, LA_Name = 官方名称.Text, Platform = 平台.SelectedItem.ToString(), GUID = 唯一码.Text };

                //new Task(() => { MMPU.TcpSend(20001, JsonConvert.SerializeObject(NEWV), true); }).Start();
                //string JOO = JsonConvert.SerializeObject(RB);
                //MMPU.储存文本(JOO, RoomConfigFile);
                //InitializeRoomList();
                ////MessageBox.Show("修改成功");

            }
            this.Close();
        }

19 Source : MainWindow.xaml.cs
with GNU General Public License v2.0
from CHKZL

private void Image_MouseLeftButtonDown_1(object sender, MouseButtonEventArgs e)
        {
            关闭窗口();
            this.Close();
        }

19 Source : FirstTimeSetupWindow.xaml.cs
with GNU General Public License v2.0
from CHKZL

private void 完成初始化()
        {
            //写配置文件
            MMPU.setFiles("IsFirstTimeUsing", "0");
            //MMPU.setFiles("DataSource", _数据源.ToString());
            //MMPU.数据源 = _数据源;
            MMPU.setFiles("DataSource", "0");
            MMPU.数据源 = 0;
            MMPU.是否第一次使用DDTV = false;
           
            //关闭此窗口
            this.Close();
        }

19 Source : AnalysisWindow.xaml.cs
with MIT License
from chrisnas

public void ForceClose()
        {
            _canClose = true;
            App.Current.Dispatcher.BeginInvoke((Action)(
                () => { Close(); }),
                DispatcherPriority.Background,
                null
                );
        }

19 Source : MainView.xaml.cs
with MIT License
from ChrisStayte

public void ExitApplication()
        {
            base.Close();
        }

19 Source : MainWindow.xaml.cs
with GNU General Public License v3.0
from ciribob

public void ShowError()
        {
            MessageBox.Show("Error Auto Updating IL2-SRS - Please check internet connection and try again \n\nAlternatively: \n1. Download the latest IL2-SimpleRadioStandalone.zip from the SRS Github Release page\n2. Extract all the files to a temporary directory\n3. Run the installer.",
                "Auto Updater Error",
                MessageBoxButton.OK,
                MessageBoxImage.Error);

            Close();
        }

19 Source : MainWindow.xaml.cs
with GNU General Public License v3.0
from ciribob

private void DownloadComplete(object sender, AsyncCompletedEventArgs e)
        {
            if (!_cancel)
            {
                ZipFile.ExtractToDirectory(_file, Path.Combine(_directory, "extract"));

                Thread.Sleep(400);

                ProcessStartInfo procInfo = new ProcessStartInfo();
                procInfo.WorkingDirectory = Path.Combine(_directory, "extract"); 
                procInfo.Arguments = "-autoupdate";
                procInfo.FileName = Path.Combine(Path.Combine(_directory, "extract"), "installer.exe");
                procInfo.UseShellExecute = false;
                Process.Start(procInfo);
            } 
            
            Close();
        }

19 Source : MainWindow.xaml.cs
with GNU General Public License v3.0
from ciribob

private void CancelButtonClick(object sender, RoutedEventArgs e)
        {
            _cancel = true;
            Close();
        }

19 Source : InputProfileWindow.xaml.cs
with GNU General Public License v3.0
from ciribob

private void CreateOrRename_Click(object sender, RoutedEventArgs e)
        {
            _callback(CleanString(ProfileName.Text));
            Close();
        }

19 Source : InputProfileWindow.xaml.cs
with GNU General Public License v3.0
from ciribob

private void Cancel_Click(object sender, RoutedEventArgs e)
        {
            Close();
        }

19 Source : RadioOverlay.xaml.cs
with GNU General Public License v3.0
from ciribob

private void Button_Minimise(object sender, RoutedEventArgs e)
        {
            // Minimising a window without a taskbar icon leads to the window's menu bar still showing up in the bottom of screen
            // Since controls are unusable, but a very small portion of the always-on-top window still showing, we're closing it instead, similar to toggling the overlay
            if (_globalSettings.GetClientSettingBool(GlobalSettingsKeys.RadioOverlayTaskbarHide))
            {
                Close();
            }
            else
            {
                WindowState = WindowState.Minimized;
            }
        }

19 Source : RadioOverlay.xaml.cs
with GNU General Public License v3.0
from ciribob

private void Button_Close(object sender, RoutedEventArgs e)
        {
            Close();
        }

19 Source : App.xaml.cs
with GNU General Public License v3.0
from ciribob

private void NotifyIcon_Quit(object sender, EventArgs args)
        {
            MainWindow.Close();

        }

19 Source : ProgressDialog.xaml.cs
with GNU General Public License v3.0
from ciribob

public void UpdateProgress(bool finished, string text)
        {
            Dispatcher?.Invoke(() =>
            {
                Status.Text = text;
                if (finished)
                {
                    Close();
                }
            });
        }

19 Source : AboutWindow.xaml.cs
with GNU General Public License v3.0
from CitizensReactor

private void Close_Click(object sender, RoutedEventArgs e)
        {
            this.Close();
        }

19 Source : PointerCreationTypeSelectionWindow.xaml.cs
with GNU General Public License v3.0
from CitizensReactor

private void Close_Click(object sender, RoutedEventArgs e)
        {
            this.DialogResult = false;
            this.Close();
        }

19 Source : PointerCreationTypeSelectionWindow.xaml.cs
with GNU General Public License v3.0
from CitizensReactor

private void CloseButton_Click(object sender, RoutedEventArgs e)
        {
            this.DialogResult = false;
            this.Close();
        }

19 Source : PointerCreationTypeSelectionWindow.xaml.cs
with GNU General Public License v3.0
from CitizensReactor

private void ConfirmButton_Click(object sender, RoutedEventArgs e)
        {
            this.DialogResult = true;
            this.Close();
        }

19 Source : SettingsWindow.xaml.cs
with MIT License
from coldino

private void Apply_Click(object sender, RoutedEventArgs e)
        {
            Model.Settings.Save();
            Properties.Settings.Default.Reload();

            Close();
        }

19 Source : Welcome.xaml.cs
with MIT License
from coldino

private void SwitchToMainWindow()
        {
            new MainWindow().Show();

            Close();
        }

19 Source : BBBU.xaml.cs
with GNU General Public License v3.0
from ComputerElite

private void Close(object sender, RoutedEventArgs e)
        {
            MainWindow.iPUtils.CheckIP(Quest);
            this.Close();
        }

19 Source : Songs.xaml.cs
with GNU General Public License v3.0
from ComputerElite

public void checkqueue()
        {
            if (downloadqueue.Count != 0 && !canceled)
            {
                if(PEO && installed % 20 == 0 && installed != 0)
                {
                    BMBFUtils.Sync(txtbox);
                }
                txtbox.AppendText("\n\n" + MainWindow.globalLanguage.processer.ReturnProcessed(MainWindow.globalLanguage.songs.code.remainingToInstall, downloadqueue.Count.ToString()));
                txtbox.ScrollToEnd();
                InstallSong();
            }
            else
            {
                canceled = false;
                downloadqueue.Clear();
                txtbox.AppendText("\n\n" + MainWindow.globalLanguage.global.allFinished);
                txtbox.ScrollToEnd();
                DownloadLable.Text = MainWindow.globalLanguage.global.allFinished;
                if (PEO)
                {
                    BMBFUtils.Sync(txtbox);
                    PlaylistEditor.waiting = false;
                    this.Close();
                }
                if(OneClick)
                {
                    Process.GetCurrentProcess().Kill();
                }
            }
        }

19 Source : Support.xaml.cs
with GNU General Public License v3.0
from ComputerElite

public async void StartSupport(String Link)
        {
            String section = Link.Replace("bm://", "").Replace("%20", " ").ToLower();
            if(Link.ToLower().StartsWith("beatsaver://"))
            {
                String bsr = section.Replace("beatsaver://", "").Replace("/", "").ToLower();
                Songs s = new Songs();
                s.Show();
                s.InstallSong(bsr);
                this.Close();
            }
            else if(section.StartsWith("support/quickfix"))
            {
                BackupPlaylists();
                resetreplacedets();
                reloadsongsfolder();
                BMBFUtils.Sync(txtbox);
                RestorePlaylists();
                this.Close();
            } else if(section.StartsWith("mods/install/"))
            {

                String ModName = section.Replace("mods/install/", "").Replace("/", "");
                Mods m = new Mods();
                m.Show();
                m.InstallMod(ModName);
                this.Close();
            } else if(section.StartsWith("songs/install/"))
            {
                String bsr = section.Replace("songs/install/", "").ToLower();
                Songs s = new Songs();
                s.Show();
                s.InstallSong(bsr);
                this.Close();
            } else if(section.StartsWith("bbbu/backup/"))
            {
                String Name = section.Replace("bbbu/backup/", "");
                BBBU BBBU = new BBBU();
                BBBU.Show();
                BBBU.BackupLink(Name);
                this.Close();
            }
            else if (section.StartsWith("bbbu/abackup/"))
            {
                String Name = section.Replace("bbbu/abackup/", "");
                BBBU BBBU = new BBBU();
                BBBU.Show();
                BBBU.BackupLink(Name);
                this.Close();
            }
            else if (section.StartsWith("bbbu/restore"))
            {
                String Name = section.Replace("bbbu/restore/", "");
                BBBU BBBU = new BBBU();
                BBBU.Show();
                BBBU.selectBackup(Name);
                this.Close();
            } else if(section.StartsWith("update"))
            {
                MessageBoxResult result = MessageBox.Show(MainWindow.globalLanguage.settings.code.updateBMBFWarning, "BMBF Manager - BMBF Updater", MessageBoxButton.YesNo, MessageBoxImage.Warning);
                switch (result)
                {
                    case MessageBoxResult.No:
                        txtbox.AppendText("\n\n" + MainWindow.globalLanguage.settings.code.aborted);
                        txtbox.ScrollToEnd();
                        Running = false;
                        return;
                }
                MainWindow m = new MainWindow();
                m.Show();
                m.StartBMBFUpdate();
                this.Close();
            } else if(section.StartsWith("switchversion"))
            {
                MessageBoxResult result = MessageBox.Show(MainWindow.globalLanguage.settings.code.switchWarning, "BMBF Manager - Version Switcher", MessageBoxButton.YesNo, MessageBoxImage.Warning);
                switch (result)
                {
                    case MessageBoxResult.No:
                        txtbox.AppendText("\n\n" + MainWindow.globalLanguage.settings.code.aborted);
                        txtbox.ScrollToEnd();
                        Running = false;
                        return;
                }
                MainWindow m = new MainWindow();
                m.Show();
                m.StartVersionSwitch();
                this.Close();
            }
        }

19 Source : NotifyUpdate.xaml.cs
with MIT License
from CopyPlusPlus

public void Button2_Click(object sender, RoutedEventArgs e)
        {
            Settings.Default.LastOpenDate = new DateTime(1999, 7, 24);
            Settings.Default.Save();
            this.Close();
        }

19 Source : NotifyUpdate.xaml.cs
with MIT License
from CopyPlusPlus

private void Button1_Click(object sender, RoutedEventArgs e)
        {
            this.Close();
        }

19 Source : TranslateResult.xaml.cs
with MIT License
from CopyPlusPlus

private void EscExecuted(object sender, ExecutedRoutedEventArgs e)
        {
            Close();
        }

19 Source : MainWindow.xaml.cs
with MIT License
from CSharpDesignPro

private void CloseBtn_Click(object sender, RoutedEventArgs e)
        {
            Close();
        }

See More Examples