-
Automatic generation of data-binding interfaces for data context objects
-
From the new Clarius Labs release:
XamlBinding Custom Tool
This custom tool will generate a partial class file implementing INotifyPropertyChange as well as a strongly-typed event for each property declared in the file it's applied to.
This is very useful when creating models or entities that are used in data-binding scenarios, and where an associated presenter needs to perform certain logic when a given property changes.
Communicating through these strong-typed events prevents tight coupling between the presenter and the UI, which now communicate exclusively through the model/data context....
Read full article
-
Evolving community guidelines on XAML and WPF
-
I just found the following excelent guidelines (especially the ones on resources organization) at Paul Stovell's blog.
I think it would be great to have community-developed guidelines on this topic. I've proposed to Paul to use Jottit, which is brain dead simple and uses the increasingly popular Markdown format.
Would be nice to point everyone to http://wpf.jottit.com/ and http://xaml.jottit.com/ for this kind of advice :).
Read full article
-
Automatic input validation in WPF with data binding and Enterprise Library Validation Application Block
-
WPF provides validation infrastructure for databinding scenarios through ValidationRule objects. Only one built-in rule is provided, and you're expected to write most of these yourself. The way they work is by assigning one or more explicit rules to a binding:
<TextBox ...>
<TextBox.Text>
<Binding .>
<Binding.ValidationRules>
<local:JpgValidationRule/>
</Binding.ValidationRules>
</Binding>
</TextBox.Text>
</TextBox>
[Example from Adam Nathan's excelent book on WPF]
Note that the syntax is much more involved than the simple non-validating binding:...
Read full article
-
Serious flaw in WPF validation infrastructure for ValidationRule and Binding
-
Adam Nathan's excelent book on WPF states:
The validation check is invoked during any attempt to update the underlying data ... before a value converter is called (if present)...
This is further reinforced on MSDN where the validation process is explained:
I can't understand how this design decision was made (it seems to be very much a rational decision, given how well documented it is).
Think about this scenario: you want to validate an integer value for a property (say, its range). There is a built-in converter for integers (but this could be a custom value converter, if it was your own type) that will ultimately assign a value of the right type to the property....
Read full article
-
Why we need an EntLib Standalone Validation Application Block
-
In my previous post about XAML and its future as a domain model/DSL serialization format, I've argued that System.Configuration as well as Enterprise Library Configuration (part of the core of EntLib) will soon become irrelevant.
The caveat is that now you need to design your classes a bit differently. No more constructors where you validate the required input. Now everything is a property get/set, and validation needs to be done at a separate point in time (ISupportInitialize.EndInit), as well as on every property set (if you only want to allow the setter to be called before initialization is completed) and before every method (if you depend on the properties being initialized). ...
Read full article
-
Why XAML makes System.Configuration and Enterprise Library Configuration obsolete
-
It may seem unrelated, but if you haven't read Fowler's article on DSLs (from Google cache if it's down like now), please do so now. It will help you understand why XAML goes far beyond WPF and presentation.
Configuration is typically nothing more than a DSL (external DSL in Fowler's terms) that serves to setup the variable parts of a certain runtime library or framework. For example, while a logging framework has many "static" or invariant components (i.e. logging "pipeline" execution, interaction between components, registration of variable components, etc.), there are variable parts which determine the runtime behavior, such as concrete trace listeners attached to given trace sources, the specific file a file listener will write to, and so on. ...
Read full article
-
How to use Airport Express as a range extender for Linksys WRT54G
-
I know I'm years behind this, but just solved some range problems I had at home by using my existing Airport Express as a range extender in addition to a remote speaker, as explained in an article about Linksys WRT54G, Airport Express, and WDS.
Read full article
-
Forget about extending WPF data-binding support
-
Databinding in WPF is implemented in the Binding class, which in principle looks like just a MarkupExtension. A MarkupExtension is a core piece of XAML markup "magic". It's rather simple, though:
public abstract class MarkupExtension
{
// Methods
protected MarkupExtension();
public abstract object ProvideValue(IServiceProvider serviceProvider);
}
You're supposed to return a value to assign to the property that is using the markup extension, such as:
<TextBox Text="{l:MyMarkup}" />
A binding markup extension does a LOT more...
Read full article
-
Why the iPhone is not ready for prime time
-
My "baseline" phone is my Nokia N95, so my quality and functionality bar is high. I'll go straight to the point here:
- Bluetooth audio: doesn't support the Advanced Audio Distribution Profile (A2DP) profile, meaning you can't use stereo headsets that support it to listen to music. I've got the BlueAnt X5 which work flawlessly with my Nokia N95 but only work as phone headsets with the iPhone. This also means that it doesn't work either with my very cool Pioneer bluetooth-enabled stereo. This is a bummer as I have a very nice user experience with the N95 and the stereo: I can listen to my music through bluetooth, and as soon as an incoming call arrives, the music fades out and then pauses, and I get to answer the call *from the stereo*. That means I can use the stereo speakers to listen to my caller, and I got the provided microphone installed on the windshield close to the driver steat on the left, so I got a very comfortable hands-free experience. And it sounds much better than the (rather old) ...

Read full article
-
How to develop WPF applications in VS2005 and VS2008 simultaneously
-
In order to develop WPF apps in VS2005, you must install the corresponding CTP tools for it. These will basically bring in some new project templates, project types, MSBuild taks and designers. The designers are quite slow, and don't always work as expected. Being a CTP, and with VS2008 ("Orcas") already in the beta phase, I don't expect these to be updated anymore. Wouldn't it be great if you had a choice to use VS2008 or VS2005 with the same project files?
I'm not suggesting your entire team moves to VS2008. It's a pain to work with beta versions for your main development environment. Believe me, I developed GAX/GAT using pre-Beta1 versions of VS2005 (then "Whidbey") which we used to upgrade every couple weeks because it was quite unstable. It's no fun. Lots of time wasted. ...
Read full article