• .NET

    WPF Line Drawing and the Device-Pixel-(In)dependence

    June 16, 2008 Share
    As you are probably aware resolution and device independence is one of the fundamental design goals of WPF. In order to achieve the desired effect the framework does not work directly with physical (device-dependent) pixels but abstracts this notion into device-independent measuring units like inches. There are two main benefits that you get from this: Automatic DPI-aware scaling Sub-pixel positioning -- WPF coordinates use floating point numbers that theoretically give you the ability to draw with higher precision than the one provided by the ordinary pixel grid. However, there is one nasty side-effect related to the fact that WPF graphics are anti-aliased by default...
  • .NET

    WPF Grids – to be or not to be

    Recently both Paul Stovell and Joseph Cooney blogged about one very interesting topic - "Do people really need grid controls in WPF?". They're saying that people actually don't need grids in WPF and this is what makes their blog posts worth reading. Imagine if they had said the opposite: "People need grid controls for WPF!". It would have been quite boring and wouldn’t have spurred much of a discussion. For many people the idea of not having grids for WPF sounds unconventional but Paul made an interesting parallel to justify his claim "Using grids in WPF is like buying a Ferrari to pick up...
    WPF
  • .NET

    WPF Series: IFrameworkElement - the missing interface

    June 10, 2008 Share
    If you are familiar with WPF you are aware that the the grand daddy of all controls is FrameworkElement. It is defined in the PresentationFramework.dll assembly and derives from UIElement (defined in PresentationCore.dll). Its purpose is to serve as a base element for all framework related stuff: styles, inheritance context, etc. However there is another framework element - FrameworkContentElement. The main distinct between them is that the later did not defines its own rendering behavior (its inheritors should do so). This is way properties like: (Actual)Width or (Actual)Height are not present at FrameworkContentElement. If you examine the classes that derive from FrameworkContentElement...
  • .NET

    RadControls for WPF CTP

    This week we are about to release a private CTP of RadControls for WPF. We will be sending the CTP build to all people who have previously requested WPF controls. If you still haven't requested WPF controls from our support or sales folks don't hesitate to drop them a line and we'll send you a build. If you're reading regularly the Telerik blogs may be you haven't missed Vassil's post about the Show Off videos which we prepared for MIX 08. In case you've watched carefully the "Telerik Resort Explorer" video you probably are asking yourself at least a couple of questions: 1) Oh my! Telerik will...
  • .NET

    WPF Series: Adorners, Commands and Logical Tree

    April 16, 2008 Share
    Today I'm going to tell you a WPF story. But before I start to dig deeper let me first introduce you the main characters in this post. Here they are: Adorner - adorners are simple UIElement decorators. Suppose that you have a RichTextBox and you want to place a comment box over it, so that users can comment on the text in the box. This can be archived with adorners. Actually the WPF framework uses adorners internally for exactly the same purpose when you edit and annotate FlowDocument in a DocumentViewer. This is the reason why adorners are in System.Windows.Documents namespace. Command - commands are UI...