Skip to content

cmiles/PointlessWaymarksTools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pointless Waymarks Tools

This repository pulls together reusable tools with a focus on WPF Desktop Applications. These tools were first built for the Pointless Waymarks Project.

WPFCommon

This library has several controls and ideas that I like for building small to medium WPF applications:

  • StatusControl - For Desktop Apps I want to have an easy, generic, way to run tasks in the background, block the UI, show cancellation buttons, stream text progress information, display messages and show in-app toast. The StatusControl UserControl can be added to a control/page/window and bound to a StatusControlContext to handle this scenario. This is a compromise - for the most beautiful UI interactions you probably don't want to block/cover your UI and this single control won't help you produce an infinite variety of perfect intricate UI interactions, but what it does provide is an 80-90% good-enough solution that can be applied quickly, easily and consistently to run tasks in the background, show progress and show basic UI notifications.
  • ThreadSwitcher - based on Raymond Chen's C++/WinRT envy: Bringing thread switching tasks to C# (WPF and WinForms edition) - this adds the ability to write 'await ThreadSwitcher.ResumeForegroundAsync();' and 'await ThreadSwitcher.ResumeBackgroundAsync();' to get onto/off of the UI Thread. While the MVVM pattern and Bindings can help you write code that doesn't have to be aware of which thread you are on I have found it impractical to produce a user friendly/focused WPF GUI code without needing to be able to switch to and away from the main UI thread. I have found using the ThreadSwitcer a pleasant and productive pattern in GUI code.
  • WindowScreenShot - It turns out that it is quite nice to get screen shots of your app's window but also quite tricky to get this to happen correctly in all situations... The ScreenShot control in this project is based on code from Capturing screenshots using C# and p/invoke.

ExcelInteropExtensions

A very useful approach to getting user data from Excel is reading directly from the Excel application. This can be messy (give the user any message/help you want but you will still spend time explaining that reading from Excel isn't working because they have a cell open for editing...) - but especially for power users it can avoid confusion over what data is saved vs on screen and can reduce repetitive steps like saving/picking/dragging/etc. This is not my first .NET journey into Excel interop code and if you are exploring this approach I encourage you to look at and/or reuse this code. It is very heavily based on Automate multiple Excel instances - CodeProject by James Faix. Faix's code, and other code in this vein, all ultimately link back to Andrew Whitechapel : Getting the Application Object in a Shimmed Automation Add-in (archived link) (the source I used in the mid-2000s when I first started to do .NET Excel Interop!).

Tools and Libraries

I am incredibly grateful to the all the people and projects that make it possible to rapidly build useful, open, low/no-cost software. Below is a mostly-up-to-date-and-largely-comprehensive list of tools/packages/libraries/etc. that are used to build the this project:

Tools:

Core Technologies:

Images:

Excel:

Maps/GIS:

Wpf:

Html:

Data Transfer:

General:

About

Pointless Waymarks Common Tools and Code

Resources

License

Stars

Watchers

Forks

Languages