Latest News

  • Super Tower Defense 2 Game
    Sep 03, 2010

    New to the games section is Super Tower Defense 2. Featuring more maps, new units and bigger explosions.

  • Super Cards Online Multiplayer Game
    Aug 13, 2010

    Released today in the games section is the new Super Cards multiplayer card game. The aim of the game is to get rid of all your playing cards before your opposition.

  • Silverlight Online Chat
    Jul 24, 2010

    Today we launch the new Silverlight Live Chat application demonstrating the Liquid RichTextBox and Emoticon replacements.

  • New Super Shoot Em Up 2 Game
    Jun 29, 2010

    Added to the Games section is the new Super Shoot 'Em Up 2 game. Take control of your tank with the aim to defeat the computer controlled opponents. Features all new weapons, levels and Battle Mode!

  • Silverlight 4 Controls V5.3.2 Released
    Jun 28, 2010

    This release contains several fixes raised in the forums.

Silverlight DropDown Control

This free DropDown control is, as its name suggests a generic control for allowing any content to be presented in a manner similar to the ComboBox.

This Silverlight only DropDown Control 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 DropDown control you will need to add a reference to Liquid.dll in your project.


How to Use the DropDown Control

To use the DropDown on your Silverlight page:

<UserControl x:Class="DropDown.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"
    xmlns:liquidTreeView="clr-namespace:Liquid;assembly=Liquid.TreeView"
    Width="400" Height="300">
    <Grid x:Name="LayoutRoot" Background="White">
        <liquid:DropDown x:Name="dropDown" Width="100" Height="23" SelectedItemContent="Pick...">
            <liquidTreeView:Tree x:Name="treeView" Width="150" Height="150" EnableLines="True" SelectionChanged="Tree_SelectionChanged">
                <liquidTreeView:Node Title="Root Node">
                    <liquidTreeView:Node Title="Item 1" />
                    <liquidTreeView:Node Title="Item 2" />
                    <liquidTreeView:Node Title="Item 3" />
                    <liquidTreeView:Node Title="Item 4" />
                    <liquidTreeView:Node Title="Item 5" />
                </liquidTreeView:Node>
            </liquidTreeView:Tree>
        </liquid:DropDown>
    </Grid>
</UserControl>


With this DropDown control example we embed a TreeView control, this is the content that will "drop down" or "popup" when the button it clicked.

We have a single DropDown control named dropDown, this when clicked will display the TreeView and allow you to expand and select a single node from the tree.  When you have selected a node the TreeView will close, this is handled in a few lines of C# below.

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 DropDown
{
    public partial class Page : UserControl
    {
        public Page()
        {
            InitializeComponent();
        }

        private void Tree_SelectionChanged(object sender, TreeEventArgs e)
        {
            dropDown.SelectedItemContent = e.Target.Title;
            dropDown.IsOpen = false;
        }
    }
}


As you can see in the C# we attach an event handler to theSelectionChanged event which occurs when a node is selected.  In this event we change the SelectedItemContent property of our dropdown to relect the changes made and then close the dropdown with DropDown.IsOpen = false.

Example Silverlight DropDown Control:

The DropDown 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.

facos posted on DropDown AutoClose

hi dan,


would it be possible to include the automatic closing of the dropdown when clicking outside or losing the focus within the library as an option? it would help to avoid a lot of repetitive code...


best regards...

kieran@serif.net posted on ItemViewer items_ItemSelected

Sorry guys,


I answered the problem by looking into this a little further.  I had seen the solution many times but thought it was looking at the treeview not the itemview....


Anyway, here it is:


private void items_ItemSelected(object sender, EventArgs e)

        {

            deleteName.Text = items.Selected.LiquidTag.ToString();

            deleteFile.IsEnabled = true;

        }


Sorry again and keep up the good work!

stefanHauck posted on Viewer Problem

Hi,

I use the viewer inside a tab control and get during design time very often the following error:


InnerException: reference not set to an instance of an object

NullReferenceException: reference not set to an instance of an object


StackTrace

at MS.Internal.XcpImports.MethodEx(InPtr ptr, String name, CValue[] cvDate)

at MS.Internal.XcpImports.MethodEx(DependencyObject obj, String name)

at MS.Internal.XcpImports.FrameworkElement_ApplyTemplate(FramerworkElement frameworkElement)

at System.Windows.Controls.Control.ApplyTemplate()


After I change something in the code and switch bacl to design view, it mostly work until I close and reopen the page again.

What can I check to make it working?


Stefan

dan posted on FileUpload

Hi,


There is no limit to the size that can be uploaded and the upload size of this component has nothing to do with the web.config settings.  When uploading a file it is broken up into small chuncks usually around 30k in size and sent to the server.  There is a bug in version 5.3.2 and below that can cause a memory leak, this is being fixed and will be implemneted in the next version.


Thanks!

jstangwh posted on DropDown small change

very good

dan posted on Scroller Speed

Hi,


There isn't a separate property to control speed.  However you can simply use larger directional values:


myScorller.Direction = new Point(2,0);


The above will scroll 2 pixels to the right per frame.


Thanks!

Rate this page: 

1 Star 2 Star 3 Star 4 Star 5 Star
22 Ratings / 3.4 Average

Ultimate Gamers

  • 1 Gh0sT
  • 2 stig
  • 3 dhoz
  • 4 seyhmusss
  • 5 RadiateLogic
  • 6 bigblue531
  • 7 janso
  • 8 DutchRemco
  • 9 Gendibal
  • 10 dan

  • See the full chart here!

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...