Module 3 Designing and Developing a User Interface.

Slides:



Advertisements
Similar presentations
Module 1: Creating an Application by Using Windows Presentation Foundation Overview of WPF Creating a Simple WPF Application Handling Events and Commands.
Advertisements

Panels, Tab Containers Doncho Minkov Telerik School Academy schoolacademy.telerik.com Technical Trainer
Information System Design Lab 5&6. User Interface Design.
Module 10 WPF 2-D Graphics, Multimedia, and Printing.
Data Binding in GUI Application Development Patrick O’Brien.
Dinko Jakovljević Microsoft Student Partner | BambooLab
 User Interface - Raeha Sandalwala.  Introduction to UI  Layouts  UI Controls  Menus and ‘Toasts’  Notifications  Other interesting UIs ◦ ListView.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Painter Application Introducing Graphics with Windows Presentation Foundation.
1 Moderne GUI og Silverlight Windows Presentation Foundation.
C# Programming: From Problem Analysis to Program Design1 Programming Based on Events C# Programming: From Problem Analysis to Program Design 3 rd Edition.
Programming Based on Events
Web Development Using ASP.NET CA – 240 Kashif Jalal Welcome to week – 3-1 of…
WPF 3rd Party Controls WPF = Windows Presentation Foundation
Doncho Minkov Telerik School Academy academy.telerik.com Technical Trainer
Module 11 Control Customization. Module Overview Overview of Control Authoring Creating Controls Managing Control Appearance by Using Visual States Integrating.
V 1.1 Programming III. GUI APIs WPF Hello World Important UI elements UI elements / content models UI elements / inheritance.
INSPIRING CREATIVE AND INNOVATIVE MINDS Module 4: Adding Code to a Microsoft ASP.NET Web Form Implementing Code-Behind Pages Adding Event Procedures to.
Chapter 12: Using Controls. Examining the IDE’s Automatically Generated Code A new Windows Forms project has been started and given the name FormWithALabelAndAButton.
Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Technology Education Assignment #1 Advanced Computer Programming.
V 1.0 Programming III. Comparison of GUI APIs WPF Hello World UI elements Content models Inheritance chains.
Windows Presentation Foundation Adam Calderon Principal Engineer Interknowlogy LLC
Basic WPF Controls Doncho Minkov Telerik School Academy schoolacademy.telerik.com Technical Trainer
LAYOUT CONTROLS. XAML Overview XAML : eXtensible Application Markup Language pronounced (ZAMEL) is a markup language used to design user interfaces XML-based.
Object Oriented Software Development 9. Creating Graphical User Interfaces.
Module 12 Attached Properties and Behaviors in WPF.
1 Introduction to WPFUCN / 2012 Introduction to WPF Introduction to WPF Based on a Microsoft presentation.
Windows Presentation Foundation Maximilian Knor Developer Evangelist Developer and Plattform Group Microsoft Österreich
Module 6 Securing Content. Module Overview Administering SharePoint Groups Implementing SharePoint Roles and Role Assignments Securing and Auditing SharePoint.
Module 2 Introduction to Visual Studio 2010 and WPF Version 4.
Visual C# 2012 How to Program © by Pearson Education, Inc. All Rights Reserved.
Module 7 Data Binding to Collections. Module Overview Binding to Collections of Objects Using Collection Views Create Master-Detail User Interfaces Using.
Module 1 Windows Client Application Design. Module Overview Windows Client Technologies Architectural Patterns.
Rujchai Ung-arunyawee Department of Computer Engineering Khon Kaen University.
Copyright Ó Oracle Corporation, All rights reserved Working with Other Canvases.
C# kursus Rohde & Schwarz1 Moderne GUI Windows Presentation Foundation.
Layout With Panels. Canvas Most basic panel Position with explicit coordinates Attached properties: Left, Top, Right, Bottom HorizontalAlignment and VerticalAlignment.
Visual C# 2012 How to Program © by Pearson Education, Inc. All Rights Reserved.
SEEM3460 Tutorial GUI in Java. Some Basic GUI Terms Component (Control in some languages) the basic GUI unit something visible something that user can.
Module 14 Application Settings, State, and Life Cycle.
Object-Oriented Application Development Using VB.NET 1 Chapter 10 VB.NET GUI Components Overview.
Module 8 Enhancing User Interface Responsiveness.
Module 4 Taking Control of the User Interface. Module Overview Sharing Logical Resources in an Application Creating Consistent User Interfaces by Using.
Controls Part 2. DateTimePicker Control Used for representing Date/Time information and take it as input from user. Date information is automatically.
Friday, March 8 Creating real Custom Controls Kelvin van Geene 12:15.
Windows Phone Materi 4. Control Layout & Grouping Border Canvas ContentControl Grid Panorama Pivot StackPanel VirtualizingStackPanel ScrollViewer.
Module 1 Introducing C# and the.NET Framework. Module Overview Introduction to the.NET Framework 4 Creating Projects Within Visual Studio 2010 Writing.
Model View ViewModel Architecture. MVVM Architecture components.
NAME OF THE PROJECT: RESISTOR CALCULATOR CONTENTS: PURPOSE OF THE PROJECT HOW RESISTOR CALCULATOR WORKS ? EXPLANATION OF THE CODES THAT I USED CONCLUSION.
PowerBuilder Window Window Controls Window Properties Window Types
COMPUTER PROGRAMMING I 3.01 Apply Controls Associated With Visual Studio Form.
Part of the Microsoft.NET Framework 3.0 Tomer Shamam.NET Technologies Expert Sela Group
Module 3: Creating Windows-based Applications. Overview Creating the Main Menu Creating and Using Common Dialog Boxes Creating and Using Custom Dialog.
Adam Schultz MVVM and WPF. MVVM Model, View, ViewModel A software architecture designed to separate out User Interface design, Business Logic, and Data.
In Windows 8 Store Applications
Introducing WPF’s controls
Windows Presentation Foundation
Prashanth Vijayaraghavan
Leading edge windows development
Windows Presentation Foundation Layout with Panels
Graphical User Interface Concepts: Part I
Layouts AKEEL AHMED.
WPF AKEEL AHMED.
Windows Presentation Foundation
11/27/2018 7:24 PM Тренинг Введение в разработку приложений на Windows Presentation Foundation Занятие 5 Элементы управления Роман Здебский
XAML Deep Dive for Windows & Windows Phone Apps Jump Start
04 | UI Presentation & XAML
Module 8: Creating Windows-based Applications
Web Development Using ASP .NET
Presentation transcript:

Module 3 Designing and Developing a User Interface

Module Overview Defining Page Layout Using Content Controls Using Items Controls Sharing Logical Resources in a Window

Lesson 1: Defining Page Layout WPF Page Layout Model WPF Layout Classes Demonstration: Defining Layout by Using Panels Demonstration: Defining Layout by Using Grids

WPF Page Layout Model Measurement pass 1 1 Hello World! Evaluate each member of the Children collection to determine its DesiredSize Abstract rectangular bounding box Retrieve by calling GetLayout on a FrameworkElement Abstract rectangular bounding box Retrieve by calling GetLayout on a FrameworkElement Arrangement pass 2 2 Window or Page element Determine the final size of each child object and place in its layout slot Layout class Child objects

WPF Layout Classes Canvas VirtualizingStackPanel DockPanel Grid StackPanel Wrap Panel Panel Background Children ZIndex Panel Background Children ZIndex

Demonstration: Defining Layout by Using Panels In this demonstration, you will see how to: Use the Canvas class Use the StackPanel class Use the WrapPanel class Use the DockPanel class

Notes Page Over-flow Slide. Do Not Print Slide. See Notes pane.

Demonstration: Defining Layout by Using Grids In this demonstration, you will see how to use the Grid class

Lesson 2: Using Content Controls Understanding Content Controls Demonstration: Creating a User Interface by Using Content Controls Understanding Headered Content Controls Demonstration: Creating a User Interface by Using Headered Content Controls

Understanding Content Controls Common content controls: Button CheckBox GroupItem Label RadioButton RepeatButton ToggleButton ToolTip Common content controls: Button CheckBox GroupItem Label RadioButton RepeatButton ToggleButton ToolTip Contains a single item Has a Content property Contains a single item Has a Content property Examples Text DateTime UIElement Multiple objects This is text content of a Button04/03/ :06 Button

Demonstration: Creating a User Interface by Using Content Controls In this demonstration, you will see how to use the ContentControl class

Notes Page Over-flow Slide. Do Not Print Slide. See Notes pane.

Understanding Headered Content Controls Headered content controls: Expander GroupBox TabItem Headered content controls: Expander GroupBox TabItem Specialized ContentControl Has a Content property Has a Header property Specialized ContentControl Has a Content property Has a Header property Example TabItem header TabItem header GroupBox Expander

Demonstration: Creating a User Interface by Using Headered Content Controls In this demonstration, you will see how to: Use the TabItem class Use the GroupBox class Use the Expander class

Lesson 3: Using Items Controls Understanding Items Controls Handling Item Selection Demonstration: Creating a User Interface by Using Items Controls

Understanding Items Controls Contains multiple objects Has an Items property Has an ItemsSource property Contains multiple objects Has an Items property Has an ItemsSource property Common items controls: ComboBox ListBox Menu StatusBar TabControl ToolBar TreeView Common items controls: ComboBox ListBox Menu StatusBar TabControl ToolBar TreeView Can be different types ItemsSource Items

Handling Item Selection Attach event handler <ListBox SelectionChanged="ListBox1_SelectionChanged">... <ListBox SelectionChanged="ListBox1_SelectionChanged">... Define event handler public void ListBox1_SelectionChanged( object sender, SelectionChangedEventArgs e) {... } public void ListBox1_SelectionChanged( object sender, SelectionChangedEventArgs e) {... }

Demonstration: Creating a User Interface by Using Items Controls In this demonstration, you will see how to use the ListBox class

Notes Page Over-flow Slide. Do Not Print Slide. See Notes pane.

Lesson 4: Sharing Logical Resources in a window Understanding Resources Defining Resources Referencing Resources in XAML Referencing Resources Programmatically

Understanding Resources Resources provide a simple way to reuse commonly defined objects and values For example: brushes, styles, and control templates XAML Code

Defining Resources You can define resources at various levels: Application scope Window or Page scope Element-level scope Application scope Window or Page scope Element-level scope XAML

Referencing Resources in XAML To reference a resource statically PropertyName="{StaticResource ResourceKey}" <Button Background="{StaticResource blueBrush}" Foreground="{StaticResource whiteBrush}"> Text <Button Background="{StaticResource blueBrush}" Foreground="{StaticResource whiteBrush}"> Text To reference a resource dynamically PropertyName="{DynamicResource ResourceKey}" <Button Background="{DynamicResource blueBrush}" Foreground="{DynamicResource whiteBrush}"> Text <Button Background="{DynamicResource blueBrush}" Foreground="{DynamicResource whiteBrush}"> Text

Referencing Resources Programmatically FindResource method SolidColorBrush brush = (SolidColorBrush) this.FindResource("whiteBrush"); SolidColorBrush brush = (SolidColorBrush) this.FindResource("whiteBrush"); SetResourceReference method this.myButton.SetResourceReference( Button.BackgroundProperty, "whiteBrush"); this.myButton.SetResourceReference( Button.BackgroundProperty, "whiteBrush"); Resources property SolidColorBrush brush = (SolidColorBrush) this.Resources["whiteBrush"]; SolidColorBrush brush = (SolidColorBrush) this.Resources["whiteBrush"]; Or TryFindResource

Lab: Building a User Interface Exercise 1: Choosing User Interface Controls Exercise 2: Laying Out the User Interface Exercise 3: Creating and Using Resource Dictionaries Logon information Estimated time: 75 minutes

Lab Scenario You have been asked to design and write the UI for the Work Orders application that was described in Module 1. You must first identify the appropriate WPF controls to use to display and manipulate the Work Orders data and then build the UI by using these controls with XAML.

Lab Review Review Questions Why is the Grid control a good choice for general layout purposes? Why is the ListView control a good choice for displaying live data? Why would you want to put resources in a ResourceDictionary element?

Module Review and Takeaways Review Questions Best Practices