# WPF

WPF is a Windows Presentation Foundation UI framework in .NET for building Windows applications, offering XAML, controls, data binding, layout, graphics, animation, and related application-development features.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## Creating custom PowerToys Run plugins

DevFeed: [Creating custom PowerToys Run plugins](<https://devfeed.tech/articles/creating-custom-powertoys-run-plugins-20777.md>)

Original publisher: [Read original article](<https://conductofcode.io/post/creating-custom-powertoys-run-plugins/>)

Author: {"twitter"=\>"hlaueriksson"}

Published: 2024-02-13T22:00:00Z

Content type: tutorial

Language: en

Sources: [Henrik Lau Eriksson](<https://devfeed.tech/sources/henrik-lau-eriksson.md>)

Topics: [Microsoft PowerToys](<https://devfeed.tech/topics/powertoys.md>), [Development](<https://devfeed.tech/topics/development.md>), [Visual Studio](<https://devfeed.tech/topics/visual-studio.md>), [GitHub](<https://devfeed.tech/topics/github.md>), [WPF](<https://devfeed.tech/topics/wpf.md>), [NuGet](<https://devfeed.tech/topics/nuget.md>)

Tags: [blog](<https://devfeed.tech/tags/blog.md>), [c-sharp](<https://devfeed.tech/tags/c-sharp.md>), [github](<https://devfeed.tech/tags/github.md>), [guide](<https://devfeed.tech/tags/guide.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [net](<https://devfeed.tech/tags/net.md>), [nuget](<https://devfeed.tech/tags/nuget.md>), [nuget-package](<https://devfeed.tech/tags/nuget-package.md>), [plugins](<https://devfeed.tech/tags/plugins.md>), [powertoys](<https://devfeed.tech/tags/powertoys.md>), [run](<https://devfeed.tech/tags/run.md>), [visual-studio](<https://devfeed.tech/tags/visual-studio.md>)

### AI overview

A step-by-step guide to creating community plugins for PowerToys Run, covering project setup, Visual Studio, WPF dependencies, metadata, and NuGet packages.

### Source excerpt

A step by step guide on how to create community plugins for PowerToys Run

## Keygenning with KLEE

DevFeed: [Keygenning with KLEE](<https://devfeed.tech/articles/keygenning-with-klee-39699.md>)

Original publisher: [Read original article](<https://doar-e.github.io/blog/2015/08/18/keygenning-with-klee/>)

Author: Michele "brt\_device" Bertasi

Published: 2015-08-19T05:12:00Z

Content type: tutorial

Language: en

Sources: [Diary of a reverse-engineer](<https://devfeed.tech/sources/diary-of-a-reverse-engineer.md>)

Topics: [Software](<https://devfeed.tech/topics/software.md>), [Code](<https://devfeed.tech/topics/code.md>), [debug](<https://devfeed.tech/topics/debug.md>), [Linux](<https://devfeed.tech/topics/linux.md>), [gcc](<https://devfeed.tech/topics/gcc.md>), [Scripting, bash](<https://devfeed.tech/topics/scripting-bash.md>), [WPF](<https://devfeed.tech/topics/wpf.md>)

Tags: [code](<https://devfeed.tech/tags/code.md>), [debugging](<https://devfeed.tech/tags/debugging.md>), [gcc](<https://devfeed.tech/tags/gcc.md>), [ida](<https://devfeed.tech/tags/ida.md>), [ida-pro](<https://devfeed.tech/tags/ida-pro.md>), [linux](<https://devfeed.tech/tags/linux.md>), [reverse-engineering](<https://devfeed.tech/tags/reverse-engineering.md>), [scripting](<https://devfeed.tech/tags/scripting.md>), [software](<https://devfeed.tech/tags/software.md>), [symbolic-execution](<https://devfeed.tech/tags/symbolic-execution.md>), [virtual-machine](<https://devfeed.tech/tags/virtual-machine.md>), [windbg](<https://devfeed.tech/tags/windbg.md>)

### AI overview

This article examines the reverse engineering of a software serial-number validation process and describes using the KLEE symbolic virtual machine to build a key generator. It also discusses tools and practices including IDA Pro, WinDbg, Linux, gcc, Bash scripting, and a WPF application.

### Source excerpt

Introduction In the past weeks I enjoyed working on reversing a piece of software (don't ask me the name), to study how serial numbers are validated. The story the user has to follow is pretty common: download the trial, pay, get the serial number, use it in the annoying nag ...

## Setting up a WPF Application With PRISM

DevFeed: [Setting up a WPF Application With PRISM](<https://devfeed.tech/articles/setting-up-a-wpf-application-with-prism-21199.md>)

Original publisher: [Read original article](<https://juri.dev/blog/2013/06/setup-wpf-with-prism/>)

Published: 2013-06-25T00:00:00Z

Content type: tutorial

Language: en

Sources: [Juri Strumpflohner](<https://devfeed.tech/sources/juri-strumpflohner.md>)

Topics: [WPF](<https://devfeed.tech/topics/wpf.md>), [NuGet](<https://devfeed.tech/topics/nuget.md>), [Visual Studio](<https://devfeed.tech/topics/visual-studio.md>), [modules](<https://devfeed.tech/topics/modules.md>), [ui](<https://devfeed.tech/topics/ui.md>)

Tags: [design-patterns](<https://devfeed.tech/tags/design-patterns.md>), [desktop](<https://devfeed.tech/tags/desktop.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [modules](<https://devfeed.tech/tags/modules.md>), [nuget](<https://devfeed.tech/tags/nuget.md>), [plugins](<https://devfeed.tech/tags/plugins.md>), [visual-studio](<https://devfeed.tech/tags/visual-studio.md>)

### AI overview

A tutorial on setting up a Windows Presentation Foundation (WPF) application with PRISM. It covers creating a WPF project, installing PRISM dependencies through NuGet, creating an application bootstrapper, and configuring a shell and modules using MEF for a modular plugin-based architecture.

### Source excerpt

Lorem ipsum dolor sit amet

## Building advanced MVVM commands, Part 1

DevFeed: [Building advanced MVVM commands, Part 1](<https://devfeed.tech/articles/building-advanced-mvvm-commands-part-1-38403.md>)

Original publisher: [Read original article](<https://khmylov.com/2010/11/building-advanced-mvvm-commands-part-1/>)

Author: Andrew Khmylov

Published: 2010-11-24T00:00:00Z

Content type: tutorial

Language: en

Sources: [Despite the odds](<https://devfeed.tech/sources/despite-the-odds.md>)

Topics: [MVVM](<https://devfeed.tech/topics/mvvm.md>), [WPF](<https://devfeed.tech/topics/wpf.md>), [async](<https://devfeed.tech/topics/async.md>), [cancellation](<https://devfeed.tech/topics/cancellation.md>), [Exception](<https://devfeed.tech/topics/exception.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [applications](<https://devfeed.tech/tags/applications.md>), [async](<https://devfeed.tech/tags/async.md>), [asynchronous](<https://devfeed.tech/tags/asynchronous.md>), [cancellation](<https://devfeed.tech/tags/cancellation.md>), [exception-handling](<https://devfeed.tech/tags/exception-handling.md>), [mvvm](<https://devfeed.tech/tags/mvvm.md>), [thread](<https://devfeed.tech/tags/thread.md>), [ui](<https://devfeed.tech/tags/ui.md>)

### AI overview

This tutorial presents an advanced DelegateCommand implementation for WPF and Silverlight applications using the MVVM pattern. It covers asynchronous execution, command states, cancellation, progress tracking, exception handling, UI updates through Dispatcher, and helper support for property-change notifications.

### Source excerpt

If you follow the MVVM pattern while developing your WPF/Silverlight applications, then you are probably familiar with DelegateCommand (or RelayCommand, as it is called sometimes) model. In brief: it is an implementation of WPF/Silverlight ICommand that allows you to specify what the command should do by passing some delegate that performs execution logic (instead of using CommandBindings). Pretty simple, but powerful pattern. Dealing with MVVM a lot, I've build my own implementation of this pattern that lets you simplify its usage. Here are some common features, that you have to handle on your own by using classic DelegateCommand: Support for asynchronous execution (usually solved by generating additional code in ViewModel that handles async calls and free/busy indicator). Different command states (Free/Busy/Failed with exception) + UI reactions for those states. Support for execution cancellation and progress tracking (required for asynchronous commands) Before we start, I offer you to imagine a common command execution timeline. In my opinion it looks like: Initialize some data (generally, UI settings - clear collections, set some indicators,...) Perform main execution logic (can be synchronous or asynchronous) Perform some actions after execution (update UI based on execution result) And don't forget about exception handling and correct cross-thread calls for asynchronous commands (all UI changes have to be performed through Dispatcher). Let's start with a little helper class, that I called PropertyChangedNotifier. It's just a wrapper around IPropertyChangedNotifier that has OnPropertyChanged(string propertyName) method. This method raises underlying IPropertyChangedNotifier.PropertyChanged event. Also this class has VerifyPropertyName method that verifies if specified string corresponds to the actual property (this method is marked with [Conditional("DEBUG")] attribute and is only used while debugging your applications to find out possible bugs with invalid prope

## WPF/Silverlight visual states with DataTemplates

DevFeed: [WPF/Silverlight visual states with DataTemplates](<https://devfeed.tech/articles/wpf-silverlight-visual-states-with-datatemplates-38405.md>)

Original publisher: [Read original article](<https://khmylov.com/2010/11/wpf-silverlight-visual-states-with-datatemplates/>)

Author: Andrew Khmylov

Published: 2010-11-19T00:00:00Z

Content type: tutorial

Language: en

Sources: [Despite the odds](<https://devfeed.tech/sources/despite-the-odds.md>)

Topics: [WPF](<https://devfeed.tech/topics/wpf.md>), [XAML](<https://devfeed.tech/topics/xaml.md>), [MVVM](<https://devfeed.tech/topics/mvvm.md>), [ui](<https://devfeed.tech/topics/ui.md>)

Tags: [mvvm](<https://devfeed.tech/tags/mvvm.md>), [progress](<https://devfeed.tech/tags/progress.md>), [screen](<https://devfeed.tech/tags/screen.md>), [state](<https://devfeed.tech/tags/state.md>), [threading](<https://devfeed.tech/tags/threading.md>), [xaml](<https://devfeed.tech/tags/xaml.md>)

### AI overview

This tutorial presents a WPF technique for switching among page, window, or control states by defining different DataTemplates. It contrasts this approach with VisualStateManager and Silverlight Activity Control, then demonstrates a welcome screen and a busy-progress state backed by a ViewModel.

### Source excerpt

Consider a common task - you need to switch between different screens in your application, that represent various states (e.g. Normal/Loading/Error). How are you going to implement this? You can start with VisualStateManager and define appropriate visual states. Well, this will surely do the thing, but you will have to create lots of controls and manage their Visibility or Opacity. And what if you have a complex markup? And I suppose that switching the state will not remove invisible items from the visual tree. And even more, with VisualStateManager you are bound to Expression Blend, because, you know, it's not very convenient to edit VSM settings by hands in XAML (which I prefer, but it is a topic for another article). The second option that may fit well, if you just need something like "I'm busy!" overlay is Silverlight Activity Control. Works like a charm with RIA services, but I find it limited for complex scenarios (and it's not available for WPF). I've found another approach (it becomes especially useful with MVVM and improved DelegateCommand implementations - I will blog about this in a few days). The idea behind this technique is quite simple. You define different templates for different page/window/control states. Yeah, that's it. Let's start with our implementation. Our application will have only one page with 2 different states: A welcome screen, that hosts a button to start 'the heavy' calculation. Busy window" that shows information about the current processing progress. I decided to create a simple ViewModel as a backing storage for our UI properties. It has two properties - IsBusy that says whether some hard work is executing now, and Progress - simple execution progress indicator. Method StartCalculation runs a new thread executes a number of loop steps. On each step the executing thread is suspended for 100ms (to imitate a slow operation). Normally you will create a DelegateCommand that will handle all the execution logic, but I decided to keep thin

## WPF Explorer TreeView with SelectedPath binding

DevFeed: [WPF Explorer TreeView with SelectedPath binding](<https://devfeed.tech/articles/wpf-explorer-treeview-with-selectedpath-binding-38404.md>)

Original publisher: [Read original article](<https://khmylov.com/2010/11/wpf-explorer-treeview-with-selectedpath-binding/>)

Author: Andrew Khmylov

Published: 2010-11-18T00:00:00Z

Content type: tutorial

Language: en

Sources: [Despite the odds](<https://devfeed.tech/sources/despite-the-odds.md>)

Topics: [WPF](<https://devfeed.tech/topics/wpf.md>), [Filesystems](<https://devfeed.tech/topics/filesystems.md>), [lazy loading](<https://devfeed.tech/topics/lazy-loading.md>)

Tags: [build](<https://devfeed.tech/tags/build.md>), [file](<https://devfeed.tech/tags/file.md>), [lazy-loading](<https://devfeed.tech/tags/lazy-loading.md>)

### AI overview

This tutorial describes a custom WPF TreeView control for browsing file systems and exposing a SelectedPath property for two-way binding. It uses lazy loading to populate drives and subfolders, and synchronizes the TreeView selection with the selected path.

### Source excerpt

While working on one of my projects, I had to implement a control for displaying file system. I found pretty good articles over the web ("A Simple WPF Explorer Tree" by Sacha Barber and some replies to it), but they were all about displaying folders. It was pretty easy to track currently selected folder, but there were some issues with its dynamic changes. So I decided to build my own control from scratch that will have some property like SelectedPath that will allow you to use TwoWay bindings to get and set selected folder at the tree. When user selects a node from the TreeView, text in the address bar is updated. When user enters address and clicks Update, TreeView selection gets updated. I have started with a simple CustomControl and inherited it from WPF TreeView: public class ExplorerTreeView: TreeView { public const string SelectedPathPropertyName = "SelectedPath"; public static readonly DependencyProperty SelectedPathProperty = DependencyProperty.Register( SelectedPathPropertyName, typeof (String), typeof (ExplorerTreeView)); public String SelectedPath { get { return (String) GetValue(SelectedPathProperty); } set { SetValue(SelectedPathProperty, value); } } } We will use some lazy-loading techniques to fill our TreeView with data. When control is loaded, it will display only drives on the user machine. Let's write a method for creating initial drive nodes: public void InitExplorer() { Items.Clear(); foreach (var drive in DriveInfo.GetDrives()) { Items.Add(GenerateDriveNode(drive)); } } private static TreeViewItem GenerateDriveNode(DriveInfo drive) { var item = new TreeViewItem { Tag = drive, Header = drive.ToString() }; item.Items.Add("*"); return item; } GenerateDriveNode method takes DriveInfo argument and builds TreeViewItem for it. Note that we are adding a dummy child node (the one with 'the star' header text). If we don't do this, then the user will not see a small button for expanding/collapsing for generated tree view item (it may look like '+' charac