Blog

Page 49 of my articles, tutorials, and thoughts

Latest Articles

Cover Image for Data binding to SelectedItem in a WPF Treeview
c#

Data binding to SelectedItem in a WPF Treeview

Published on September 2, 2023

# Data Binding to SelectedItem in a WPF Treeview 🌳 So, you want to retrieve the selected item in a WPF Treeview and bind it to a property in your Model? šŸ¤” You might think that using the `SelectedItem` property would do the trick, but it turns out that

Cover Image for Text vertical alignment in WPF TextBlock

Text vertical alignment in WPF TextBlock

Published on September 2, 2023

šŸ¤” How to Vertically Align Text in a WPF TextBlock? Let's Dig In! 🧐 Have you ever wondered how to achieve vertical center alignment for the text inside a TextBlock in a WPF application? You stumble upon the TextAlignment property, but it only seems to ha

Cover Image for How should the ViewModel close the form?
c#

How should the ViewModel close the form?

Published on September 2, 2023

# How to Close the Form with ViewModel in MVVM šŸ—ļø Building a WPF application with the MVVM pattern but stuck on how to close the form from the ViewModel? Don't worry, you're not alone! Many developers face this challenge when trying to separate the view

Cover Image for How to automatically select all text on focus in WPF TextBox?
.net

How to automatically select all text on focus in WPF TextBox?

Published on September 2, 2023

šŸ”šŸ’­ Looking for a way to automatically select all text on focus in a WPF TextBox? šŸ¤” No worries, I've got you covered! In this blog post, I'll address the common issue of the selection disappearing when using the mouse, provide easy solutions, and even sh

Cover Image for ResourceDictionary in a separate assembly
.net

ResourceDictionary in a separate assembly

Published on September 2, 2023

# Sharing ResourceDictionaries Across Multiple Applications āœ… **Problem:** You have multiple resource dictionary files that you want to use in separate applications. Instead of adding them to each application's assembly, you want to compile them into a si

Cover Image for Simple (I think) Horizontal Line in WPF?

Simple (I think) Horizontal Line in WPF?

Published on September 2, 2023

## How to Add a Simple Horizontal Line in WPF šŸŒ‰ So, you're building a data entry form in WPF and want to add a horizontal line to separate certain sections? Easy peasy! We've got you covered! Here's how you can do it without any hassle. ### The Problem

Cover Image for Databinding an enum property to a ComboBox in WPF
.net

Databinding an enum property to a ComboBox in WPF

Published on September 2, 2023

šŸ“ **Tech Blog: Databinding an Enum Property to a ComboBox in WPF** šŸ–„ļø Are you struggling with databinding an enum property to a ComboBox in WPF? šŸ¤” Don't worry, I've got you covered! In this blog post, I'll walk you through the common issues you might e

Cover Image for How to bind to a PasswordBox in MVVM
c#passwords

How to bind to a PasswordBox in MVVM

Published on September 2, 2023

# How to Bind to a PasswordBox in MVVM šŸ”’ In MVVM, binding a PasswordBox can be a bit tricky since the Password property is not directly bindable due to security reasons. But fear not! We have a solution for you. Let's dive in and explore how to effective

Cover Image for Page vs Window in WPF?
c#

Page vs Window in WPF?

Published on September 2, 2023

šŸ“ **Page vs Window in WPF: Understanding the Difference** Are you often confused about the difference between a Page and a Window when it comes to creating new files in WPF? šŸ¤” Don't worry, you're not alone! Many developers struggle to understand the nua

Cover Image for How can I find WPF controls by name or type?

How can I find WPF controls by name or type?

Published on September 2, 2023

šŸ”ŽšŸ¤” How to Find WPF Controls by Name or Type: A Complete Guide šŸ–„ļøšŸ”šŸ”¢ Are you struggling to unearth those elusive WPF controls that match a specific name or type? 😫 Don't sweat it – I've got your back! In this blog post, we'll tackle the common problem