Archive for January, 2010

Gallery in Silverlight for Wordpress

2 commentaires

I recently participated with Boris Forconi, in developing a plugin for wordpress. The idea was to create a Silverlight gallery in wordpress using the API but by developing the gallery itself in Silverlight. It is partially based on the one made by Tim Heuer. Boris has occupied any part of PHP and Wordpress integration. For my part, I developed the Silverlight gallery. The goal is to provide a simple way to put pictures online nicely for Wordpress blogs as shown below:

Get Microsoft Silverlight

Just write a tag like : [sl-gallery: ...]

You can set parameters as shown in the example below :

  • width=400
  • height=400
  • leftArrow=true
    //show/hide left arrow
  • rightArrow=true
    //show/hide right arrow
  • pageNumbers=true
    //affiche ou cache la pagination
  • thumbnails=true
    //show/hide thumbnails
  • fill=uniform
    / / used to indicate a way of filling you can choose between:
    / / Uniform (homothetic part by filling ability)
    / / UniformToFill (filling with homothety)
    / / Fill (filling with deformation dimensions)
    / / None (preserves the original dimensions)
  • bgcolor
    //set the background color
  • bgmode
    // set the background mode(windowless)

The first good news is that it is possible to use a menu to set it all in 2 seconds. It adds to the administration of sections Wordpress. A small window appears when you click the button (see below).

The second good news is that we will quickly sources available on wordpress.com. This way you can completely change the visual side of the gallery Silverlight. In all cases, it dynamically retrieves images from the gallery Wordpress. You can download a first version here.

Free ColorPicker and ColorChooser custom controls

13 commentaires

I put online two new components outlined below :

Install Microsoft Silverlight

You can download the tweenedcontrols library here.

ColorChooser

Since its beta version, this control has been greatly improved. It is now possible to click directly on the surface of the two swatches to select a color. The property is SelectedColor this time of type Color. This greatly simplifies the code and avoids the usage of an IValueConverter class.

ColorPicker

That component is intended to make a ColorChooser appear when user click on it, with the help of an instance of Popup. The whole problem was to place the ColorChooser beside the ColorPicker in any case. To this end, I've created a method of extension for Class Popup. It is also possible to access to the style and template of ColorChooser directly through the menu Template Edit => Edit Template Aditional as shown below.

ColorPicker has the IsOpen dependency property coupled with Opened and Closed events. Apart from this trick this class exposes properties and events of a ColorChooser.

[silverlight: http://www.tweened.org/wp-content/uploads/applis/TestColorControls.xap, 540, 323,3.0.40818.0]