Lester's WPF\SL Blog


Simple, Easy & Beautiful


 

October, 2009

Blog - Post Feedback Form(CAPTCHA)
  • Lester's WPF\Silverlight Blog

    New WPF Features: LayoutRounding

    • 3 Comments
    This is part of a series on New WPF Features LayoutRounding - If you are familiar with Silverlight, this is nothing new. If you are unfamiliar with it, all it does is that it rounds up lengths.. Take for example the code below (hypothetical case) < Border Width ="33.9111111" Height ="80.11111" BorderBrush ="Red" Margin ="2.1222222" BorderThickness ="3.955"> < Border Width ="15.3333333" Height ="40.11111" BorderBrush ="Black" Margin ="2.3333333" BorderThickness ="3.89898555"></ Border > The one on the left is a bit blurry due to the subpixel positioning and doesnt use LayoutRounding. The one on the left is rendered with LayoutRounding and has crisper lines. The property to enable LayoutRounding is UseLayoutRounding...
  • Lester's WPF\Silverlight Blog

    New WPF Features: Key\Gesture Binding

    • 6 Comments
    This is part of a series on New WPF Features We got a lot of feedback to improve the way a developer could set binding to the input keys and modifiers. Earlier, the command property on the inputbinding class was not a Dependency property - so binding to it was out of question. Also it didnt inherit the datacontext of the parent. There are workarounds and most likely you would be doing something like the below as is done in the CoreMVVM libraries. < Window.Resources > <!-- Allows a KeyBinding to be associated with a command defined in the View Model --> < c : CommandReference x : Key ="ExitCommandReference" Command ="{ Binding ExitCommand }" /> </ Window.Resources > < Window.InputBindings > <...
  • Lester's WPF\Silverlight Blog

    New WPF Features: ClearTypeHint

    • 0 Comments
    This is part of a series on New WPF Features WPF enforces grayscale rendering when text is rendered on a transparent area. However, its possible that the background of a control is opaque even though its inside a transparent area. For example, popups have rounded edges and will have the allowstransparency property set. Same is the case with transparent windows. Now in .NET 4, we provide the developer to decide whether to render with cleartype or not. The way to do this is to set the RenderOptions.ClearTypeHint property. RenderOptions.ClearTypeHint ="Enabled" This forces the rendering engine to enable Cleartype for the subtree. Intermediate render targets, such as Effect, OpacityMask, VisualBrush, DrawingBrush, Clip, and Opacity...
  • Lester's WPF\Silverlight Blog

    New WPF Features: CaretBrush\SelectionBrush

    • 4 Comments
    This is part of a series on New WPF Features There have been quite a few asks for changing the selection color and the caret color. We have now provide 2 properties to make this possible CaretBrush SelectionBrush An example usage would be like SelectionBrush ="RED" SelectionOpacity ="0.3" (Default value is 0.6) CaretBrush ="Red " These properties are avaialble on controls that allow selection\caret. Share this post
  • Lester's WPF\Silverlight Blog

    New WPF Features: Custom Speller Dictionary

    • 4 Comments
    This is part of a series on New WPF Features In previous versions, adding a custom dictionary was an unsupported scenario. You could still do it but it required writing a bunch of code. In this release, we have provided suport for adding custom dictionaries. < RichTextBox FontSize ="24" SpellCheck.IsEnabled ="true" > < SpellCheck.CustomDictionaries > < sys:Uri > Dictionary1.lex </ sys:Uri > < sys1:Uri > \\dictServer\Dictionary3.txt </ sys1:Uri > </ SpellCheck.CustomDictionaries > < FlowDocument > < Paragraph > Some Names: Zorig Lester </ Paragraph > < Paragraph > Misspelled: Zorg BlahBlah </ Paragraph > </ FlowDocument > </ RichTextBox...
  • Lester's WPF\Silverlight Blog

    New WPF Features: Jumplists

    • 7 Comments
    This is part of a series on New WPF Features Jumplists is a feature of Win7 where in you can the context menu is richer than the usual close\restore options. WPF provides a managed API to work with these features in Win7. Now that we have seen how it looks like, lets look at how its created [Thanks to Andre for the initial code :) ] Setting up the jumplist is simple and API is really easy for addition\deletion of items JumpList jumpList = new JumpList (); JumpList .SetJumpList( Application .Current, jumpList); JumpTask jumpTask = new JumpTask (); jumpTask.Title = jumpTask.Description = namesToUse[ 0 ]; jumpTask.CustomCategory = "DocumentApps" ; jumpTask.ApplicationPath = "notepad.exe" ; jumpList.JumpItems...
  • Lester's WPF\Silverlight Blog

    New WPF Features: Easing Functions

    • 1 Comments
    This is part of a series on New WPF Features Easing functions enables adding custom math formulas to your animations. The animations also looks more realistic and smoother. WPF now provides this functionality and as in SL there are 11 such inbuilt functions. Each of these come with 2 Easing Modes - EaseIn,EaseOut,EaseInOut. The functions for the EaseIn Mode are shown below. < BackEase Amplitude ='1' EasingMode ='EaseIn' /> < BounceEase Bounces ='3' Bounciness ='2' EasingMode ='EaseIn'/> < CircleEase EasingMode ='EaseIn' /> < CubicEase EasingMode ='EaseIn' /> < ElasticEase EasingMode ='EaseIn' Oscillations ='3' Springiness ='3' /> < ExponentialEase EasingMode ='EaseIn' /> < PowerEase...
  • Lester's WPF\Silverlight Blog

    New WPF Features: TextFormattingMode for clear text

    • 9 Comments
    This is part of a series on New WPF Features Now there has been feedback since 3.0 that the WPF text doesnt render clearly when the fontsizes are smaller. So for .NET 4 we forked on this issue and fixed it by introducind the property TextOptions.TextFormattingMode. The default value is ideal which is what we have currently. The other option is Display and it makes small text look crisper and clear. Lets see it in action < StackPanel xmlns ='http://schemas.microsoft.com/winfx/2006/xaml/presentation' xmlns:x ='http://schemas.microsoft.com/winfx/2006/xaml'> < TextBox TextOptions.TextFormattingMode ="Ideal" FontSize ="10"> HELLO WORLD </ TextBox > < TextBox TextOptions.TextFormattingMode ="Display" FontSize...
  • Lester's WPF\Silverlight Blog

    VS 2010\.NET 4 Beta2 available for download

    • 0 Comments
    Visual Studio 2010 and .NET Framework 4 Beta 2 will be available to MSDN subscribers, with general availability on October 21. The official launch of Visual Studio 2010 and .NET Framework 4 is March 22, 2010. For info about packaging, pricing, and licensing take a look at the new VisualStudio site Share this post
  • Lester's WPF\Silverlight Blog

    CoreMVVM - now on Codeplex

    After the last post , got quite a few requests to put it on Codeplex. So here it goes : http://coremvvm.codeplex.com/ Share this post
  • Lester's WPF\Silverlight Blog

    CoreMVVM: A basic MVVM framework

    • 1 Comments
    CoreMVVM download (for those in a hurry :) ) The MVVM Toolkit is a pretty barebones template for MVVM and is a good place to start with if you are new to this pattern. Over time, as i played around with this toolkit, the library grew in size. Its been useful for me - so i thought i might as well share it out :) .. The code is an extension of the Toolkit and pulls in a lot of concepts from other fameworks out in the wild... Will have a subsequent post on these frameworks. So getting back to this library, it includes support for: Delegating Commands\Keybinding Messaging between VM's Handling events as commands with attached behaviors Handling dialogs (and more) as services A very simple sample is also included to show the...
Page 1 of 1 (11 items)