Tag Archives: C#

Organising custom Commands in a WPF TreeView using the Model-View-ViewModel design pattern

In my current project’s interface, the main elements of the GUI are a TabControl holding any number of workspaces, and a side panel with commands to launch the desired workspaces. It is closely based on a MVVM demo I saw, … Continue reading

Posted in Software Development | Tagged , , , , , , , , , , , | Leave a comment

Generating Smarter Visual Studio Code Snippets Using T4 Templates

The last formal tip in The Pragmatic Programmer urges the reader to “Sign Your Work”, and states that, at the very least, each code file should have the author’s name and the creation date as a comment at the top. … Continue reading

Posted in Software Development | Tagged , , , , , , , | Leave a comment

Replacing a delegate with an inline lambda expression: Improvements on an MS Exams Custom WPF Control example

I was dusting off my WPF skills when I took a look at the Custom WPF Control example in this book: MCTS Self-Paced Training Kit (Exam 70-511): Windows Application Development with Microsoft .NET Framework 4 The example, in Chapter 5 … Continue reading

Posted in Software Development | Tagged , , | Leave a comment

Rounding doubles in C#

Don’t trust Math.Round(), and a workaround Turns out Math.Round() can give you some nasty surprises when applied to doubles: The application I’m working on does a lot of complicated calculations of construction costs. The inputs all come from a SQLite … Continue reading

Posted in Software Development | Tagged , | Leave a comment