Blog

Slide Show Photo Gallery

Author: Steve
Posted on: 25 Feb 2010
In this article I want to show how to create simple photo gallery with the help of Cellbi SlideShow control from SvFx library.

Download: Source

Try: SvFx

See: Online Demo

See it in action below:

SlideShow control is designed to simplify slide show creation. Cellbi SlideShow control is very powerful. It can be configured by using slide show patterns. In this article we will focus on the CompositeSlideShowPattern and ArrayAnimationPattern. It can be used to define complex animations and specify animation for each item individually.

Lets take a look how CompositeSlideShowPattern can be used to create a simple photo gallery.

Here is XAML code

 <SlideShow 
x:Name="uxSlideShow" >
<SlideShow.Pattern >
<CompositeSlideShowPattern >
<CompositeSlideShowPattern.AnimationPattern >
<ArrayAnimationPattern
ItemMargin="10"
GroupShowInterval="0.7"
GroupHideInterval="0.7" >
<ArrayAnimationPattern.AnimationSelectors >
<AllAnimationGroupSelector >
<AllAnimationGroupSelector.AnimationPattern >
<ShiftItemPattern
ShowInterval="0.05"
ShowSpeed="5"
ShowMoveTween="BackTweenOut"
ShowShiftMode="FromStart"
HideInterval="0.05"
HideSpeed="5"
HideMoveTween="BackTweenIn"
HideScaleTween="BackTweenIn"
HideShiftMode="FromStart" />
</AllAnimationGroupSelector.AnimationPattern>
</AllAnimationGroupSelector>
</ArrayAnimationPattern.AnimationSelectors>
</ArrayAnimationPattern>
</CompositeSlideShowPattern.AnimationPattern>
</CompositeSlideShowPattern>
</SlideShow.Pattern>
<Canvas >
<Image
Source="166002_small.jpg" />
<Image
Source="166005_small.jpg" />
<Image
Source="166007_small.jpg" />
</Canvas>
</SlideShow>

SlideShow has "Pattern" property which can be used to extend its functionality. In the example above CompositeSlideShowPattern is used, it interprets items as animated parts.

CompositeSlideShowPattern has "AnimationPattern" property, which specifies locations and animation rules for item parts. In the example above we used ArrayAnimationPattern. It can arrange all items in a grid or in a vector. The number of columns can be set via "ColumnCount" property

The most interesting thing here is that you can specify animations for each sub item in the set individually. This can be done with the help of selectors. Selector represents a function which selects a group of sub items from the whole set and defines animation for this group. Selector can select single item, all items, even or odd items or any other items. It completely depends on the function of selector. Selectors can be combined to create complex animations.

In the example above AllAnimationGroupSelector is used. It is included in the SvFx library. It selects all sub items from SlideShow item (in this case Canvas is used), and applies the same animation pattern to each sub item in the set. AnimationPattern property is used to specify animation for each item in the group. You can get more clear sense of how it works in our Demo.

 

Best Regards,
Cellbi Software

Posted in: SvFx

New Pattern for the SlideShow

Author: Steve
Posted on: 09 Feb 2010
In this post I want to show you some new SlideShow pattern we are working on.

Download: Source

Try: SvFx

See: Online Demo

See it in action below:

These patterns will be available in future release. We focused on using Projection feature available in Silverlight 3 to add some cool transition effects for the SlideShow control.

New pattern is called Rotation3DSlideShowPattern. It has two properties ShowRotation and HideRotation. These properties are of ElementRotation type and are used to create show and hide transitions.

ElementRotation has Center, Offset and Rotation properties, which can be used to define 3D rotation effect.

I think it's better to examine how it can be used inside XAML code:

 <slideshow:Rotation3DSlideShowPattern 
x:Name="SimpleRotation"
SpeedRatio="2"
TweenType="None"
SlideMode="Sequence"
SlideDelay="0.2" >
<slideshow:Rotation3DSlideShowPattern.ShowRotation >
<effects:ElementRotation >
<effects:ElementRotation.Center >
<common:Point3D
X="0.5"
Y="0.5"
Z="0.5" />
</effects:ElementRotation.Center>
<effects:ElementRotation.Offset >
<common:Point3D
X="0"
Y="0"
Z="0" />
</effects:ElementRotation.Offset>
<effects:ElementRotation.Rotation >
<common:Point3D
X="0"
Y="90"
Z="0" />
</effects:ElementRotation.Rotation>
</effects:ElementRotation>
</slideshow:Rotation3DSlideShowPattern.ShowRotation>
<slideshow:Rotation3DSlideShowPattern.HideRotation >
<effects:ElementRotation >
<effects:ElementRotation.Center >
<common:Point3D
X="0.5"
Y="0.5"
Z="0.5" />
</effects:ElementRotation.Center>
<effects:ElementRotation.Offset >
<common:Point3D
X="0"
Y="0"
Z="0" />
</effects:ElementRotation.Offset>
<effects:ElementRotation.Rotation >
<common:Point3D
X="0"
Y="-90"
Z="0" />
</effects:ElementRotation.Rotation>
</effects:ElementRotation>
</slideshow:Rotation3DSlideShowPattern.HideRotation>
</slideshow:Rotation3DSlideShowPattern>

That's how Rotation3DSlideShowPattern can be used inside XAML code. I think that the code shown above is really simple compared to the actual transition effect we get.

What do you think? Is there any way we can simplify the code above? Please let me know!

Posted in: SvFx

SlideShow and Wipe Patterns

Author: Steve
Posted on: 01 Feb 2010
SlideShow control usage example with full source code.

Download: Source

I think that it'll be correct to say that almost each web site has to represent content separated by pages providing easy navigation between these pages. Navigation between parts of content can be used in photo and video galleries as well.

This is exactly what SlideShow control does. You add photos, videos or any other content as items of the SlideShow and you're done ;)

In this article we'll use only one animation pattern. In future posts I'll show you how other patterns can be used :)

See it in action below:

I hope that this simple post with just several lines of XAML code will give you a good taste of what Cellbi SlideShow control can do. Let's get started.

Cellbi SlideShow gives you an ability to organize content of your site, build photo and video galleries with hundrends of advanced transition effects. You can use builtin slide show animation patterns, or you can change several propereties to completelly change slide show animations in 1-2 steps.

The code to declare SlideShow with several images placed inside will look as follows:

 <SlideShowControl 
Width="400"
Height="250" >
<Image
Source="Image001.jpg"
Width="380" />
<Image
Source="Image002.jpg"
Width="380" />
<Image
Source="Image003.jpg"
Width="380" />
<Image
Source="Image004.jpg"
Width="380" />
</SlideShowControl>

That's how SlideShow is declared in XAML code. We've added only 5 lines of code, and it will give us animated transitions between images if we'll call SlideShow.ShowNext, SlideShow.ShowPrevious or SlideShow.ShowByIndex method in C# of VB code.

To be honest such simple example will use only Fade-In and Fade-Out transition effects to show and hide images. To get more complex effects we will use special animation patterns.

Cellbi SlideShow contains several powerfull builtin animation patterns. More over you can create your own animation patterns. Lets take a look how WipeSlideShowAnimarion works.

 <SlideShowControl 
Width="400"
Height="250" >
<SlideShowControl.Pattern >
<WipeSlideShowPattern >
<WipeSlideShowPattern.Pattern >
<BlindsHorizontalDownWipePattern
RowCount="10"
WipeTweenType="BackTweenOut" />
</WipeSlideShowPattern.Pattern>
</WipeSlideShowPattern>
</SlideShowControl.Pattern>
<Image
Source="Image001.jpg"
Width="380" />
<Image
Source="Image002.jpg"
Width="380" />
<Image
Source="Image003.jpg"
Width="380" />
<Image
Source="Image004.jpg"
Width="380" />
</SlideShowControl>

Here we use WipeSlideShowPattern as animation pattern for the SlideShow. Then type of wipe animation is set using Pattern property. We use BlindsHorizontalDownWipePattern and assign its properties. Please try to play with different wipe patterns and try to set different properties. You'll find that it is very easy to change transition effects.

Download FREE trial version now.

Play with online Demo application.

Posted in: SvFx

Using Data Binding in the Carousel Control

Author: Steve Li
Posted on: 03 Dec 2009
This article shows how data binding can be used with the CarouselControl to create great UI.

Download: Source

Note: You will need to have Silverlight developer tools installed on your machine.
Visit Silverlight Official WebSite to learn more.

SvFx Carousel control supports data binding to simplify data display tasks. You can easily specify how data will be presented by defining custom item template. Data binding inside the carousel control can be used to present services or goods, list of employees or any other list of data.

ItemsControl provides flexible ways to work with data binding in Silverlight. Data binging is a connection between logic and UI. It means that you may build logic model in your application, populate it with custom data, then specify UI independently and finally connect data to the UI.

Let's consider the following scenario: We need to display information about employees of a company. To solve this task we'll use Cellbi SvFx Carousel control.

The following image shows how data will be presented:

Ellipse Carousel

Or the same data shown using vertical carousel layout:

Vertical Ellipse Carousel

I want to note that Cellbi SvFx Carousel control can specify not only UI. You will get total control of each item behaviour. Once defined, you can completelly change carousel control view without making any changes inside C# or VB code.

Lets take a look on how this can be done in more detail.

Logical Model.

As mentioned before we'll define our logical model as a list of employees. Each employee is characterised with a set of properties: FirstName, LastName, Department, HireDate. So the Employee class code will be the following:

public class Employee
{
  public string FirstName { get; set; }
  public string LastName { get; set; }
  public string Department { get; set; }
  public string BirthDate { get; set; }
  public string HireDate { get; set; }
  public string Photo { get; set; }
}

Using Employee class defined above we'll create sample data for this post. (Please take a look at the Data.cs file inside the source code)

Our data can be assigned to the UserControl.DataContext property. Carousel control should be declared inside the same UserControl.

The following code shows how DataContext property is assigned: (Note that GetData is a static method, which returns IEnumerable)

DataContext = Data.GetData();

Now let's create some UI to present our data.

UI Definition using Carousel Control

First of all let's add declaration of the Carousel control to the xaml file:

 <SvUx:CarouselControl 
x:Name="uxCarousel"
Width="800"
Height="500"
AlignCenter="True"
ZDepth="100"
VerticalAlignment="Stretch"
HorizontalAlignment="Stretch" >
<SvUx:CarouselControl.LocationSetup >
<SvFx:EllipseLocationSetup
Depth="40"
CanUseOpacity="False"
RadiusX="230"
RadiusY="110" />
</SvUx:CarouselControl.LocationSetup>
<SvUx:CarouselControl.Setup >
<SvFx:CycleTransitionSetup
SpeedRatio="2" />
</SvUx:CarouselControl.Setup>
</SvUx:CarouselControl>

Note that the code above will show empty carousel. Let's correct this.

Binding Carousel Control to Data

The following code shows how we can bind our data (assigned to the DataContext property):

Note that there is only one line of code added: ItemsSource="{Binding}". Now carousel control will be filled with data (from DataContext property).

Let's specify data template for each carousel item.

Data Template

The best way to let Carousel know how to display each item is to use ItemTemplate property. Item template will be used as visual template for each item of the carousel control.

CarouselItemTemplate is name of ItemTemplate which is placed inside application resources.

Data template specifies how UI will look like. You can use Expression Blend for visual design. The following code shows simple example:

 <DataTemplate 
x:Key="CarouselItemTemplate" >
<TextBlock
Text="{Binding FirstName}" />
</DataTemplate>

Note that we use binding expression here as well. In this case we access each item's property and obtain it's data.

The following code shows more complex example of data template:

 <DataTemplate 
x:Key="CarouselItemTemplate" >
<Grid >
<Grid.ColumnDefinitions >
<ColumnDefinition
Width="Auto" />
<ColumnDefinition
Width="Auto" />
</Grid.ColumnDefinitions>
<Rectangle
Stroke="White"
Grid.ColumnSpan="2"
RadiusX="5"
RadiusY="5"
StrokeThickness="3" >
<Rectangle.Fill >
<LinearGradientBrush
EndPoint="0.961,0.858"
StartPoint="0.055,0.163" >
<GradientStop
Color="#FFA4C7F0" />
<GradientStop
Color="#FF4789D6"
Offset="1" />
<GradientStop
Color="#FF69A8F2"
Offset="0.384" />
</LinearGradientBrush>
</Rectangle.Fill>
</Rectangle>
<Grid
Grid.Column="0"
Width="70"
Height="140"
Margin="10" >
<Image
VerticalAlignment="Top"
Source="{Binding Photo}"
Height="60" />
</Grid>
<StackPanel
Grid.Column="1"
Orientation="Vertical"
Margin="0,10,10,0" >
<StackPanel
Orientation="Horizontal"
HorizontalAlignment="Left" >
<TextBlock
Text="First Name:"
Style="{StaticResource CaptionStyle}"
mce_Style="/Edit/{StaticResource CaptionStyle}" />
<TextBlock
Text="{Binding FirstName}"
Style="{StaticResource TextStyle}"
mce_Style="/Edit/{StaticResource TextStyle}" />
</StackPanel>
<StackPanel
Orientation="Horizontal"
HorizontalAlignment="Left" >
<TextBlock
Text="Last Name:"
Style="{StaticResource CaptionStyle}"
mce_Style="/Edit/{StaticResource CaptionStyle}" />
<TextBlock
Text="{Binding LastName}"
Style="{StaticResource TextStyle}"
mce_Style="/Edit/{StaticResource TextStyle}" />
</StackPanel>
<StackPanel
Orientation="Horizontal"
HorizontalAlignment="Left" >
<TextBlock
Text="Department:"
Style="{StaticResource CaptionStyle}"
mce_Style="/Edit/{StaticResource CaptionStyle}" />
<TextBlock
Text="{Binding Department}"
Style="{StaticResource TextStyle}"
mce_Style="/Edit/{StaticResource TextStyle}" />
</StackPanel>
<StackPanel
Orientation="Horizontal"
HorizontalAlignment="Left" >
<TextBlock
Text="Hire Date:"
Style="{StaticResource CaptionStyle}"
mce_Style="/Edit/{StaticResource CaptionStyle}" />
<TextBlock
Text="{Binding HireDate}"
Style="{StaticResource TextStyle}"
mce_Style="/Edit/{StaticResource TextStyle}" />
</StackPanel>
</StackPanel>
</Grid>
</DataTemplate>

Note that above code defines style which is applied to each item inside the CarouselControl.

I hope this article will be helpful to you. Data binding is powerful mechanism to speed up your developement. This article shows how CarouselControl can be used with data binding to create great UI in minutes.

Posted in: SvFx

Flexible Carousel Control

Author: Steve
Posted on: 05 Oct 2009
In this article I want to focus on CarouselControl usage and it's location setups.

Download: Source

If you will search the Internet - you will certainly find numerous examples of carousel control usage. Why? It is a great control for wide range of tasks. Horizontal and vertical menus, image and photo galleries, it is a great way to present data. Carousel control has great usability and it can add special look'n'feel to your web site to make it different.

See it in action below:

Let's take a look how CarouselControl can be used. How simple it is in usage and which features it provides.

Here is an example of simple Ellipse carousel. Note: this example uses images as items, but it is possible to bind any data items.

 <SvUx:CarouselControl 
AlignCenter="True"
ZDepth="100" >
<SvUx:CarouselControl.LocationSetup >
<SvFx:EllipseLocationSetup
Depth="40"
CanUseOpacity="True"
RadiusX="100"
RadiusY="45" />
</SvUx:CarouselControl.LocationSetup>
<SvUx:CarouselControl.Setup >
<SvFx:CycleTransitionSetup
SpeedRatio="2" />
</SvUx:CarouselControl.Setup>
<SvUx:CarouselControl.MouseOverPattern >
<SvFx:ShakeItemPattern />
</SvUx:CarouselControl.MouseOverPattern>
Items go here... </SvUx:CarouselControl>

Here is the screen shot of the result:

Ellipse Carousel

Now let's change several properties and our ellipse carousel will be transformed to slide show:

 <SvUx:CarouselControl 
AlignCenter="True"
ZDepth="100" >
<SvUx:CarouselControl.LocationSetup >
<SvFx:CoverFlowLocationSetup
Depth="40"
CanUseOpacity="True" />
</SvUx:CarouselControl.LocationSetup>
<SvUx:CarouselControl.Setup >
<SvFx:CycleTransitionSetup
SpeedRatio="2" />
</SvUx:CarouselControl.Setup>
<SvUx:CarouselControl.MouseOverPattern >
<SvFx:ShakeItemPattern />
</SvUx:CarouselControl.MouseOverPattern>
Items go here... </SvUx:CarouselControl>

Note: we added MouseOverPattern to the carousel so now it can react to mouse over event.

Here is how it will look like:

CoverFlow

Note: We used CoverFlowLocationSetup instead of EllipseLocationSetup to change items arrangement.

Carousel control contains four specially designed location setups, however it is easy to add new setups.

Now let's return back to the ellipse carousel and make another change. By default topmost item of the Carousel control is defined automatically. For the ellipse carousel it is always item closest to viewer. However we can specify different topmost item index. Let's set TopmostIndex to zero, this means that the first carousel item will be always topmost:

 <SvUx:CarouselControl 
x:Name="ctrlRotatedEllipse"
AlignCenter="True"
VerticalAlignment="Stretch"
HorizontalAlignment="Stretch"
ZDepth="100" >
<SvUx:CarouselControl.LocationSetup >
<SvFx:EllipseLocationSetup
Depth="40"
CanUseOpacity="True"
RadiusX="40"
RadiusY="70"
TopmostIndex="0"
TopmostMode="Specified" />
</SvUx:CarouselControl.LocationSetup>
<SvUx:CarouselControl.Setup >
<SvFx:CycleTransitionSetup
SpeedRatio="2" />
</SvUx:CarouselControl.Setup>
<SvUx:CarouselControl.MouseOverPattern >
<SvFx:ShakeItemPattern />
</SvUx:CarouselControl.MouseOverPattern>
Items go here... </SvUx:CarouselControl>
Rotated Ellipse Carousel

Let's change radius of the Carousel control to zero and we'll get vertical line carousel. This small change can lead to significant modification of the Carousel look'n'feel:

 <SvUx:CarouselControl 
AlignCenter="True"
ZDepth="100" >
<SvUx:CarouselControl.LocationSetup >
<SvFx:EllipseLocationSetup
Depth="40"
CanUseOpacity="True"
RadiusX="0"
RadiusY="70"
TopmostIndex="0"
TopmostMode="Specified" />
</SvUx:CarouselControl.LocationSetup>
<SvUx:CarouselControl.Setup >
<SvFx:CycleTransitionSetup
SpeedRatio="2" />
</SvUx:CarouselControl.Setup>
<SvUx:CarouselControl.MouseOverPattern >
<SvFx:ShakeItemPattern />
</SvUx:CarouselControl.MouseOverPattern>
Items go here... </SvUx:CarouselControl>

Vertical Carousel

Note: one line line of XAML can completely change look'n'feel of the CarouselControl. CarouselControl includes Silverlight 3 powered features: blur, reflection effects, projection and so on.

Do you know any great examples, where Carousel control can be used? Please let me know! :-)

Posted in: SvFx

How to create flashing Logo

Author: Steve
Posted on: 30 Sep 2009
In this post I want to show how you can create animated logo for your web site.

Download: Source

See it in action below:

It is not a secret that organizations want to have unique design for company's web site. And every site starts from a logo!

To add animation to your logo you don't need to redesign it, and you don't need to write to much code. Lets take a look how this can be done with FashLightControl.

E.g. let's imagine we have the following logo for a web site:

Logo

XAML code may look like shown below:

 <Grid 
x:Name="LayoutRoot" >
<Image
Source="Logo.png" />
</Grid>

To add animation to the logo we'll simply place it inside FlashLightControl:

 <Grid 
x:Name="LayoutRoot" >
<FlashLightControl
AutoAdvanceDuration="2000"
StartPoint="0,0"
EndPoint="1,1" >
<Image
Source="Logo.png" />
</FlashLightControl>
</Grid>

We added FlashLightControl to the grid control and then placed our logo inside the control. AutoAdvanceDuration property sets time internval in milliseconds to repeat the animation when elapsed. StartPoint and EndPoint properties can be used to set direction of the animation.

Do you have better ideas? Please post them!

Posted in: SvFx

SvFx 3.0.1 Update

Author: Steve
Posted on: 29 Sep 2009
SvFx 3.0.1 update is now published!


We are glad to announce SvFx 3.0.1 update!

It includes several bug fixes reported plus small improvements added to the CarouselControl and FlashLightControl.

New TopmostIndex and TopmostMode properties are added to the CarouselControl.

Auto advance support is added to the FlashLightControl.

Waiting for your feedback!

Posted in: SvFx Release

SvFx 3.0 is released

Author: Steve
Posted on: 16 Jul 2009
New SvFx 3.0 version is now available!

I'm happy to announce SvFx 3.0 version!

It is fully compatible with Silverlight 3.0!

Read more: SvFx 3.0 What's New

If you want to upgrade to the SvFx 3.0 release, please contact us at support@cellbi.com and we'll help you with upgrading. Note that upgrade price is 50% discount.

We are waiting for your feedback!

Thanks!
Cellbi Software Team

Posted in: SvFx Release

Silverlight3 is out!

Author: Steve
Posted on: 10 Jul 2009
Silverlight3 is out and we work on new SvFx 3.0 version release with some great stuff supporting new Silverlight 3.0 features.

Expect new SvFx 3.0 release published soon.

Below is short change log of new features in SvFx 3.0, we mainly worked on SL3 features support.

Carousel Control

- New Coverflow location setup (completely based on SL3 features) with advanced settings: reflection, blur, angles, item spacings, etc.
- Reflection support for carousel items (check HasReflections check box inside demo)
- Blur support for carousel items (check CanUseBlur check box inside demo)
- Tween support for carousel animation
- Improved animation of items


SlideShowControl

- New pixel shader based patterns: Water, Ripple, Fade and more...


TextEffects

- Support for multi line text animation
- Support for animation by words
- Pixel shader based animations
- Support for style defined text block properties

+ Bug fixes.

I'm very excited about 3.0 version we are going to release soon!

Posted in: Silverlight

ZLib for Silverlight

Author: Steve
Posted on: 02 Jul 2009
ZLib library for Silverlight. Easily read and write ZLib streams. Full source code available.

ZLib streams can be easily read and written via SvZLib library.

Add Cellbi.SvZLib using and use Utils class which contains compression and decompression methods.

Full source code can be downloaded here:

Cellbi.SvZLib-Source

Let me know what you think.

Posted in: Silverlight