Templates working

This commit is contained in:
2023-03-09 20:46:01 +01:00
parent a55678e5ef
commit d514a639a9
13 changed files with 158 additions and 41 deletions

View File

@ -11,9 +11,11 @@ namespace WGneu {
public partial class App : Application {
public static bool IsPrintingReady => Documents.Html.IsReady && Documents.Pdf.IsReady;
public static System.Windows.Threading.Dispatcher MainDispatcher { get; private set; }
public App() : base() {
System.Text.Encoding.RegisterProvider(System.Text.CodePagesEncodingProvider.Instance);
MainDispatcher = Dispatcher;
}
public void App_Startup(object sender, EventArgs e) {
@ -21,6 +23,10 @@ namespace WGneu {
Task.Run(() => Documents.Pdf.Init(PrintingReadyChanged));
}
public void App_Exit(object sender, EventArgs e) {
Task.Run(() => Documents.Pdf.Close());
}
private void PrintingReadyChanged() {
Dispatcher.BeginInvoke(App_PrintingReadyChanged, this, new EventArgs());
}