Powered by MSDN

US - English
NEW! Silverlight 5 is available Learn More

How do you add a new .XAML file to the project RSS

6 replies

Last post Sep 03, 2009 05:08 PM by Silverlight Web Developer

(0)
  • Silverlight Web Developer

    Silverlight...

    Member

    101 Points

    395 Posts

    How do you add a new .XAML file to the project

    Sep 03, 2009 04:22 PM | LINK

    I have created a New Project - Silverlight Application that is named "myFirst"

    It created 2 folders. "myFirst" and "myFirst.Web".

    1. My First question is wich of these folders that I will develop my application in. With this I meen add Folders, ImageFolders, .txt Files etc. ?

    2. It has created a file under "myFist" named: "MainPage.xaml". What I need is to create a new .xaml file named: "Login.xaml" but when rightclicking "myFirst" and choose "New Item", I cant see any .XAML file anywhere. What is the procedure to create a new .XAML file that automatically will hold a .cs file ?

    Thank You!

  • Sergey.Lutay

    Sergey.Lutay

    Star

    13559 Points

    2381 Posts

    Re: How do you add a new .XAML file to the project

    Sep 03, 2009 04:33 PM | LINK

    Hi,

    Silverlight Web Developer

    1. My First question is wich of these folders that I will develop my application in. With this I meen add Folders, ImageFolders, .txt Files etc. ?

    There are a Silverlight app at myFirst folder and asp.net app at myFirst.Web

    Silverlight Web Developer

    2. It has created a file under "myFist" named: "MainPage.xaml". What I need is to create a new .xaml file named: "Login.xaml" but when rightclicking "myFirst" and choose "New Item", I cant see any .XAML file anywhere. What is the procedure to create a new .XAML file that automatically will hold a .cs file ?

    You need to choose Silverlight UserControl from window "Add New Item"

     

    (If I answered the question, please click on "mark as answer".)

    Twitter

    Sincerely,
    Sergii Lutai

    MCT, MCPD, Head of Dev. Dept at DCT
  • Pravinkumar R. D.

    Pravinkumar...

    Contributor

    5034 Points

    801 Posts

    Re: How do you add a new .XAML file to the project

    Sep 03, 2009 04:41 PM | LINK

    Hi,

    Check this Blog-

    http://www.dotnetcurry.com/ShowArticle.aspx?ID=226

    http://pkrd.blogspot.com/2009/05/writing-first-silverlight-20-program.html

    Thanks,

    Pravin

    "Please mark as answered, if this answers your question"

    silverlight 3.0

  • Silverlight Web Developer

    Silverlight...

    Member

    101 Points

    395 Posts

    Re: How do you add a new .XAML file to the project

    Sep 03, 2009 04:41 PM | LINK

    Thank you, Sergey.Lutay,

    I understood how to add the Silverlight UserControl but I am not sure if I understand the differences between "myFirst" and "myFirst.Web".

    When I develop my application will I add folders, textFiles and Images to "myFirst". Is this where I develop the application. ?

    If I understand correct I will not add anything to "myFirst.Web".

    I am not sure about the differences of these. For example wich of these folder is the one I will host on the webserver later on ?

    Thank you...

  • Sergey.Lutay

    Sergey.Lutay

    Star

    13559 Points

    2381 Posts

    Re: How do you add a new .XAML file to the project

    Sep 03, 2009 04:49 PM | LINK

    Silverlight Web Developer

    When I develop my application will I add folders, textFiles and Images to "myFirst". Is this where I develop the application. ?

    If you will download resources to Silverlight app from server you should add all resources to ASP.NET(myFirst.Web) project.(You will download a resources over http)

    If you want to make your resources as part of Silverlight app you should add them to myFirst project(Resources will be as part of Silverlight assembly and will increase size of assemvly)

    You will need to deploy myFirst.Web project to server.

     

    (If I answered the question, please click on "mark as answer".)

    Twitter

    Sincerely,
    Sergii Lutai

    MCT, MCPD, Head of Dev. Dept at DCT
  • Pravinkumar R. D.

    Pravinkumar...

    Contributor

    5034 Points

    801 Posts

    Re: How do you add a new .XAML file to the project

    Sep 03, 2009 04:56 PM | LINK

    Hi,

    1) "myFirst" this is a Silverlight application. where you do designing and writing code for that design. You can prefer using Miccrosoft Expression Blend for designing purpose. And VS 2008/2010, for development purpose.

    2) "myFirst.Web" This is a web application which will host Silverlight application (Silverlight controls) on HTML page/ .ASPX pages. So, your web app will act like host for Silverlight app.

    3) Silverlight App always works at client side in browser. It will be deployed in form of a compressed format called .XAP.

    4) To access any Data, Text file or Images from Silverlight app, you can either keep it in Silverlight app or in Web application. If you keep the files in Silverlight app then you can package it in .XAP file as resources or You can download the contents from we application on demand as well.

    5) For database connectivity you can prefer using WCF/Web Services for this.

    Check the Lab Manuals below-

    http://pkrd.blogspot.com/2009/05/silverlight-20-lab-manuals-for.html

    http://silverlight.net/GetStarted/

    Thanks,

    Pravin

    "Please mark as answered if this answers your question"

    silverlight 3.0

  • Silverlight Web Developer

    Silverlight...

    Member

    101 Points

    395 Posts

    Re: How do you add a new .XAML file to the project

    Sep 03, 2009 05:08 PM | LINK

    Thank you for your answers, I think this gave me a better understanding of the differences between this folders. I am coming from ASP.net so I try to see what simularities there is etc...

    Thanks for help