Alexandr Vitenberg's blog

Future of Silverlight: is this technology outdated already?

From the times of release of Silverlight 2 in 2007, Silverlight was one of Microsoft's highest-prio technologies and has grown into a powerful framework allowing effective cross-platfrom development of rich Internet application using such well-respected tools like Microsoft Visual Studio and such popular languages as C# and XAML. On the other hand, there are limitations to this power.

Securing entity properties with WCF RIA Services

Although WCF RIA Services provides a pretty good way to support entity-level security, property-level security is not among the list of features of this framework, so you'll need to do some custom additional work to make your application support it. Of course this problem was discussed by the community before, but existing approaches are not without problems, so I guess there's nothing wrong to return to this discussion and show how this task may be solved in a simple and efficient way.

Specifying collections as data source in Design view

One of the nicest design-time features of WPF and Silverlight is the ability to specify data in design time, allowing your designers to work with controls already filled with data without starting the whole application. However, there's not much hints on how to work with it for slightly more complex and non-trivial scenarios, for example when binding to a collection.

DataGrid highlighting behavior: version for Silverlight 4

Silverlight 4 allows data binding for any DependencyObject, so DataGrid highlighting behavior from one of my previous articles could be written for Silverlight 4 much easier, without the help of BindingListener class. In fact, the previous version won't compile for Silverlight 4 at all, because the whole Expression Blend samples library does not work for Silverlight 4 and is no longer supported. Much simpler and elegant version of DataGrid highlighting behavior is in attachment.

DataGrid highlighting behavior

Yet another attached behavior for Silverlight 3 that may be quite handy - one that dynamically highlights text inside DataGrid. It does not require changes in DataGrid itself - just attach the DataGridHighlightingBehavior to your DataGrid and tell it the substring you want to highlight, it'll do the rest.

Bindable event-driven MessageBox for Silverlight

Here we present an approach allowing to standardize MessageBox-like scenarios, making them much more designer- and test-friendly.

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)

Syndicate content