Améliorez les performances du scrolling clavier dans les listes (DataGrid, ListBox…) et de l’AutoCompleteBox avec le limiteur

Une des causes les plus fréquentes des lenteurs du scrolling clavier dans une liste est le coût de la récupération des données liées à l’item sélectionné. Lorsqu’un utilisateur maintient les flèches de son clavier appuyées pour effectuer un défilement, l’élément sélectionné change très rapidement, déclenchant de nombreux et couteux appels à la source de données…

0

Improving keyboard scrolling speed in selector controls (ListBox, DataGrids…) or AutoCompleteBox performance using throttling

One of the most frequent cause of slow scrolling lists is the cost of loading the data related to the currently selected item/row. When a user holds his arrow keys down to scroll, the selected item changes very quickly, potentially triggering a large amount of expensive queries to the data source (wether it be web…

0

Silverlight/WPF debugging: Determining the focused element

When developing complex WPF or Silverlight applications, you may stumble upon the problem of not knowing where your keyboard focus is. This is also known as the “But where am I typing?!” problem, and occurs more often than not on composite applications. Silverlight You can determine which element has keyboard focus within Silverlight via the…

1

Commanding with Silverlight 4

One of Silverlight 4’s new feature is commanding support. Commanding and the MVVM pattern allow clean separation of XAML and C# code: an action can be associated to a control using the {Binding} markup, just as it is done with data. Silverlight 4’s buttons support commanding through the Command property. The following example shows how…

0

Le FormatConverter, et les XamlParseException dans Microsoft Expression Blend

Un converter que l’on voit et réimplémente très souvent est le FormatConverter, qui consiste à prendre en entrée une chaîne et l’utiliser comme paramètre pour la méthode String.Format. Cela permet par exemple d’éviter une redondance de runs lorsque l’on souhaite concaténer des chaînes, ou encore d’appliquer un formatage spécifique aux flottants ou aux dates. public…

0

The XamlParseException AG_E_PARSER_BAD_TYPE checklist

While running a Silverlight application, you might sometimes encounter the dreaded runtime ParseException(“AG_E_PARSER_BAD_TYPE”). Despite its rather crude description, the message actually means something close to the words it uses: during the XAML parsing phase something went wrong with a type.Here is a checklist I use to hunt down the cause for this exception: If you…

1

"The configuration section for Logging cannot be found in the configuration source." or how to read an external configuration file for the Logging Application Block

When using the Logging Application Block, using an IConfigurationSource to read your logging configuration from an external reference might throw a ConfigurationErrorsException(“The configuration section for Logging cannot be found in the configuration source.”), or ignore your configuration changes. This exception is usually caused by the Logger façade, which forcibly initializes using the application default .NET…

2

Reading web.config parameters from a Silverlight application

It is a very common ASP.NET scenario to have to read a configuration parameter from web.config. This operation is very easily implemented from ASPX using Configuratoin.AppSettings. However, this scenario does not work out of the box from a Silverlight application, which doesn’t seem to even have access to web.config. The reason is simple: a Silverlight…

3

Interacting between Powershell and a host .NET application

An unusual topic in today’s post : interacting between Powershell and a host .NET application. The examples available on MSDN show how to host Powershell runspaces using classes from the System.Management.Automation namespace ; but it is also possible to share objects with hosted Powershell scripts paving the way to hybrid scenarios. This allows, for example, handling…

1

Sorts and filters on ObservableCollection

Using the ObservableCollection<T> collection is a very common practice among UI developers.  Added to the fact that they allow easy UI updates, they also allow sorting and filtering operations via CollectionViews. This post describes a pattern linking an ObservableCollection to sortable and filterable ListCollectionViews, which are themselves displayed in the UI. The pattern works as…

0