Vectorlight News

  • Chat App Converted to HTML and JQuery
    Sep 08, 2011

    Converted from Silverlight to HTML and Javascript/JQuery is the Vectorlight Chat App. Login using your Vectorlight password to chat using your username and avatar.

  • HTML5 iPhone,Android Big Guns Tower Defense
    Jul 02, 2011

    Big Guns has made the leap from Windows Phone 7 (XNA) to HTML5 so you can now play it on your iPhone, Android and other HTML5 compatible devices.

  • HTML5 Games - Word Poppers and Batty
    Jun 04, 2011

    As the take-up of HTML5 quickens (74% of users currently have a browser capable of HTML5 Canvas) we present two more games for both your browser and mobile.

  • Big Guns Tower Defense on Windows Phone 7
    May 06, 2011

    Coming soon to Windows Phone 7 is an XNA port of the popular Vectorlight tower defense game Super Tower Defense. Whilst retaining many of the graphical and gameplay features of the original Silverlight game.

  • Wakacube WP7 Update
    Apr 26, 2011

    Released to the Windows Phone 7 marketplace today is Version 1.1 of Wakacube the 3D physics game of skill. Included in the update are more levels (30 in total) and new mode Wakatime which generates random crate structures to keep players entertained long after the levels have been completed.

  • Home Page News

Silverlight Resizable Table

This free Table control is similar to the standard Grid control, except with this all rows and columns can be resized easily and borders can easily be applied to cells.

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


How to Use the Table Control

To use the Table on your Silverlight page:

<UserControl x:Class="Table.Page"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:liquidRichText="clr-namespace:Liquid;assembly=Liquid.RichText"
    xmlns:liquidTreeView="clr-namespace:Liquid;assembly=Liquid.TreeView"
    Width="400" Height="200">
    <Grid x:Name="LayoutRoot" Background="White">
        <liquidRichText:Table HeaderRows="1" CellPadding="2" Margin="2" BorderBrush="#000000" BorderThickness="1" CellBorderBrush="#000000" CellBorderThickness="1">
            <liquidRichText:Table.ColumnDefinitions>
                <ColumnDefinition />
                <ColumnDefinition />
                <ColumnDefinition />
            </liquidRichText:Table.ColumnDefinitions>
            <liquidRichText:Table.RowDefinitions>
                <RowDefinition Height="25" />
                <RowDefinition />
            </liquidRichText:Table.RowDefinitions>
            <liquidRichText:Table.HeaderFill>
                <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
                    <GradientStop Color="#f6fbfd" Offset="0.0" />
                    <GradientStop Color="#d5effc" Offset="0.9" />
                    <GradientStop Color="#e7f5fd" Offset="0.9" />
                    <GradientStop Color="#e7f5fd" Offset="1.0" />
                </LinearGradientBrush>
            </liquidRichText:Table.HeaderFill>
            <TextBlock Grid.Column="0" Grid.Row="0" Text="A TreeView" FontFamily="Arial" FontSize="16" FontWeight="Bold" HorizontalAlignment="Center" />
            <TextBlock Grid.Column="1" Grid.Row="0" Text="A TextBox" FontFamily="Arial" FontSize="16" FontWeight="Bold" HorizontalAlignment="Center" />
            <TextBlock Grid.Column="2" Grid.Row="0" Text="A CheckBox" FontFamily="Arial" FontSize="16" FontWeight="Bold" HorizontalAlignment="Center" />
            <liquidTreeView:Tree Grid.Column="0" Grid.Row="1" Width="Auto" Height="Auto" Background="#f0f0f0">
                <liquidTreeView:Tree.Nodes>
                    <liquidTreeView:Node Title="Root" Icon="images/folder.png" IconExpanded="images/folderOpen.png" IsExpanded="True">
                        <liquidTreeView:Node.Nodes>
                            <liquidTreeView:Node Title="Item 1" Icon="images/pdf.png" />
                            <liquidTreeView:Node Title="Item 2" Icon="images/pdf.png" />
                            <liquidTreeView:Node Title="Item 3" Icon="images/pdf.png" />
                            <liquidTreeView:Node Title="Item 4" Icon="images/pdf.png" />
                            <liquidTreeView:Node Title="Item 5" Icon="images/pdf.png" />
                        </liquidTreeView:Node.Nodes>
                    </liquidTreeView:Node>
                </liquidTreeView:Tree.Nodes>
            </liquidTreeView:Tree>
            <TextBox Grid.Column="1" Grid.Row="1" Text="Some text." AcceptsReturn="True" TextWrapping="Wrap" />
            <CheckBox Grid.Column="2" Grid.Row="1" Content="My Option" />
        </liquidRichText:Table>
    </Grid>
</UserControl>


In the XAML above we have a Table control containing some controls, each control column has a heading.  Notice by hovering the mouse over a grid line the cursor changes allowing you to resize the rows and columns.

Example Silverlight Table Control:

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

balajim123 posted on Hyperlink Problem

this is type link is not wokring


http://test2.ezsmartsite.com/ViewNewsletter.aspx?SID=FwF16hucc9k=&REA=K6tVDKjnRGB/zuZZAd/wUuT91PwtQRaIbq0G2JLZfGU=&SI=1-0-0-0-0-0


follow the steps:

1. Go to the demo richtext page

2. set the hyperlink(top link)

3. click on preview


then i am getting error

Hey Dan


When i tried opening the SilverlightControlsDemo project, I got 60 error messages and warnings like these:


Error 28 The type 'liquidTreeView:Tree' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built. C:\Users\bbdnet0991\Downloads\SilverlightControlsDemo\SilverlightControlsDemo\Page.xaml 110 26 SilverlightControlsDemo

Error 59 The type 'liquidTreeView:Tree' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built. C:\Users\bbdnet0991\Downloads\SilverlightControlsDemo\SilverlightControlsDemo\Page.xaml 186 22 SilverlightControlsDemo

Error 30 The type 'liquidTreeView:Node' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built. C:\Users\bbdnet0991\Downloads\SilverlightControlsDemo\SilverlightControlsDemo\Page.xaml 112 34 SilverlightControlsDemo

Error 32 The type 'liquidTreeView:Node' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built. C:\Users\bbdnet0991\Downloads\SilverlightControlsDemo\SilverlightControlsDemo\Page.xaml 114 42 SilverlightControlsDemo

Error 34 The type 'liquidTreeView:Node' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built. C:\Users\bbdnet0991\Downloads\SilverlightControlsDemo\SilverlightControlsDemo\Page.xaml 116 50 SilverlightControlsDemo

Error 35 The type 'liquidTreeView:Node' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built. C:\Users\bbdnet0991\Downloads\SilverlightControlsDemo\SilverlightControlsDemo\Page.xaml 117 50 SilverlightControlsDemo

Error 36 The type 'liquidTreeView:Node' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built. C:\Users\bbdnet0991\Downloads\SilverlightControlsDemo\SilverlightControlsDemo\Page.xaml 118 50 SilverlightControlsDemo

Error 37 The type 'liquidTreeView:Node' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built. C:\Users\bbdnet0991\Downloads\SilverlightControlsDemo\SilverlightControlsDemo\Page.xaml 119 50 SilverlightControlsDemo

Error 38 The type 'liquidTreeView:Node' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built. C:\Users\bbdnet0991\Downloads\SilverlightControlsDemo\SilverlightControlsDemo\Page.xaml 120 50 SilverlightControlsDemo

Error 39 The type 'liquidTreeView:Node' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built. C:\Users\bbdnet0991\Downloads\SilverlightControlsDemo\SilverlightControlsDemo\Page.xaml 123 42 SilverlightControlsDemo

Error 41 The type 'liquidTreeView:Node' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built. C:\Users\bbdnet0991\Downloads\SilverlightControlsDemo\SilverlightControlsDemo\Page.xaml 125 50 SilverlightControlsDemo

Error 42 The type 'liquidTreeView:Node' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built. C:\Users\bbdnet0991\Downloads\SilverlightControlsDemo\SilverlightControlsDemo\Page.xaml 126 50 SilverlightControlsDemo

Error 43 The type 'liquidTreeView:Node' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built. C:\Users\bbdnet0991\Downloads\SilverlightControlsDemo\SilverlightControlsDemo\Page.xaml 127 50 SilverlightControlsDemo

Error 44 The type 'liquidTreeView:Node' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built. C:\Users\bbdnet0991\Downloads\SilverlightControlsDemo\SilverlightControlsDemo\Page.xaml 128 50 SilverlightControlsDemo

Error 45 The type 'liquidTreeView:Node' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built. C:\Users\bbdnet0991\Downloads\SilverlightControlsDemo\SilverlightControlsDemo\Page.xaml 129 50 SilverlightControlsDemo

Error 46 The type 'liquidTreeView:Node' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built. C:\Users\bbdnet0991\Downloads\SilverlightControlsDemo\SilverlightControlsDemo\Page.xaml 132 42 SilverlightControlsDemo

Error 47 The type 'liquidTreeView:Node' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built. C:\Users\bbdnet0991\Downloads\SilverlightControlsDemo\SilverlightControlsDemo\Page.xaml 133 42 SilverlightControlsDemo

Error 49 The type 'liquidTreeView:Node' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built. C:\Users\bbdnet0991\Downloads\SilverlightControlsDemo\SilverlightControlsDemo\Page.xaml 135 50 SilverlightControlsDemo

Error 50 The type 'liquidTreeView:Node' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built. C:\Users\bbdnet0991\Downloads\SilverlightControlsDemo\SilverlightControlsDemo\Page.xaml 136 50 SilverlightControlsDemo

Error 51 The type 'liquidTreeView:Node' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built. C:\Users\bbdnet0991\Downloads\SilverlightControlsDemo\SilverlightControlsDemo\Page.xaml 137 50 SilverlightControlsDemo

Error 52 The type 'liquidTreeView:Node' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built. C:\Users\bbdnet0991\Downloads\SilverlightControlsDemo\SilverlightControlsDemo\Page.xaml 138 50 SilverlightControlsDemo

Error 53 The type 'liquidTreeView:Node' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built. C:\Users\bbdnet0991\Downloads\SilverlightControlsDemo\SilverlightControlsDemo\Page.xaml 139 50 SilverlightControlsDemo

Error 54 The type 'liquidTreeView:Node' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built. C:\Users\bbdnet0991\Downloads\SilverlightControlsDemo\SilverlightControlsDemo\Page.xaml 142 42 SilverlightControlsDemo

Error 12 The type 'LiquidRichText:TextBlockPlus' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built. C:\Users\bbdnet0991\Downloads\SilverlightControlsDemo\SilverlightControlsDemo\Page.xaml 21 18 SilverlightControlsDemo

Error 14 The type 'liquidRichText:TextBlockPlus' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built. C:\Users\bbdnet0991\Downloads\SilverlightControlsDemo\SilverlightControlsDemo\Page.xaml 29 18 SilverlightControlsDemo

Error 17 The type 'liquidRichText:TextBlockPlus' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built. C:\Users\bbdnet0991\Downloads\SilverlightControlsDemo\SilverlightControlsDemo\Page.xaml 51 22 SilverlightControlsDemo

Error 18 The type 'liquidRichText:TextBlockPlus' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built. C:\Users\bbdnet0991\Downloads\SilverlightControlsDemo\SilverlightControlsDemo\Page.xaml 52 22 SilverlightControlsDemo

Error 19 The type 'liquidRichText:TextBlockPlus' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built. C:\Users\bbdnet0991\Downloads\SilverlightControlsDemo\SilverlightControlsDemo\Page.xaml 53 22 SilverlightControlsDemo

Error 20 The type 'liquidRichText:TextBlockPlus' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built. C:\Users\bbdnet0991\Downloads\SilverlightControlsDemo\SilverlightControlsDemo\Page.xaml 54 22 SilverlightControlsDemo

Error 21 The type 'liquidRichText:TextBlockPlus' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built. C:\Users\bbdnet0991\Downloads\SilverlightControlsDemo\SilverlightControlsDemo\Page.xaml 55 22 SilverlightControlsDemo

Error 22 The type 'liquidRichText:TextBlockPlus' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built. C:\Users\bbdnet0991\Downloads\SilverlightControlsDemo\SilverlightControlsDemo\Page.xaml 56 22 SilverlightControlsDemo

Error 23 The type 'liquidRichText:TextBlockPlus' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built. C:\Users\bbdnet0991\Downloads\SilverlightControlsDemo\SilverlightControlsDemo\Page.xaml 57 22 SilverlightControlsDemo

Error 24 The type 'liquidRichText:TextBlockPlus' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built. C:\Users\bbdnet0991\Downloads\SilverlightControlsDemo\SilverlightControlsDemo\Page.xaml 58 22 SilverlightControlsDemo

Error 25 The type 'liquidRichText:TextBlockPlus' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built. C:\Users\bbdnet0991\Downloads\SilverlightControlsDemo\SilverlightControlsDemo\Page.xaml 59 22 SilverlightControlsDemo

Error 26 The type 'liquidPopup:Dialog' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built. C:\Users\bbdnet0991\Downloads\SilverlightControlsDemo\SilverlightControlsDemo\Page.xaml 103 14 SilverlightControlsDemo

Error 56 The type 'liquidPopup:Dialog' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built. C:\Users\bbdnet0991\Downloads\SilverlightControlsDemo\SilverlightControlsDemo\Page.xaml 174 14 SilverlightControlsDemo

Error 58 The type 'liquidPopup:Dialog' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built. C:\Users\bbdnet0991\Downloads\SilverlightControlsDemo\SilverlightControlsDemo\Page.xaml 179 14 SilverlightControlsDemo

Error 57 The type 'liquid:Viewer' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built. C:\Users\bbdnet0991\Downloads\SilverlightControlsDemo\SilverlightControlsDemo\Page.xaml 175 18 SilverlightControlsDemo

Error 16 The type 'liquid:Scroller' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built. C:\Users\bbdnet0991\Downloads\SilverlightControlsDemo\SilverlightControlsDemo\Page.xaml 49 14 SilverlightControlsDemo

Warning 5 The referenced project '..\..\Liquid\Liquid\Liquid.csproj' does not exist. SilverlightControlsDemo

Warning 4 The referenced project '..\..\Liquid\Liquid.TreeView\Liquid.TreeView.csproj' does not exist. SilverlightControlsDemo

Warning 3 The referenced project '..\..\Liquid\Liquid.RichText\Liquid.RichText.csproj' does not exist. SilverlightControlsDemo

Warning 2 The referenced project '..\..\Liquid\Liquid.Popup\Liquid.Popup.csproj' does not exist. SilverlightControlsDemo

Warning 1 The referenced project '..\..\Liquid\Liquid.Menu\Liquid.Menu.csproj' does not exist. SilverlightControlsDemo

Warning 9 The referenced component 'Liquid.TreeView' could not be found.

Warning 8 The referenced component 'Liquid.RichText' could not be found.

Warning 7 The referenced component 'Liquid.Popup' could not be found.

Warning 6 The referenced component 'Liquid.Menu' could not be found.

Warning 10 The referenced component 'Liquid' could not be found.

Error 29 The attachable property 'Nodes' was not found in type 'Tree'. C:\Users\bbdnet0991\Downloads\SilverlightControlsDemo\SilverlightControlsDemo\Page.xaml 111 30 SilverlightControlsDemo

Error 60 The attachable property 'Nodes' was not found in type 'Tree'. C:\Users\bbdnet0991\Downloads\SilverlightControlsDemo\SilverlightControlsDemo\Page.xaml 187 26 SilverlightControlsDemo

Error 31 The attachable property 'Nodes' was not found in type 'Node'. C:\Users\bbdnet0991\Downloads\SilverlightControlsDemo\SilverlightControlsDemo\Page.xaml 113 38 SilverlightControlsDemo

Error 33 The attachable property 'Nodes' was not found in type 'Node'. C:\Users\bbdnet0991\Downloads\SilverlightControlsDemo\SilverlightControlsDemo\Page.xaml 115 46 SilverlightControlsDemo

Error 40 The attachable property 'Nodes' was not found in type 'Node'. C:\Users\bbdnet0991\Downloads\SilverlightControlsDemo\SilverlightControlsDemo\Page.xaml 124 46 SilverlightControlsDemo

Error 48 The attachable property 'Nodes' was not found in type 'Node'. C:\Users\bbdnet0991\Downloads\SilverlightControlsDemo\SilverlightControlsDemo\Page.xaml 134 46 SilverlightControlsDemo

Error 13 The attachable property 'Foreground' was not found in type 'TextBlockPlus'. C:\Users\bbdnet0991\Downloads\SilverlightControlsDemo\SilverlightControlsDemo\Page.xaml 22 22 SilverlightControlsDemo

Error 15 The attachable property 'Foreground' was not found in type 'TextBlockPlus'. C:\Users\bbdnet0991\Downloads\SilverlightControlsDemo\SilverlightControlsDemo\Page.xaml 30 22 SilverlightControlsDemo

Error 55 The attachable property 'ContentRight' was not found in type 'Dialog'. C:\Users\bbdnet0991\Downloads\SilverlightControlsDemo\SilverlightControlsDemo\Page.xaml 150 18 SilverlightControlsDemo

Error 27 The attachable property 'Content' was not found in type 'Dialog'. C:\Users\bbdnet0991\Downloads\SilverlightControlsDemo\SilverlightControlsDemo\Page.xaml 104 18 SilverlightControlsDemo

Error 11 Closing tag for element '<LiquidRichText:TextBlockPlus>' was not found. C:\Users\bbdnet0991\Downloads\SilverlightControlsDemo\SilverlightControlsDemo\Page.xaml 28 17 SilverlightControlsDemo


I tried unblocking the dll files and placing them in C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\PublicAssemblies


Please help :-(

Lebo

Hi ,

       How apply justify for richtextbox please help me

Hi,

I'm trying to create a user control for creating and editing e-mail message body. When I'm inserting an image (from absolute URL) into RTB, the image does not apear on the screen. It realy exist inside the content and I can see the image when visualize HTML content, but in normal view the omage does not apear. Am i missing something?


 I am inserting the image like:


richTextBox.Insert("<Xaml><Image Source=""" & "http://localhost:50655/someimage.jpg" & """ /></Xaml>")


rem: this is VB code :-)




Enlarging the font size 16 or larger for a numbered or bulletted list in the message content causes the numbers or bullet points to not be displayed fully.


Steps to replicate this issue on the demo page (http://www.vectorlight.net/silverlight/demos/richtextbox.aspx):


Create a new message

Add a numbered list e.g. 1. 2. or bullet list

Select the list and make the font size 16 or larger

The numbers will not be displayed properly

prayeso posted on Message outdent bug!

We traced the bug in ApplyBulletsToSelection method and added the additional check, please see before and after lines of code for the for loop.


            //for (i = startLineIndex; i <= endLineIndex; i++)

            for (i = startLineIndex; i <= endLineIndex && i < ElementChildren.Rows.Count; i++)



        /// <summary>

        /// Applies bulleting/numbering/indenting to a selection of content

        /// </summary>

        /// <param name="startIndex">Start index</param>

        /// <param name="endIndex">End index</param>

        /// <param name="formatting">Formatting to apply</param>

        /// <param name="param">A formatting dependant parameter</param>

        private void ApplyBulletsToSelection(int startIndex, int endIndex, Formatting formatting, object param)

        {

            int startLineIndex;

            int endLineIndex;

            RichTextPanelRow current;

            List<UIElement> currentChildren;

            Bullet newBullet;

            int indent = 0;

            BulletType? currentType = null;

            int indexInElements;

            bool insertBullet = true;

            double leftMargin = 0;

            int listNumber = 1;

            int lastLineIndex;

            int numberInserted = 0;

            string currentStyle;

            int i;


            if (formatting == Formatting.Indent || formatting == Formatting.Outdent)

            {

                startLineIndex = ElementChildren.GetRowIndexForElement(ElementChildren.ContentChildren[startIndex]);

                endLineIndex = ElementChildren.GetRowIndexForElement(ElementChildren.ContentChildren[endIndex]);

            }

            else

            {

                // Look backwards for the start of the bulleted list

                startLineIndex = GetFirstLineInList(startIndex);


                // Look forwards for the end of the bulleted list

                endLineIndex = GetLastLineInList(endIndex);

            }


            lastLineIndex = ElementChildren.ContentChildren.Count - endLineIndex;


            for (i = startLineIndex; i <= endLineIndex; i++)

            {

                indent = 0;

                current = ElementChildren.Rows[i];

                currentChildren = current.GetChildren(ElementChildren.ContentChildren);


                if (currentChildren.Count > 0)

                {

                    indexInElements = ElementChildren.ContentChildren.IndexOf(currentChildren[0]);

                    if (currentChildren[0] is Bullet)

                    {

                        indent = ((Bullet)currentChildren[0]).Indent;

                        currentType = ((Bullet)currentChildren[0]).Type;

                        if (formatting == Formatting.Indent || formatting == Formatting.Outdent)

                        {

                            listNumber = ((Bullet)currentChildren[0]).Number;

                        }


                        ElementChildren.Remove(currentChildren[0]);

                        if (currentChildren.Count > 1)

                        {

                            current.Start = currentChildren[1];

                            numberInserted--;

                            _length--;

                        }

                    }

                }

                else

                {

                    indexInElements = -1;

                }


                if (formatting == Formatting.RemoveBullet || formatting == Formatting.RemoveNumber)

                {

                    //ElementChildren.Update(current, false, null);

                    //endLineIndex = ElementChildren.ContentChildren.Count - lastLineIndex;

                    continue;

                }


                if (insertBullet)

                {

                    newBullet = new Bullet();

                    newBullet.Height = current.Dimensions.Y - (current.Margin.Top + current.Margin.Bottom);

                    newBullet.Number = listNumber;


                    switch (formatting)

                    {

                        case Formatting.BulletList:

                            newBullet.Type = BulletType.Bullet;

                            if (indent == 0)

                            {

                                indent = 1;

                            }

                            break;

                        case Formatting.BulletImageList:

                            newBullet.Type = BulletType.Image;


                            if (param is Uri)

                            {

                                newBullet.BulletImage = (Uri)param;

                            }

                            else

                            {

                                newBullet.BulletImage = new Uri(param.ToString());

                            }


                            if (indent == 0)

                            {

                                indent = 1;

                            }

                            break;

                        case Formatting.NumberList:

                            newBullet.Type = BulletType.Number;

                            if (indent == 0)

                            {

                                indent = 1;

                            }

                            break;

                        case Formatting.Indent:

                            newBullet.Type = (currentType != null ? (BulletType)currentType : BulletType.Indent);

                            indent++;

                            break;

                        case Formatting.Outdent:

                            newBullet.Type = (currentType != null ? (BulletType)currentType : BulletType.Indent);

                            indent--;

                            if (indent < 0)

                            {

                                indent = 0;

                            }

                            break;

                    }


                    newBullet.Indent = indent;

                    leftMargin = newBullet.IndentWidth;


                    if (formatting == Formatting.Outdent && indent == 0)

                    {

                    }

                    else

                    {

                        currentStyle = GetStyle(ElementChildren.ContentChildren[indexInElements]);

                        ApplyStyleToElement(newBullet, currentStyle);

                        ElementChildren.Insert(indexInElements, newBullet);

                        current.Start = newBullet;

                        numberInserted++;

                        _length++;

                    }

                    listNumber++;

                    insertBullet = false;

                }


                if (currentChildren[currentChildren.Count - 1] is Newline)

                {

                    insertBullet = true;

                }

            }


            //for (i = startLineIndex; i <= endLineIndex; i++)

            for (i = startLineIndex; i <= endLineIndex && i < ElementChildren.Rows.Count; i++)

            {

                current = ElementChildren.Rows[i];

                // Update the line to ensure the bullet hasn't pushed content off the edge

                ElementChildren.Update(current, false, null);

            }


            _selectedEnd.GlobalIndex += numberInserted;

            _selectedEnd.CalculatePositionFromGlobalIndex(ElementChildren.ContentChildren);

            _cursorPosition = new RichTextBoxPosition(_selectedEnd);

        }

Rate this: 

1 Star 2 Star 3 Star 4 Star 5 Star
21 Ratings / 3.2 Average

Tweets

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