I find a little time to blog this very nice feature on WPF. More and more people seems to play with WPF animation.
Sometimes in a multi-user environment, updated data is very important aspect in computing. Users wants to see what other people are doing with other data by just their own client machine.
With a Mixture of RTI or any messenging over an infrastructure, and with CEP concepts, data can be PUSH and PULL over the wire.
To play along for the user if their console will be updated with the new data, We will use just XAML code to detect if there are changes with our BindingSource.
Here it is as simple.
Using an EventTrigger with RoutedEvent="Binding.TargetUpdated" allows the WPF to detect if your datasource has been updated. If this is true, then the storyboard executes. It changes the specific textbox (if you set this one on your textbox style) color from blue to transparent. Remember to set your this Trigger in your style.
Wow, it's been a while I haven't updated this blog.
Some people are looking for direct answer and some people doesn't care at all but needs an answer.
Today, I'll make straight points discussing WPF Exceptions. The list below are the basic way to catch or look an exception.
1. Try..Catch..Finally block.
2. Using the Application.DispatcherUnhandledException
3. looking at Silent exceptions.
1. Try..Catch..Finaly block still the most commonly used to catch almost all types of errors during run-time. this statement is very easy to use... for example
string a = null; try { if (a == null) throw new NullReferenceException(); } catch (NullReferenceException e) { //exception 1 } catch (FieldAccessException fex) { //exception 2....... } finally { //finally block executed with or without error.... }
NOTE : If you are concerned about performance, I don't suggest that you use "try.. catch.." block.. this will swallow the exception and can possibly don't throw your exception to your UI level.
In this section I will not discuss handling this kind of exception in Multi-threading.
2. Using the application level to catch exception thrown by any of your code is the most simple and yet effective type of catching error. To do this in WPF, you write your code in the Application.Xaml code behind. On Application.xaml.vb (cs), type your custom handler on the Application_DispatcherUnhandledException() method. This can catch your exception. voila... You can now have your exception handler without worrying other developers cathing exception.
3. The last exception that I will be pointing out are those silent exceptions, silent exceptions mostly don't interact with your UI thread level. If you are running your application inside your Visual Studio, you can actually locate them at the Output Window. Most of these exceptions are caused sometimes by WPF databinding. Using MVVM actually cannot detect binding errors at design time so be careful. Silent Exceptions also has performance penalty if you don't handle them. So, you better check and clear these kind of exceptions in your apps.
Make it simple. The key to handle these exceptions.
Enjoy. GTG. Thinking other things for my ASP.NET project.