eclipse4SLが意外と使える件

Eclipse用のSilverlight開発ツールであるeclipse4SLをちょっと使ってみたら意外と使えたので紹介してみる。

ダウンロードとインストールは以下のサイトを参考

プロジェクト作成

まずはSilverilghtプロジェクトの作成(Silverlight Web Projectなんていうのもある)

プロジェクト名を入力してFinish!

プロジェクトエクスプローラを見るとVisual Studio 2008と全く同じ構成になっているのがわかる。

Page.xamlを開くと、これまたVisual Studio 2008とよく似た感じのスプリットされたエディタが表示された。

こんな感じでコード補完も効くようです。

でも残念ながらC#のコード補完は効かないみたいです。

とりあえずComboBoxを使ったコードを書いてみた。

Page.xaml
<UserControl x:Class="SLApp.Page"
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Width="400"
	Height="300">
	<Grid x:Name="LayoutRoot" Background="White">
		<ComboBox x:Name="combobox" Width="150" Height="25">
		</ComboBox>
	</Grid>
</UserControl>
Page.xaml.cs
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 SLApp
{
    public partial class Page : UserControl
    {
        public Page()
        {
            InitializeComponent();
            
            combobox.ItemsSource = new[] {
            	"John",
            	"Bob",
            	"Cindy"
            };
        }
    }
}

実行するにはプロジェクトエクスプローラでプロジェクトを右クリックして、[Run As]→[Silverlight Web Application]を選択する。

ブラウザが起動して・・・おっ!!ちゃんと実行された。

使ってみた感じ、簡単なものならVS使うよりもこっちの方がいいかもしれん。軽いし速いし。コード補完なんていらね!!という漢にはこれで十分かも!?