private void PInfoListItem_MouseDoubleClick(object sender, MouseButtonEventArgs e) { ListBoxItem senderItem = sender as ListBoxItem; string toDownload = senderItem.Tag.ToString(); MessageBoxModel downloadMsg = new MessageBoxModel { Text = "Downloading file from this url: " + toDownload, Caption = "Confirm download", Icon = AdonisUI.Controls.MessageBoxImage.Information, Buttons = new[] { MessageBoxButtons.Ok(), MessageBoxButtons.Cancel(), }, }; MessageBox.Show(downloadMsg); if (downloadMsg.Result == AdonisUI.Controls.MessageBoxResult.OK) { new WebClient().DownloadFile(new Uri(toDownload), Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + @"\FLauncher\Plugins\" + senderItem.Content + ".dll"); MessageBox.Show("Plugin download complete, restart FLauncher to use it", "Download Complete"); } }
public MainWindow() { ToolTipService.InitialShowDelayProperty.OverrideMetadata( typeof(FrameworkElement), new FrameworkPropertyMetadata(250)); ToolTipService.ShowDurationProperty.OverrideMetadata( typeof(FrameworkElement), new FrameworkPropertyMetadata(int.MaxValue)); InitializeComponent(); DataContext = _vm; if (ApplicationConfiguration.Instance.HasAcknowledgedDonationDialog) { return; } var messageBox = new MessageBoxModel { Text = "Hello, Gamer! \r\n\r\nDid you know this project was only possible with years of dedication and enthusiasm? " + "You're receiving this work for absolutely free. If it brings you joy please consider giving back to the " + "author's efforts and show your appreciation through a donation. \r\n\r\nThanks for your attention ❤️", Caption = "May I have your attention", Icon = MessageBoxImage.Question, Buttons = new[] { MessageBoxButtons.Cancel("Acknowledged"), MessageBoxButtons.Yes("Sure, show me how!") }, CheckBoxes = new[] { new MessageBoxCheckBoxModel("I've already donated or will consider it") { IsChecked = false, Placement = MessageBoxCheckBoxPlacement.BelowText } }, IsSoundEnabled = false }; MessageBox.Show(messageBox); switch (messageBox.Result) { case MessageBoxResult.Yes: Process.Start("https://vigem.org/Donations/"); break; } ApplicationConfiguration.Instance.HasAcknowledgedDonationDialog = messageBox.CheckBoxes.First().IsChecked; }