Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DependencyProperty ClearValue
Message
From
24/02/2009 15:19:14
 
 
General information
Forum:
ASP.NET
Category:
Windows Presentation Foundation (WPF)
Environment versions
Environment:
C# 3.0
Miscellaneous
Thread ID:
01381612
Message ID:
01383903
Views:
32
>>>>Even with that fix the method I used in my code to set the property will still set it to false and since that's the same call xaml uses, so will the xaml. The only work around I know for that is to make ContentIsLocked readonly, but then you won't be able to set it from xaml :-(
>>>
>>>AFAICS the only place to trap and handle this is in the Coerce callback. But I was still confused as to the result of returning DependencyProperty.UnSetValue from this. I now see that this just leaves the old value in place rather than being the equivalent of .ClearValue() which is what I need. But so far I don't see how I can achieve the latter within the callback method .......
>>>Best,
>>>Viv
>>
>>Unfortunately... I wasn't able to find a good solution for this.
>>
>>I may try some more tonight, but so far no joy.
>
>Can't find a solution either :-{
>Maybe I need to rethink the approach......

What I tried was using 2 DPs

ContentIsLocked - Normal Attached DP no inheritance.
ContentLock - ReadOnly Attached DP with inheritance.

The idea was to use the ReadOnly DP in CoerceIsLocked to return the correct value.

But I couldn't seem to get a readonly DP to support inheritance so it didn't work. :(
Previous
Reply
Map
View

Click here to load this message in the networking platform