2주
강대기
Hello Silverlight
Hello XNA
Windows Phone Application
◦ 일반적인 윈도우폰 어플리케이션 템플릿
◦ 한 페이지로 이루어진 어플리케이션 용 템플릿
Windows Phone Databound Application
◦ 리스트나 내비게이션 콘트롤을 위한 어플리케이션 탬플릿
◦ 여러 페이지로 이루어진 어플리케이션을 만들 때 쓰임
Windows Phone Class Library
◦ 윈도우폰 클래스 라이브러리를 위한 어플리케이션 템플릿
◦ 다른 윈도우폰 어플리케이션에서 참고할 수 있는 클래스 라이브러리를 만들 때 사
용됨
Windows Phone Panorama Application
◦ 파노라마 콘트롤을 사용하는 어플리케이션 템플릿
◦ 줄여서 파노(Pano) 컨트롤이라고도 함
◦ 계층별로 분류한 데이터를 처리하는 어플리케이션을 만들 때 쓰임
Windows Phone Pivot Application
◦ 피봇 콘트롤을 사용하는 어플리케이션 템플릿
◦ 파노 컨트롤처럼 계층별로 분류한 데이터를 처리하는 어플리케이션을 만들 때 쓰
임
•View 메뉴에서 Other Windows를 선택하고, Toolbox 윈도우를 선택
•또는 Control-W X를 누름
•Debug 메뉴에서 Start Debugging 선택
•또는 F5 버튼을 누름
텍스트박스
TextBox
Text
버튼
Button
Content
텍스트블럭
TextBlock
Text
주로 디자이너들이 사용하는 저작 도구
프로그램의 UI를 정의하고 관리하기 위한 XML의
응용인 XAML을 쉽게 관리하기 위한 도구
프로젝트에 애니메이션 등의 효과를 추가함
실습
1. Fancy Button 생성
2. 애니메이션 효과
button1에 대한 이벤트 코드를 다음과 같이 설정
함
private void button1_Click(object sender,
RoutedEventArgs e)
{
this.textBlock1.Text = this.textBox1.Text;
this.textBox1.Text = String.Empty;
this.AnimatedBanner.Begin();
}
Hello Silverlight
const string text = "Hello, XNA!!";
SpriteFont font;
/// <summary>
/// LoadContent will be called once per game and is the place to load /// all of your content.
/// </summary>
protected override void LoadContent() {
// Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice);
// TODO: use this.Content to load your game content here this.font = Content.Load<SpriteFont>("SpriteFont1");
/// <summary>
/// This is called when the game should draw itself. /// </summary>
/// <param name="gameTime">Provides a snapshot of timing values.</param> protected override void Draw(GameTime gameTime)
{
GraphicsDevice.Clear(Color.CornflowerBlue); // TODO: Add your drawing code here
this.spriteBatch.Begin();
this.spriteBatch.DrawString(font,text,location,Color.White); this.spriteBatch.End();
base.Draw(gameTime); }
1장과 2장에서는 실버라이트를 이용한 프로그램 개발
◦ 새로운 프로젝트의 템플릿
◦ 템플릿의 종류 – Databound, Pano, Pivot
◦ XNA를 위한 템플릿
◦ 온라인 템플릿
◦ 어플리케이션 이름과 페이지 이름
◦ Solution Explorer
◦ Toolbox – TextBox, Button, TextBlock
◦ 프러퍼티 ◦ 이벤트 ◦ 레퍼럮스 ◦ 디버거 – 스텝, GoToCursor, 브레이크 포인트, 변수 보기 ◦ 에뮬레이터