Alexey Golub
homeprojectsblogtalks
Formatting XAML files on build with XAMLStyler
09 January 2020 9 minutes to read
Recently, I’ve decided to switch from Visual Studio to Rider as my default .NET development environment. The main problem with Visual Studio was that was too slow when paired with ReSharper and, unfortunately, too useless when not. Rider offered me the best of both worlds. However, one of the things that made the jump really difficult was the… continue reading
04 January 2020 21 minutes to read
Two months ago I wrote an article about monadic parser combinators in C# and how you can use this approach to express complex recursive grammar. To extend this topic a bit, I also wanted to show how the same approach can be applied in a functional-first language such as F#. FParsec may not be the only, but is definitely the most popular F… continue reading
10 November 2019 15 minutes to read
The concept of parsing has always seemed very complicated to me. I thought that to work in this area you had to have access to some secret knowledge brought by an alien race or something. Some time ago, I had to implement proper markdown parsing in DiscordChatExporter so that I could replace the ineffective regular expressions I had been using. I… continue reading
26 January 2019 5 minutes to read
I’m sure everyone with at least some background in C# is aware of extension methods — a nice feature that lets developers extend existing types with new methods. This is extremely convenient in cases where you want to add functionality to types you don’t have control over. In fact, I think everyone at some point authored extensions for the base… continue reading
23 December 2018 4 minutes to read
I have always been trying to be a well-organized person, but for the most part I was doing it wrong. I was lacking in ability to plan and stay focused, which made it seem like I was productive, despite not having any tangible progress towards the goals that really matter. It can be very difficult to stay on top of things and have a clearly defined… continue reading
18 February 2018 4 minutes to read
Cognitive biases impact our perception of reality, driving us into making incorrect conclusions and irrational decisions. The topic’s relevancy to software development has already been covered in many places (one, two, three) but I would like to add on by discussing a few cases that haven’t been mentioned before. Survivorship bias Survivorship bias… continue reading
15 December 2017 22 minutes to read
Almost a year ago, I started developing YoutubeExplode, a library that scraps information on YouTube videos and lets you download them. Originally, my main motivation for developing it was simply gaining experience since this task involved a lot of research and reverse-engineering. Nowadays, YoutubeExplode is arguably the most consistent and robust… continue reading
18 November 2017 4 minutes to read
Quite a long time ago I’ve stumbled upon a very interesting open source project called AmmyUI. Its main goal is to make designing XAML apps a lot better by… removing XAML from the equation. Ammy is a JSON-like layout language which compiles to XAML and also has some cool extra features. I’ve never been a big fan of XAML, so it got me interested and… continue reading
16 November 2017 1 minute to read
Web applications hosted in IIS adhere to the Idle Timeout setting. It defines a time period of inactivity after which an application is shut down. Subsequent requests will trigger the application to start up again, but it usually takes a while — this rather small ASP.net Core website takes around 10 seconds to start and respond to the first request… continue reading
05 November 2017 3 minutes to read
New csproj format, among other things, has an option to generate a NuGet package on every successful build. It resolves dependencies, target frameworks and documentation automatically and doesn’t require a predefined nuspec file as all metadata is now also part of the csproj file. Sometimes NuGet packages may require additional files to work — a… continue reading
02 February 2017 4 minutes to read
GUI applications sometimes offer a way for users to configure hotkeys, typically using a textbox that records combination of key presses inside of it. Such control doesn’t come out of the box with WPF but we can implement it ourselves. Hotkey class WPF has two useful enumerations for this task — System.Windows.Input.Key and System.Windows.Input… continue reading
02 February 2017 3 minutes to read
WndProc is a callback function that takes care of system messages sent from the operating system. Unlike WinForms, in WPF, it’s not directly exposed to you as it’s hidden by the framework’s layer of abstraction. There are times, however, when you need to process these messages manually, for example when dealing with WinAPI. Let’s look at some ways… continue reading
01 November 2016 6 minutes to read
For some unclear reasons, WPF’s ListBox control does not allow two-way binding on SelectedItems property the way it does with SelectedItem. This could have been very useful when using multi-select to bind the whole list of selected items to the view model. Interestingly, you can still call Add(), Remove(), Clear() methods on ListBox.SelectedItems… continue reading
30 October 2016 6 minutes to read
The longer I work with WPF, the more I notice how many things it’s missing. Recently I realized that TreeView.SelectedItem property is read-only and non-bindable. I think there’s no point explaining why binding SelectedItem would be useful, so there should be no surprise in my disappointment. I googled the problem and every resource I’ve found was… continue reading
29 October 2016 1 minute to read
As any WPF developer knows, XAML can get messy due to all the nested elements and indentation. One common problematic area is data templates — they are naturally decoupled from the surrounding layout but are still nested quite deep in the hierarchy. To deal with it, you can refactor some of the commonly used objects as resources into a… continue reading
28 October 2016 2 minutes to read
Sometimes you may find yourself facing a problem of having to switch between multiple presentations based on some condition. For example, you may want to display the same list of items differently depending on whether multiselect is enabled or not. The easiest and the most obvious way to achieve this is to bind the Visibility property of the… continue reading
26 September 2015 4 minutes to read
At some point, I was contracted to make a WordPress plugin that displays some basic information on an item from Steam Market. It had to show its name, image and the current lowest price. I was initially hoping that there would be some sort of API for this but unfortunately there isn’t. Probably because it would make developing bots a bit too easy… continue reading