Latest News

  • Super Tower Defense Game
    Mar 10, 2010

    New to the games section is the new Super Tower Defense game. Defend your base from the ever advancing army of tanks, buggies...

  • New Rich Text Editor User Control
    Feb 19, 2010

    By popular request, here we present a re-usable User Control containing the Liquid RichTextBox along with the most common formatting functions included.

  • Silverlight 3 Controls V5.2.7 Released
    Feb 19, 2010

    This release includes several fixes for issues raised in the forum. The main improvement is to the RichTextBox which now provides access and methods to the document elements allowing...

  • Super Shoot Em Up Game
    Feb 04, 2010

    Added to the games section is the new Super Shoot 'Em Up game. Take control of a tank with your aim being to blow up your opposing tanks and collect all the powerups.

  • Silverlight 3 Controls V5.2.6 Released
    Feb 04, 2010

    This release includes some minor fixes for several forum posts. Please see the notes on the download page for full details on what has changed.

Silverlight ItemViewer

This free Silverlight ItemViewer allows you to group similar items together in an area that will automatically wrap when resized and is easy to implement on your Silverlight driven website and is also customizable to provide a visual feel suitable for any site design.

To use the ItemViewer control you will need to add a reference to Liquid.dll in your project.


How to Use the ItemViewer Control

To use the ItemViewer on your Silverlight page:

<UserControl x:Class="ItemViewer.Page"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:liquid="clr-namespace:Liquid;assembly=Liquid"
    Width="400" Height="300">
    <liquid:ItemViewer x:Name="myList" Width="400" Height="300" DoubleClick="Items_DoubleClick">
        <liquid:ItemViewer.Items>
            <liquid:FileItem Text="My File.pdf" OtherText="300KB" Icon="images/large/pdf.png" />
            <liquid:FileItem Text="My File 2.doc" OtherText="360KB" Icon="images/large/doc.png" />
            <liquid:FileItem Text="My File 3.xls" OtherText="100KB" Icon="images/large/xls.png" />
            <liquid:FileItem Text="My File 4.xaml" OtherText="40KB" Icon="images/large/xaml.png" />
            <liquid:FileItem Text="My File 5.jpg" OtherText="167KB" Icon="images/large/jpg.png" />
            <liquid:FileItem Text="My File 6.mp3" OtherText="96KB" Icon="images/large/mp3.png" />
        </liquid:ItemViewer.Items>
    </liquid:ItemViewer>
</UserControl>


The ItemViewer can render controls that derive from the base ItemViewerItem class such as the included FileItem control which, in conjunction with the TreeView control, allows you to build complex file explorer components with relatively small amounts of code.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

using Liquid;

namespace ItemViewer
{
    public partial class Page : UserControl
    {
        public Page()
        {
            InitializeComponent();
        }

        private void Items_DoubleClick(object sender, EventArgs e)
        {
            FileItem selected = myList.Selected;

            // Process your double-click action here
        }
    }
}


Example Silverlight ItemViewer Control:

Silverlight ItemViewer Control

Latest Forum Posts

Here are latest posts from around the forums, if you have a question about any of the Liquid controls you can get your answers in the Forum.

Netmonster posted on Viewer Scroll Bar Vertical

Hello,


Is there a way to make the scrollbar in a viewer be Vertical and on the Left. I'm trying to style it but I can't make it stay left.


     <ControlTemplate TargetType="Liquid:Viewer">

     <Canvas x:Name="RootElement" d:DesignWidth="365" d:DesignHeight="68" Width="500">

     <Canvas.Resources>

     <Storyboard x:Name="ElementFadeOut" BeginTime="0">

     <DoubleAnimation Duration="0:0:0.3" Storyboard.TargetName="ElementSliderGrid" Storyboard.TargetProperty="Opacity" From="1.0" To="0.3"/>

     </Storyboard>

     <Storyboard x:Name="ElementFadeIn" BeginTime="0">

     <DoubleAnimation Duration="0:0:0.3" Storyboard.TargetName="ElementSliderGrid" Storyboard.TargetProperty="Opacity" From="0.3" To="1.0"/>

     </Storyboard>

     </Canvas.Resources>

     <Grid x:Name="Holder" Canvas.Left="0" Canvas.Top="0" HorizontalAlignment="Left" VerticalAlignment="Top" >

     <Grid.ColumnDefinitions>

     <ColumnDefinition Width="0.168*"/>

     <ColumnDefinition Width="0.832*"/>

     </Grid.ColumnDefinitions>

     <ScrollViewer Grid.Column="0" Grid.ColumnSpan="1" x:Name="ElementContainer" Margin="0,133,-41,132" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">

     <Canvas x:Name="ElementChildren">

     <Canvas.RenderTransform>

     <ScaleTransform x:Name="ElementScale"/>

     </Canvas.RenderTransform>

     <ContentPresenter x:Name="ElementContent"/>

     </Canvas>

     </ScrollViewer>

     <Grid x:Name="ElementSliderGrid" Margin="0" Opacity="0.3" HorizontalAlignment="Left" VerticalAlignment="Top" Grid.Column="0">

     <Rectangle Fill="{TemplateBinding SliderBackground}" Stroke="{TemplateBinding SliderBorderBrush}" StrokeThickness="{TemplateBinding SliderBorderThickness}" RadiusX="{TemplateBinding SliderCornerRadius}" RadiusY="{TemplateBinding SliderCornerRadius}" Height="300" Margin="0" Width="22"/>

     <Slider x:Name="ElementSliderX" Height="Auto" Margin="2" Width="22" Orientation="Vertical" Maximum="{TemplateBinding Maximum}" Minimum="{TemplateBinding Minimum}" SmallChange="10"/>

     </Grid>

     </Grid>

     </Canvas>

     </ControlTemplate>


Thanks,


Kris

dan posted on Color selector bugs?

Hi Ron,


Unfortunately not in the current version, Transparent will render as White.  I'll see if we can make the colour visual configurable for individual color cells in the next version.


Thanks!

Hi I have an enhancement to suggest to the color selector.


My application actually uses 3 color selectors all with custom colors enabled and what I've found is that all 3 of these use the same custom color palette object (ColorSelector.Custom). Is it possible to make it so that these all use a different custom color palette ie they have their own member Custom list variables instead of a static one for the entire ColorSelector class?


I've tried to define my own List of uints for each of the color selectors but the currently selected color doesn't update properly so I assume there is something else going on underneath that I don't have access to.


Thanks again!


Luan

Dose Liquid support Silverlight 4.0 beta?

Dan,

I am working with your Color Selector control and Custom Colors which is a very nice implementation!


However, I have a challenge which I am unsure how to handle:


How do I detect whether a particular color already exists in the Pallette?  For instance: #FF5E60B8 which was selected from the CustomColors functionality...  I don't want to add the color to the CustomColors if it already exists in the standard pallette...  I want to just select that color using the "SELECTED" property...


Thanks in advance!

Ron


Hi,


I have updated the demo as the current one was built against an older version of Visual Studio.  You can download the updated demo from the same link as before.


http://www.vectorlight.net/controls/itemviewer.aspx


Thanks!

Silverlight Controls

  • Rich TextBox

    Create and edit rich content with this slick and expandable Rich TextBox...

  • TreeView

    This easy to use TreeView comes with drag and drop, sorting, searching and much more...

  • Context Menu

    You too can have cool popup context menus in your Silverlight applications...

  • Resizable Dialog

    Draggable and resizable popup dialogs are what serious Silverlight developers need...

  • Spell Checker

    Real-time spell checking in Silverlight? We did it first here...