Recommended Reading
Tags
.NET
ADO .NET
AES
AJAX
app.config
Architect
Architecture
ASP .NET
Azure
Behavior
C#
Cloud
Cloud Computing
Commanding
Complexity
Consulting
Converters
Cryptography
Decryption
Dependency
DynamicProxy
Encryption
Entity Framework
Generics
Hash
Hiring
jquery
LINQ
Managed Extensibility Framework
MEF
MVVM
Office Interop
ORM
Rackspace
Serialization
Silverlight
SQL
SQL Server
SQL Server CE
Visual Studio
WCF
web.config
Windows 8
Windows Communication Foundation
WPF

Hi,
Have you used this behavior with the textbox also bind to viewmodel property? The problem is that textbox value is not committed back to viewmodel property prior to command executing. So if I use this in login window the last value (password) I’m entering does not go to viewmodel property and login fails.
Hi Johanna,
Yes, that’s actually a very common problem, and it’s just a manifestation of the way the binding works. The ViewModel’s property is not updated until the textbox loses focus. Many other developers have run into this problem. You can create a behavior or a custom textbox control to work around this problem though. Here is just one example, there are many if you do a search: http://bit.ly/kgNmev
Good luck!
Was there a reason you chose to not make a button dependency property in the behavior? You could then bind directly to the accept button in your XAML.
I don’t think so, sounds like a good enhancement.
I am trying to get this to work in a prism 4 silverlight application and it does not fire?
Interesting…something in Prism is probably overriding the behavior. Another reason I don’t use Prism.