Boolean DP and Binding

I need to bind bool property of model to bool dependency property of control. If I wrote this in XAML in short form, like this:

<Button IsEnabled="{Binding Path=Loaded}"/>

I got a build error. OK, next I tried to use full form:

<Button>
<Button.IsEnabled>
<Binding Path="Loaded"/>
<Button.IsEnabled>
</Button>

That's works fine, but form designer in VS still showed an error and ain't worked. Is there any solution?

[1027 byte] By [AndrewVK] at [2007-12-29]
# 1

Both forms look correct to me. What was the build error (including inner exception)?

Could it be because Loaded is an event (not a property)? Did you mean IsLoaded instead?

SamBent-MSFT at 2007-9-4 > top of Msdn Tech,Visual Studio Orcas,WPF Designer (Cider)...
# 2

Error in short form:

The 'IsEnabled' attribute is invalid - The value '{Binding Path=Loaded}' is invalid according to its datatype 'http://schemas.microsoft.com/winfx/2006/xaml/presentation:frlrfSystemBooleanClassTopic' - The Enumeration constraint failed.

Error in full form:

Property 'IsEnabled' does not support values of type 'Boolean'.

Loaded is a property of type bool. (Yes, IsLoaded is more readable :) )

Strange effect - after I restarted the VS, build with short form completed successfully, and designer show only warning, not error with "Whoops!" picture. Full form still make designer unworkable.

AndrewVK at 2007-9-4 > top of Msdn Tech,Visual Studio Orcas,WPF Designer (Cider)...
# 3
Sounds to me like the designer doesn't know about WPF's markup extensions. Or got into a state where it forgot about them; rebooting VS restored its memory. In short - it's a designer issue, not WPF. Try the Cider forum (I presume you're using the Cider designer).
SamBent-MSFT at 2007-9-4 > top of Msdn Tech,Visual Studio Orcas,WPF Designer (Cider)...
# 4
This works fine in Orcas Beta1 - mark
MarkBoulter at 2007-9-4 > top of Msdn Tech,Visual Studio Orcas,WPF Designer (Cider)...

Visual Studio Orcas

Site Classified