WPF

TwitterFacebook
Get flash to fully experience Pearltrees
One of the great parts about commands in WPF is that they know if they can currently execute or not. When they cannot execute, the control(s) that are set to execute the command will be disabled automatically. For example, if your application has no changed data, the Save toolbar button will automatically be disabled, assuming its Command property is set to the Save command. WPF will automatically ask all of the commands being used in your UI if they can execute.

Allowing CommandManager to query your ICommand objects

http://joshsmithonwpf.wordpress.com/2008/06/17/allowing-commandmanager-to-query-your-icommand-objects/

Refresh / Update WPF controls

http://geekswithblogs.net/NewThingsILearned/archive/2008/08/25/refresh--update-wpf-controls.aspx Sometime in the past, a friend asked me how to update a control to show status while his code is doing a loop of stuff. Essentially changing the text of a label (or sophisticatedly we can say a text-based progress bar). In my past coding with MFC and WinForms, it's fairly easy enough, you just invalidate and do an update (Invalidate / UpdateWindow in MFC or Invalidate / Update in WinForms).
I've been playing around with WPF animation, and ended up wanting to take a snapshot of an animation at a specific place. Specifically, I have a canvas that has some pictures on it that are moving, and I want to be able to save a bitmap of what it looks like at a specific time. Getting the bitmap is pretty easy, using a RenderTargetBitmap and a VisualBrush. private BitmapSource CaptureScreen( Visual target) { http://blogs.msdn.com/b/ericgu/archive/2007/02/27/taking-snapshots-of-wpf-animation.aspx

Taking snapshots of WPF animation - Eric Gunnerson's Compendium

Introduction Over the past few months I have been creating a variety of WebControls some of which have needed access to a DataSource such as a DataSet in order to work properly. Adding a DataSource to your WebControl is relatively easy however the tricky part is when you need to interact with that property in the Properties window e.g. in the same manner as you would for a DropDownList control etc. Now if you are lucky and you get the query right in MSDN you will come across the following article Implementing a Web Forms Data-Bound Control Designer . However you will notice like I did that the sample just does not work as advertised. While attempting to debug it I posted a message on the microsoft.public.dotnet.framework.aspnet.webcontrols newsgroup and I received the following answer from Mike Moore "DataSource property and DataBinding thread" which eventhough was not 100% what I wanted put me on the right track.

Data Binding in WebControls

http://www.codeproject.com/Articles/2993/Data-Binding-in-WebControls
http://www.aspnet-answers.com/microsoft/Csharp/30271618/answer-removehide-the-name-property-for-a-control-in-a-propertygrid.aspx

ANSWER: Remove/Hide the (Name) property for a control in a propertygrid in C#

Asked By pigeonrandle on 04-Jul-07 07:56 PM Marc Gravell replied on 05-Jul-07 12:08 AM Was there a question?

Visual Studio WPF Designer Forum

http://social.msdn.microsoft.com/forums/en-US/vswpfdesigner/threads/ The Visual Studio WPF and Silverlight Designer Team is delighted to inform you that Visual Studio 2010 RTM is now available! Take a look at http://www.microsoft.com/visualstudio/en-us/download What's New for WPF and Silverlight Developers in Visual Studio 2010 ? 1.

Building a Perfect WPF Developer Workstation - Tim Sneath

Wonderful list of tools needed for any WPF developer. Although, I'd suggest other fonts as well - I find that switching between proggy square, inconsolata, consolas, etc.. gives me a little "boost" every time I switch. And, since you have the words "developer workstation" right in the description (and correct I may add), any chance of nudging the MSDN bean counters and saying "hey, Blend is indeed a developer tool"? Not having it included in MSDN is really, really frustrating to us that already accepted a nice big slap already with the different editions. If so, thanks! <p style="text-align:right;color:#A8A8A8"></p> http://blogs.msdn.com/b/tims/archive/2006/12/20/building-a-perfect-wpf-developer-workstation.aspx

Hosting a WPF Control in a Windows Forms Application - MHender Rambles On

(Blogging Tunes: Screaming Headless Torsos - "1995") We've talked about hosting Windows Forms controls in WPF applications, but what about the other way? 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. http://blogs.msdn.com/b/mhendersblog/archive/2005/10/03/476536.aspx
Contents Introduction A DataGrid is a user interface component for displaying tabular data to the user, typically providing sorting and editing functionality, among others. DataGrid s have been the work-horse of various frameworks such as ASP.NET ( GridView ) and Windows Forms ( DataGridView ). However, DataGrid s in WPF are rather conspicuous in their absence!

WPF DataGrid Practical Examples

http://www.codeproject.com/Articles/30905/WPF-DataGrid-Practical-Examples#layered

Styling Microsoft’s WPF datagrid - Jaime Rodriguez

Microsoft’s WPF datagrid has a lot of properties and styles you can tweak to get it looking right (if you are a designer). Below, find my cheat sheet to styling the grid. It is not 100% comprehensive but it gets you far and has a few very useful tips & gotchas. At the highest level in the DataGrid , you can change the look & feel by setting some of these: Here, you can see a visual representation for a few of these properties (the visual is not all inclusive); this will give you an idea of what this article will cover. Backgrounds: The interesting part are the relationships amongst the backgrounds: http://blogs.msdn.com/b/jaimer/archive/2009/01/20/styling-microsoft-s-wpf-datagrid.aspx
Introduction This article is about developing a XAML only WPF CheckListBox and ListBox with Selection Indicator control styles, and taking the same requirements and building a custom control that takes a very different approach to the problem. This article is about taking a concept and running with it. It's about this developer's desire to recreate a complex control using only XAML markup. We will explore the XAML only approach, then toss everything into a blender, and pour out two WPF Custom Controls using VB.NET. This article and its controls were inspired by Josh Smith's awesome article, The WPF Thought Process .

A WPF Problem Solved Two Very Different Ways - Using XAML Only - Using a Custom Control

WMF2WPF Library and command line tool Download WMF2WPF here See Help for instructions Paint.NET file type plugin Download WMFFileType here See Help for installation instructions

Download

WPF Enum List Converter

Introduction This article demonstrates how to bind a C# enum definition to a WPF ComboBox , which is not as simple as it first seems. The solution was extracted from a real-world commercial application. Background Enum definitions are great for defining small fixed lists of options for a property. They are easy to define in code, and are strongly typed, so they help produce robust code.

Drag &amp; drop in WPF part2 ... - Jaime Rodriguez

Last part, we focused on the drag... In this part we will focus on drop (which is relatively straight forward) ... DropTargets must set AllowDrop = true It all begins with a Visual Element setting its AllowDrop to true; this tells the D&D subsystem your control is a drop target ...