Presentation is loading. Please wait.

Presentation is loading. Please wait.

XAML 신비를 벗다 발표자 : 최우진

Similar presentations


Presentation on theme: "XAML 신비를 벗다 발표자 : 최우진"— Presentation transcript:

1 XAML 신비를 벗다 발표자 : 최우진 uxpro@live.comstep79@hotmail.com

2 ▶ XAML 의 필요성 ▶ XAML 의 정의 ▶ 엘리먼트와 어트리뷰트 ▶ 네임스페이스 ▶ 프로퍼티 엘리먼트 ▶ 타입컨버터 ▶ 마크업 확장식 ▶ 오브젝트 엘리먼트의 자식요소들 ▶ XAML 과 프로그래밍 코드를 함께 고고싱 ▶ 정리 ▶ Q & A

3 XAML 의 필요성 사용자 인터페이스 혹은 객체 간의 계층구조를 간결하 게 표현하는데 적합 디자인과 개발을 분리할 수 있기 때문에 유지보수 측 면에서 상당히 유용 윈도우 SDK 에 포함되어 있는 XamlPad 같은 프로그램 으로 컴파일하지 않고도 결과를 즉시 확인할 수 있다. WPF 로 작성된 대부분의 프로그램에서 사용된다.

4 XAML 의 정의 닷넷의 객체들을 초기화하거나 생성하기에 적합하도 록 설계된 간편하고 범용적인 선언형 프로그래밍 언어 닷넷 프레임워크 3.0 은 컴파일러와 XAML 실행 파서, 익스플로러 내에서 WPF 기반 XAML 파일을 독립적으 로 실행시킬 수 있는 플러그인 포함

5 엘리먼트와 어트리뷰트 XAML: <Button xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" Content="OK"/> C#: System.Windows.Controls.Button b = new System.Windows.Controls.Button(); b.Content = "OK"; XAML: <Button xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" Content="OK" Click="button_Click"/> C#: System.Windows.Controls.Button b = new System.Windows.Controls.Button(); b.Click += new System.Windows.RoutedEventHandler(button_Click); b.Content = "OK";

6 네임스페이스 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation " xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" <WpfNamespace:Button xmlns:WpfNamespace= "http://schemas.microsoft.com/winfx/2006/xaml/presentation" Content="OK"/>

7 프로퍼티 엘리먼트 System.Windows.Controls.Button b = new System.Windows.Controls.Button(); System.Windows.Shapes.Rectangle r = new System.Windows.Shapes.Rectangle(); r.Width = 40; r.Height = 40; r.Fill = System.Windows.Media.Brushes.Black; b.Content = r; // Make the square the content of the Button

8 프로퍼티 엘리먼트 <Button xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" Content="OK" Background="White"/> OK White

9 타입컨버터 System.Windows.Controls.Button b = new System.Windows. b.Content = "OK"; b.Background = System.Windows.Media.Brushes.White; <Button xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation” Content="OK"> <Button xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation” Content="OK">

10 마크업 확장식 없음

11 오브젝트 엘리먼트의 자식요소들 컨텐트 프로퍼티 컬렉션 아이템 ▷리스트 ▷딕셔너리 더 다양한 형변환

12 XAML 과 프로그래밍 코드를 함께 고고 싱 런타임 시에 XAML 을 로드하고 파싱하기 ▷ XamlReader ▷ XAML 엘리먼트에 이름 사용하기 XAML 컴파일하기

13 XAML 의 키워드 공부하세요 ^^;;

14 Q & A

15 Quiz 같은 크기의 버튼 모양 XAML 파일을 만들었을때 Button 으로 작업을 한 것과 Rectangle 로 작업을 한 것은 마우스 이벤트 효과에서 어떤 차이가 있을까요 ? Ex) Button1.XXXXXX (O) Button2.XXXXXX (O) Button1.YYYYYY (O) Button2.YYYYYY (X)


Download ppt "XAML 신비를 벗다 발표자 : 최우진"

Similar presentations


Ads by Google