17
C# kursus Rohde & Schwarz 1 Moderne GUI Windows Presentation Foundation

C# kursus Rohde & Schwarz1 Moderne GUI Windows Presentation Foundation

Embed Size (px)

Citation preview

Page 1: C# kursus Rohde & Schwarz1 Moderne GUI Windows Presentation Foundation

1C# kursus Rohde & Schwarz

Moderne GUI

Windows Presentation Foundation

Page 2: C# kursus Rohde & Schwarz1 Moderne GUI Windows Presentation Foundation

2

WPF Overview

Traditional

GDI (25 years), GDI+, WinFormsDirectX (16 years), Direct3DQuartz, DirectShow (14 years)

ProblemsShowing their ageEach API is differentMixing APIs is challenging

Page 3: C# kursus Rohde & Schwarz1 Moderne GUI Windows Presentation Foundation

3

WPF Overview

CompositingUI, Documents, Media, 3D, Browser, …

Declarative programming with XAML markupFor Designers and DevelopersRewritten from scratch

Built on top of Direct3DHardware acceleratedVector basedResolution independentRetained graphics

Page 4: C# kursus Rohde & Schwarz1 Moderne GUI Windows Presentation Foundation

4

WPF Vision

Integrated, vector-based composition engine

Utilizing the power of the PC throughout the graphics stack

Unified approach to UI, Documents, and Media

Integration as part of development and experience

Declarative programmingBringing designers directly into application development

Ease of deploymentAllowing administrators to deploy and manage applications securely

Page 5: C# kursus Rohde & Schwarz1 Moderne GUI Windows Presentation Foundation

5

XAML

XML for Applications Markup Language

<Button Name="button1">Click Me!

</Button>

Button button1 = new Button();button1.Content = "Click Me!";

Page 6: C# kursus Rohde & Schwarz1 Moderne GUI Windows Presentation Foundation

6

XAML: Properties

As attributes or elements

<Button Content="Click Me!" Background="LightGreen" />

<Button> <Button.Background> LightGreen </Button.Background> Click Me!</Button>

Page 7: C# kursus Rohde & Schwarz1 Moderne GUI Windows Presentation Foundation

7

XAML: Attached Properties

<Canvas> <Button Canvas.Top="30" Canvas.Left="40"> Click Me! </Button></Canvas>

Page 8: C# kursus Rohde & Schwarz1 Moderne GUI Windows Presentation Foundation

8

Content Controls

ButtonRepeatButtonToggleButtonCheckBoxRadioButtonLabelFrameListBoxItem

StatusBarItemScollBarViewerToolTipUserControlWindowNavigationWindow...

Page 9: C# kursus Rohde & Schwarz1 Moderne GUI Windows Presentation Foundation

9

Simple Controls

PasswordBoxScrollBarProgressBarSliderTextBoxRichTextBox...

Page 10: C# kursus Rohde & Schwarz1 Moderne GUI Windows Presentation Foundation

10

Layout Controls

StackPanelWrapPanelCanvasDockPanelGrid...

Page 11: C# kursus Rohde & Schwarz1 Moderne GUI Windows Presentation Foundation

11

Headered Content Controls

ExpanderGroupBoxItemTabItem...

Page 12: C# kursus Rohde & Schwarz1 Moderne GUI Windows Presentation Foundation

12

Items Controls

MenuContextMenuStatusBarTreeViewListBoxComboBoxTabControl...

Page 13: C# kursus Rohde & Schwarz1 Moderne GUI Windows Presentation Foundation

13

Lookless Controls

Control implies behaviour

Probably supplies default lookDesigner free to supply new look

Page 14: C# kursus Rohde & Schwarz1 Moderne GUI Windows Presentation Foundation

14

Styles are about setting properties…

Page 15: C# kursus Rohde & Schwarz1 Moderne GUI Windows Presentation Foundation

15

Styles

Page 16: C# kursus Rohde & Schwarz1 Moderne GUI Windows Presentation Foundation

16

Developer or Designer?

Designer Developer

Page 17: C# kursus Rohde & Schwarz1 Moderne GUI Windows Presentation Foundation

Java kursus KMD 17

Demo