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 Spell Checker Component

This free Silverlight Spell Checker component allows you to apply real-time spell checking functionality to your Silverlight applications with the minimum of code.  Dictionaries are not supplied, however they can be freely downloaded and used with this component.

To use the Spell Checker you will need to add a reference to Liquid.Components.dll in your project.


How to Use the Spell Checker Component

To demonstrate the Spell Checker component we have a single TextBox and a Button.  The Button Click event handler takes the textbox text and runs it through the spell checker and populates a ListBox with spelling suggestions if the input word was not found in the dictionary.  In your Silverlight XAML:

<UserControl x:Class="SpellChecker.Page"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Width="400" Height="300">
    <Canvas>
        <TextBox x:Name="word" Canvas.Left="5" Canvas.Top="10" Width="200" />
        <Button Content="Check" Canvas.Left="220" Canvas.Top="10" Click="Button_Click" />
        <TextBlock Canvas.Left="5" Canvas.Top="40" Text="Suggestions" FontSize="25" />
        <ListBox x:Name="suggestions" Canvas.Left="5" Canvas.Top="75" Width="200" Height="100" />
    </Canvas>
</UserControl>


In your C# code behind file we handle the button click event and make the call to CheckWord() which returns true to indicate a correct word.  If the word is incorrect we call GetSuggestions() which returns a List<string> collection of spelling suggestions which we use to simply populate our ListBox.

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;

namespace SpellChecker
{
    public partial class Page : UserControl
    {
        private Liquid.Components.SpellChecker _spellChecker;

        public Page()
        {
            InitializeComponent();

            _spellChecker = new Liquid.Components.SpellChecker((this.GetType().Assembly.GetManifestResourceStream("SpellChecker.dictionary.en-US.dic")));
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            bool success = _spellChecker.CheckWord(word.Text);
            List<string> suggest;

            if (!success)
            {
                suggest = _spellChecker.GetSuggestions(word.Text);
                suggestions.Items.Clear();

                foreach (string s in suggest)
                {
                    suggestions.Items.Add(new ListBoxItem() { Content = s });
                }
            }
        }
    }
}


Example Silverlight Spell Checker:

Silverlight Spell Checker

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.

Memory probleMemory probleMemory probleMemory probleMemory problem




hamzeh soboh posted on SpellChecker in Windows Phone 7.1?

Please I want to know...


thanks for help

infocopy posted on FileUpload webservice problem

I have a similar problem. I can upload my files from the web server machine but when I try from a client machine I have only a 500 error on server and my file was not uploaded on a sharing directory on the server web machine.  What can I do?

(My configuration: IIS7, MS WS 2008 R2)


Thank's

Ma

haraklis1 posted on Delete/Copy/Move in file explorer

hi,

does anyone knows how to Delete/Move/Copy files in file eplorer demo? I tried with method System.IO.File.Delete(path), but it didnt like my path. I tried geting from item view (document/.../image.jpg), tried (http://localhost:1354/...) and tried

filename = Server.MapPath("~") + @"\" + path.Replace("/", @"\"); //path = document/.../image.jpg

File.Delete(filename);

Regards Adomas

infocopy posted on Problem uploading exe files

Hi, I have a proble with the you library when I try to upload a files with the exe extension. The exe file is partialy and temporary copied after that it get deleted.



Best regards

Mark

Hi


I am trying to resize images before I upload using the WriteableBitmapEx (http://writeablebitmapex.codeplex.com/) library


All my uploaded images seem bigger in size and are corrupted (not valid images)


I have the following code:


                    BitmapImage image = new BitmapImage();

                    image.SetSource(dialog.File.OpenRead());  


                    WriteableBitmap bitmap = new WriteableBitmap(image);

                    WriteableBitmap resizedBitmap = bitmap.Resize(300, 300, WriteableBitmapExtensions.Interpolation.Bilinear);  

                    

                    byte[] data = resizedBitmap.ToByteArray();

                    Stream s = new MemoryStream(data);

                    

                    _uploadingTo = TreeMenu.Selected;                    

                    target = _uploadingTo.ID;


                    _uploader.UploadData("myUpload", s, dialog.File.Name, target, dialog.File.Name, true, "");


Thanks in advance


Mark

 

Rate this: 

1 Star 2 Star 3 Star 4 Star 5 Star
20 Ratings / 3.4 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...