Alexandr Vitenberg's blog

Enhancing AutoCompleteBox part 1: distinguishing similar items

Among other novelties Silverlight 3 also included new and very useful AutoCompleteBox allowing to make smart suggestions to a user during text input. Unfortunately, as it always happens with new and pretty complex controls like that, there are some scenarios when you can't avoid changing or enhancing its default behavior to get the functionality you want.

DataRecorder: a lightweight data synchronization approach

Let's suppose for some reason in your .Net client\server application you can't use standard approaches to remote data synchronization, like .Net remoting, WCF and ICE objects (bypassing proxies\firewalls may be one of the reasons you may encounter this problem). So, you have to implement your own lightweight data synchronization engine or hardcode synchronization for every specific task, object and collection you want to synchronize. As a solution, it may be a good idea to write a class-manager that listens to a standard .Net data events from interfaces INotifyPropertyChanged and INotifyCollectionChanged, and records these changes into serializable commands, so it is possible to execute this commands remotely, updating the remote state of this object.

.NET RIA Services: intermediate model validation.

I'm not the first person firmly believing that validation should be mostly entity-based, not UI control-based. It's the object who must tell the system what kind of values should its field accept, user interface should only display this info. Microsoft Enterprise Library Validation Block was a serious step in the right direction, but uniform handling of data-based validation exceptions in user interface required quite a bit of custom coding there - just to make your UI know that the data was invalid.

Now, with validation attributes in System.ComponentModel.DataAnnotations namespace uniformly supported both in Silverlight (through .NET RIA Services) and in ASP.NET Dynamic Data, Microsoft makes even more serious step in supporting entity-based validation.

Hints on fighting the dreaded crash in XcpImports.MethodEx

In programming for Silverlight platform, one commonly encountered problem is a crashing with an error like:

Message: Unhandled Error in Silverlight 2 Application Value does not fall within the expected range.
   at MS.Internal.XcpImports.MethodEx(IntPtr ptr, String name, CValue[] cvData)
   at System.Windows.DependencyObject.MethodPack(IntPtr objectPtr, String methodName, Object[] rawData)

Composite WPF (PRISM) and docking

It seems that I've found an easy solution for using every existing Visual Studio-style docking library for WPF (AvalonDock, SandDock, Infragistics xamDockManager etc) with Composite WPF library (aka CAL aka PRISM). The idea is quite simple: to extract visual region handling from CAL code and use CAL regions as a metadata for further processing. As a result we have:

  1. No changes in a specific modules code - they remain as CAL-compliant as they could be.
  2. No changes in CAL sources except UnityBootstrapper class, which is easily separatable from the rest of the library - and should be used only in application-level project anyway.
  3. We could design any complex tabs\panes initial configuration, all views will find their way in GUI.
  4. Dynamic view creation\activation\removal through traditional Composite WPF mechanisms also supported.

Welcome to our engineers blogs

Welcome to our engineers blogs. My name is Alexander Vitenberg and I am senior developer and team leader in Yumasoft company. On this blogs, we will share and discuss various technical issues, non-trivial tasks in modern software technologies, which we face from time to time in our every day company’s development activity.

We encourage you to participate and share your ideas in this forum.
Welcome, once again!!!

Syndicate content