Mayka
✅ Lag after closing folder dialog in console application
I need to raise a folder dialog within a console application. It works if I add the
[STAThread
attribute to the main method. However, there’s consistently a 3-5 second delay after the folder dialog is closed.
This Stack Overflow question bring up a similar issue for OpenFileDialog
but without a concrete resolution.
https://stackoverflow.com/questions/41894044/closing-a-openfiledialog-causes-application-to-hang-for-3-4-seconds
Is there any way to remove or minimize the delay after the folder dialog is closed?
Project Settings
Code
18 replies
Properly locking the console in async code
I made an async progress bar which sits at the bottom of the console. It still needs tweaking, but I’m running into issues truly locking the console during the specific moment that the progress bar is being written to the bottom of the screen.
In order to restore the initial cursor position after updating the progress bar, I’m storing the cursor position before it to the bottom of the console. However, it seems that the console is still able to be written to during the “locked” portion of the task. This causes lines to be overwritten, because the stored cursor position is no longer accurate. How do I force a true lock in this case?
16 replies
WPF Data Binding Shows Blank
I would like to have an
AppState
class within my WPF apps that can hold common properties I may want to access throughout the application, such as the assembly’s version number.
When I tried to create an instance of this class within my Main Window and then access one of the instance’s properties via a data binding, it’s just showing blank.
I know the property itself is set since I can set the window title via code behind to this property, so I’m a bit stumped why nothing populates when I try to access the instance via a binding. Can anyone shed some light on what I may be missing? See attached for a skeleton example.9 replies
Dependency Injection - Data Exporter
I’ve been trying to wrap my head around dependency injection, but I’m struggling to bridge the gap between written explanations and putting the paradigm into practice within my own code.
I need to export data from an Access database to an Excel spreadsheet using Interop (the OLE DB driver isn't an option here, unfortunately), but the goal is to eventually get the data out of Access and into a better format like perhaps a SQL Server database.
To make the code more flexible for these changes in the future, I tried to implement a general IExporter interface that could take any kind of input and export the data to any kind of output.
Would anyone be able to offer any feedback on how I could improve the below? It feels like my implementation is a bit off design-wise.
IDataExporter.cs:
DataExporter.cs:
5 replies