Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
SL 4.0, Hello world...
01-14-2011, 03:41 PM
Post: #1
Tongue SL 4.0, Hello world...
Start your VS 2010.

Start a new project, then Select your desired language (C# in my case).
[Image: vs2010_create_new_project.png]

Then select SL Application, give some name to the app (say HelloWorld...). Now move your mouse pointer to the glowing button named 'OK' and apply a force of 1 Newton on left mouse button or simply press 'Enter'.

[Image: figure-1-step-1-1-create-silverlight-project2.png]

It will ask you if you want to add a hosting webpage for this dummy app.

[Image: silverlight-project.png]

Do as shown.

Thats it now you have you project ready to be developed.

You can see this thingy in solution explorer.

[Image: step5.png]

Your project's main page is Page.xaml and its code is in Page.xaml.cs.

[Image: step6.png]

Now in the page Page.xaml, under the main <Grid x:Name="LayoutRoot" ..
type <Butt... and it will show you all available controls... something like this.

[Image: step8.png]

Add it to the XAML file and inside Button tag add attribute as shown below.

[Image: step9.png]

Now you have a push me Button in your interface. You can check it by compiling and viewing in browser.

[Image: step10.png]

Now add an event handler on click event of this button like this.

[Image: step11.png]

Typing Click will show you. Add this now this event is present in your Page.xaml.cs.

[Image: step12.png]

Open that Page.xaml.cs file and see that event lying there waiting for some code stuff.

[Image: step15.png]

Add code in that event

//MyButton is id of the button I added.

Now 'F5' your VS and TaDaaaa... The app is there. Push your button and the content will be changed. Thats all.

One thing more. Did you notice it was not a Hello World!!! app at all. It was kinda Push Me hard!!! app Blush. Anyways, take care. Tongue Bye...

View Asad Ali's profile on LinkedIn

01-14-2011, 04:39 PM
Post: #2
RE: SL 4.0, Hello world...
nice post.

Thanks & Regards,
01-14-2011, 06:24 PM
Post: #3
RE: SL 4.0, Hello world...
very impressive post....
keep posting....

[Image: 2604595733.png]
01-14-2011, 07:14 PM
Post: #4
Tongue RE: SL 4.0, Hello world...

View Asad Ali's profile on LinkedIn

01-16-2011, 11:13 AM
Post: #5
RE: SL 4.0, Hello world...
Good One Smile

Thanks and Regards
01-17-2011, 07:35 AM
Post: #6
RE: SL 4.0, Hello world...
Good post..keep posting...

“A mind stretched by a new idea can never go back to its original dimension.”

05-25-2011, 06:10 AM
Post: #7
RE: SL 4.0, Hello world...

Good Post thanks a lot
07-07-2011, 01:04 PM
Post: #8
RE: SL 4.0, Hello world...
Thanks for your valuable post

User(s) browsing this thread: 1 Guest(s)