Data Binding에서 Source와 Target의 Property 타입이 서로 다른 경우가 있다. 예를 들어 바인딩된 변수의 값에 따라 체크 박스를 표시해야…
Visual Studio에서 XAML 코딩을 하면 XAML 디자이너가 실시간으로 UI 렌더링을 해줘서 편리하다. 한가지 아쉬움이 있다면 XAML 디자이너는 Static한 XAML 코드만…
XAML Resource는 Brush, Style, Font, Image 등의 XAML object를 말한다. 한번 정의된 Resource는 XAML 코드에서 재사용할 수 있다. (참고로 프로젝트에 별도로 추가되는 이미지 파일같은…
Panel 클래스를 이용하여 큰 레이아웃을 정한 다음에는 컨트롤을 왼쪽으로 붙일지, 가운데에 맞출지, 간격은 얼마나 띄울지 등의 미세 조정이 필요하다.
Window는 컨텐츠용 차일드를 하나만 포함할 수 있다. 다행히 WPF에서는 여러 개의 차일드를 적절히 배치해주는 Panel 계열 클래스를 제공하기 때문에 Panel 객체를 Window의 차일드로 사용함으로써 다양한 화면…
WPF App이 언제 종료될 수 있는지에 대한 조건을 ShutdownMode 속성에 명시한다. 이 속성은 다음 3가지 값을 가질 수 있다.
<Application x:Class="WpfApp2.App"…
WPF App Project를 생성하면 App.xaml과 MainWindow.xaml 이 기본으로 생성된다. App 클래스는 Application을 상속받은 것으로 프로그램의 시작과 종료를 담당한다. MainWindow는 화면에 보이는 메인 UI다.
App.xaml의 StartupUri 속성에 MainWindow.xaml이 명시되어 있기 때문에 프로그램 실행시 메인 UI가 보이게 된다.