manager.PackagesDownloadStarted not fired
See original GitHub issueHey guys,
Maybe i’m just not good enough with C#, but for me it seems that the event manager.PackagesDownloadStarded is not fired.
My Code:
using nUpdate.Updating;
using System;
using System.Diagnostics;
using System.Globalization;
using System.Threading;
using System.Windows;
namespace KLauncher____Installer {
/// <summary>
/// Interaktionslogik für MainWindow.xaml
/// </summary>
public partial class MainWindow: Window {
public MainWindow() {
InitializeComponent();
}
private void button_Click(object sender, RoutedEventArgs e) {
UpdateManager manager = new UpdateManager(new Uri("ServerURL"), "Key provide by nUpdate Administration", new CultureInfo("de-DE"));
manager.PackagesDownloadStarted += Manager_PackagesDownloadStarted;
var updaterUI = new UpdaterUI(manager, SynchronizationContext.Current);
updaterUI.ShowUserInterface();
manager.RestartHostApplication = false;
}
public void Manager_PackagesDownloadStarted(object sender, EventArgs e) {
MessageBox.Show("Event fired!");
}
}
}
Please tell what i’m doing wrong:)
Have nice easter days.
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Why are bad managers often not fired when good ...
Only bullies and bad managers actually enjoy firing people. A good manager never enjoys firing someone. Even when they are completely incompetent at...
Read more >Why do Bad Managers not get fired?
Poor manager often stunt their employees growth, thus preventing them from becoming real competition for the management job.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ah, I see. You’re using WPF, that’s the problem. But, in any case, that wouldn’t have been the necessary event. 😉 Version 3.x of nUpdate requires a small workaround for WPF as nUpdate, by default, calls
Application.Exit
which will not close the host application correctly. The library was originally invented to serve only for Windows Forms. To fix that, create a new class and add this content:Then use that class instead of
UpdateManager
. This should fix your problem. This will be fixed in v4 as WPF will become fully supported then.See also: #31 This issue is now fixed and thus, a workaround is no longer necessary.