background preloader

WPF Controls

Facebook Twitter

TabControl

TreeView. RadioButton. Using Hyperlink in WPF application. Introducing the WPF 4 Calendar. WPF 4 now includes, in the core runtime libraries, the calendar control.

Introducing the WPF 4 Calendar

This control previously existed only in the WPF Toolkit, but has been promoted in the latest WPF release. Inclusion in the core runtime library makes it easier to develop with as there is no additional namespace declaration or reference required. The Calendar control is located in the System.Windows.Controls namespace in the PresentationFramework DLL. Let’s start with the key properties and then move on to a couple common tasks such as scaling and binding. Key Properties DisplayDate, SelectedDate and SelectedDates When the control is first displayed, a date is shown highlighted – the DisplayDate. Use the SelectedDate scalar property when the calendar is in SingleDate selection mode. Hosting a WPF Control in a Windows Forms Ap. (Blogging Tunes: Screaming Headless Torsos - "1995") We've talked about hosting Windows Forms controls in WPF applications, but what about the other way?

Hosting a WPF Control in a Windows Forms Ap

You may very well want to just keep your existing Windows Forms application and "sprinkle" in some WPF sweetness in strategic places. That means you will need some means to be able to place WPF controls side-by-side with Windows Forms controls. Is it do-able? Well, if it weren't, I probably wouldn't have a blog entry on the subject now would I? So what we'll do is create the converse of our other application that demonstrated hosting a Windows Forms ListBox in a WPF application. First step is to create a Windows Forms application using Visual Studio (VS): Next we'll need to add reference to the WPF namespaces and the System.Windows.Forms.Integration namespace: Note that you will need the following references: PresentationCore, PresentationFramework, UIAutomationProvider, UIAutomationTypes, WindowsBase.

AutoCompleteBox: Now with 100% more WPF. Thanks to the work of the WPF Toolkit team (and especially Patrick Danino ), the February 2010 release of the WPF Toolkit includes as new components AutoCompleteBox , plus Accordion and Rating as well. Resources All of my AutoCompleteBox-related blog posts Posts about this release: David Anson’s , Patrick Danino’s when we began our Silverlight Toolkit journey a few years ago, we became immediate advocates within the organization for compatibility with WPF, often building our controls to cross-compile, even if we didn’t have an immediate shipping plan for the WPF builds. David sort of led the way here by offering his own unofficial gray market versions of his charting and data visualization controls for WPF. It’s nice to see things get out there in a more official mechanism, I know of many people enjoying the new-and-improved WPF Toolkit. Charting in WPF. Charting in WPF The WPF Toolkit released in June 2009 comes with a data visualization assembly called System.Windows.Controls.DataVisualization.Toolkit.dll that hosts the charting functionality in WPF.

Charting in WPF

This article demonstrates how to draw charts using the WPF Toolkit. WPF Wizard Control - Part I. Writing a custom wizard control (or simply a control of any kind) in many widely used GUI toolkits is usually a challenging task.

WPF Wizard Control - Part I

But it turns out that doing such a control in WPF is rather easy. In this post, I'm going to explain how to create stylable, simple wizard that looks like this: I recommend briefly examining attached source code before reading the post because the code is not short enough to be pasted on a blog. Still reading "pure" text without the code is far from being nice :) As you probably know, WPF defines so called look less controls. The first decision I had to take was the class I needed to inherit from. As you may have already guessed, single wizard page is represented by WizardPage class. The Wizard class contains two important dependency properties - ActivePage and ActivePageIndex. 226 private static void OnActivePageIndexChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) 228 Wizard wizard = (Wizard)d; 229 int index = (int)e.NewValue;

WPF Wizard Control - Part II. In my previous post about rolling your own WPF wizard control, I've described how one can easily create simple, styleable wizard in WPF.

WPF Wizard Control - Part II

Generally, I blogged that the wizard consists of two things, namelyWizard class - representing the wizard with its buttons (Next, Previous, Finish, etc.) and simple behavior concerned around managing which wizard page should be displayed,WizardPage class - representing a container for a single wizard page.The first class inherited from the Control class whereas the second inherited from the ContentControl class. Because the Wizard class wasn't derived from any control that can have content, it had to have a bindable collection of wizard's pages. Thus, I brought WizardPagesCollection class into play, which was defined as follows: 3 /// Wizard pages collection. 5 public class WizardPagesCollection : ObservableCollection<WizardPage> A better Solution Fortunately, it is very easy to overcome these problems, even without modifying wizard's template!

10 set.