Cleanup
This commit is contained in:
@ -18,20 +18,22 @@ namespace WGneu {
|
||||
MainDispatcher = Dispatcher;
|
||||
}
|
||||
|
||||
public void App_Startup(object sender, EventArgs e) {
|
||||
protected override void OnStartup(StartupEventArgs e) {
|
||||
Task.Run(() => Documents.Html.Init(PrintingReadyChanged));
|
||||
Task.Run(() => Documents.Pdf.Init(PrintingReadyChanged));
|
||||
base.OnStartup(e);
|
||||
}
|
||||
|
||||
public void App_Exit(object sender, EventArgs e) {
|
||||
protected override void OnExit(ExitEventArgs e) {
|
||||
Task.Run(() => Documents.Pdf.Close());
|
||||
base.OnExit(e);
|
||||
}
|
||||
|
||||
private void PrintingReadyChanged() {
|
||||
Dispatcher.BeginInvoke(App_PrintingReadyChanged, this, new EventArgs());
|
||||
Dispatcher.BeginInvoke(OnPrintingReadyChanged, new EventArgs());
|
||||
}
|
||||
|
||||
private void App_PrintingReadyChanged(object sender, EventArgs e) {
|
||||
protected void OnPrintingReadyChanged(EventArgs e) {
|
||||
foreach (Window w in Windows) {
|
||||
foreach (var b in Utils.FindVisualChilds<Button>(w).Where(b => "Print".Equals(b.Tag))) {
|
||||
b.IsEnabled = IsPrintingReady;
|
||||
|
Reference in New Issue
Block a user