Home > Uncategorized > Sending SMS from Silverlight

Sending SMS from Silverlight

I downloaded VS 2008 SP1, and the Silverlight SDK. Dissappointed to see that there was no obvious "design view" for silverlight, I guess Microshaft wants us all to buy Expression Blend, so I just created a canvas with a giant button in XAML

<UserControl xmlns:dataInput="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.Input"  x:Class="HelloSilverlight.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot;
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml&quot;
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008&quot; xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006&quot;
    mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480">
  <Grid x:Name="LayoutRoot">
     <Button Content="Send SMS" Click="Button_Click"></Button>
  </Grid>
</UserControl>

Added a reference to http://www.freebiesms.co.uk/sendsms.asmx

Added using HelloSilverlight.FreebieSMS; to the namespace includes.

Then, this as the event handler

 private void Button_Click(object sender, RoutedEventArgs e)
        {
            // Button clicked
            sendSmsSoapClient SMS = new sendSmsSoapClient();
            SMS.SendSmsAsync("Bob", "00447866069537", "00447866069535", "Test from Silverlight", "en-GB");
        }

All downloadable from http://sites.google.com/site/freesmsuk/silverlight

Advertisements
Categories: Uncategorized
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: