CPSC Tutorial 5

Similar documents
CPSC Tutorial 5 WPF Applications

CPSC Tutorial 6

CPSC Tutorial 4

CPSC Tutorial 4 Visual Studio and C#

CPSC Tutorial 9 Blend & Animations

Advanced Programming C# Lecture 3. dr inż. Małgorzata Janik

Week 7: NavigationView Control Exercise

WebFront for Service Manager

Week 8: Data Binding Exercise (Bookstore)

Authoring Guide Gridpro AB Rev: Published: March 2014

Authoring Guide v2.1 PATRIK SUNDQVIST

IAP C# Lecture 5 XAML and the Windows Presentation Foundation. Geza Kovacs

CS3240 Human-Computer Interaction Lab Sheet Lab Session 3 Designer & Developer Collaboration

CPSC 481 Tutorial 4. Intro to Visual Studio and C#

Step4: Now, Drag and drop the Textbox, Button and Text block from the Toolbox.

Lesson 9: Exercise: Tip Calculator

Note: many examples in this section taken or adapted from Pro WPF 4.5 C#, Matthew MacDonald, apress, 2012, pp

Note: This demo app created for this lab uses the Visual Studio 2015 RTM and Windows Tools SDK ver

RadPDFViewer For Silverlight and WPF

Microsoft Windows Apps Dev w/microsoft.net Framework 4. Download Full Version :

Master Code on Innovation and Inclusion

Hands-On Lab. Hello Windows Phone

CPSC 481 Tutorial 10 Expression Blend. Brennan Jones (based on tutorials by Bon Adriel Aseniero and David Ledo)

Hands-On Lab. Sensors -.NET. Lab version: Last updated: 12/3/2010

sharpcorner.com/uploadfile/37db1d/4958/default.aspx?articleid=cb0b291c-52ae-4b80-a95c- 438d76fa1145

Windows Presentation Foundation. Jim Fawcett CSE687 Object Oriented Design Spring 2018

This book was purchased by

LAYOUT. Chapter 3 of Pro WPF : By Matthew MacDonald Assist Lect. Wadhah R. Baiee. College of IT Univ. of Babylon

windows-10-universal #windows- 10-universal

RadGanttView For Silverlight and WPF

Hands-On Lab. Building Applications in Silverlight 4 Module 6: Printing the Schedule. Printing the Schedule

Week 6: First XAML Control Exercise

Sparkline for WPF 1. ComponentOne. Sparkline for WPF

New Insights into Process Deviations Using Multivariate. Control Charts

User Interface Changes for SYSPRO

ArcGIS Pro SDK for.net UI Design for Accessibility. Charles Macleod

Lecture # 6 Engr. Ali Javed 11th March, 2014

Interface Builders and Interface Description Languages

CS3240 Human-Computer Interaction Lab Sheet Lab Session 2

ComponentOne. Extended Library for UWP

Name of Experiment: Country Database

Hands-On Lab. Using Pivot and Panorama Controls

Chromatic Remote Control Product Guide Executive Way, Suite A Frederick, MD 21704

Weather forecast ( part 2 )

Migrating to Windows Phone

Accurate study guides, High passing rate! IT TEST BOOK QUESTION & ANSWER. Ittestbook provides update free of charge in one year!

WPF Viewer for Reporting Services 2008/2012 Getting Started

WPF Graphics and Multimedia

Visão Computacional: Reconhecimento da Mão Humana e Seus Movimentos. Licenciatura em Gestão de Sistemas e Computação. Visão Computacional:

Getting Started with Banjos4Hire

Workspace Desktop Edition Developer's Guide. Customize Views and Regions

Exam sell. Higher Quality Better Service! Certified IT practice exam authority.

Introduction to Data Templates and Value Converters in Silverlight

Name of Experiment: Student Database

Launchers and Choosers Hands-on Lab. Hands-On Lab. Launchers and Choosers. Lab version: Last updated: 12/8/2010. Page 1

Portable Class Libraries ---

This tutorial is designed for software developers who want to learn how to develop quality applications with clean structure of code.

CMSC434. Introduction to Human-Computer Interaction. Week 10 Lecture 16 Mar 29, 2016 Engineering Interfaces II. Jon

Microsoft Corporation

ComponentOne. HyperPanel for WPF

Fundamentals of XAML and Microsoft Expression Blend

Universal Windows Platform Complete Solution

XAML - BUTTON. The Button class represents the most basic type of button control. The hierarchical inheritance of Button class is as follows

Chapter 13: Handling Events


CHANNEL9 S WINDOWS PHONE 8.1 DEVELOPMENT FOR ABSOLUTE BEGINNERS

LAB 2 CREATING A COMBINED PROPOSAL

ComponentOne. PdfViewer for WPF and Silverlight

ComponentOne. Imaging for UWP

CS3240 Human-Computer Interaction Lab Sheet Lab Session 4 Media, Ink, & Deep Zoom

EXAMGOOD QUESTION & ANSWER. Accurate study guides High passing rate! Exam Good provides update free of charge in one year!

UNIVERSITY OF CALGARY Information Technologies WEBFORMS DRUPAL 7 WEB CONTENT MANAGEMENT

PHPRad. PHPRad At a Glance. This tutorial will show you basic functionalities in PHPRad and

Quick Start - WPF. Chapter 4. Table of Contents

Adobe Dreamweaver CS5 Tutorial

Applied WPF 4 in Context US $49.99 SOURCE CODE ONLINE

Windows Presentation Foundation

Instructions PLEASE READ (notice bold and underlined phrases)

Tutorial - Hello World

WRITING THE MANAGEMENT SYSTEM APPLICATION

[MS10553]: Fundamentals of XAML and Microsoft Expression Blend

Programming for e-learning Developers

Styles and Control Templates

Copyright Soyatec. Licensed under the Eclipse Public License 1.0

1. Begin by selecting [Content] > [Add Content] > [Webform] in the administrative toolbar. A new Webform page should appear.

KillTest. 半年免费更新服务

SAMPLE CHAPTER. C# and XAML. Pete Brown MANNING

Microsoft Word 2013 Working with tables

TDMobile Architecture & Overview of the TD Mobile IDE. Horst de Lorenzi

Developing Native Windows Phone 7 Applications for SharePoint

CS3240 Human-Computer Interaction

ComponentOne. GanttView for WPF

Creating Reports in Access 2007 Table of Contents GUIDE TO DESIGNING REPORTS... 3 DECIDE HOW TO LAY OUT YOUR REPORT... 3 MAKE A SKETCH OF YOUR

CSC 355 PROJECT 4 NETWORKED TIC TAC TOE WITH WPF INTERFACE

What s a module? Some modules. it s so simple to make your page unique

GIMP WEB 2.0 BUTTONS

NE Fundamentals of XAML and Microsoft Expression Blend

Instructions PLEASE READ (notice bold and underlined phrases)

Class Test 5. Create a simple paint program that conforms to the following requirements.

Creating Web Applications Using ASP.NET 2.0

Transcription:

CPSC 481 - Tutorial 5 Assignment #2 and WPF (based on previous tutorials by Alice Thudt, Fateme Rajabiyazdi, David Ledo, Brennan Jones, Sowmya Somanath, and Kevin Ta)

Introduction

Contact Info li26@ucalgary.ca Please always include [CPSC 481] in the subject header Expect replies in: 24 hours on weekdays 48 hours on weekends http://pages.cpsc.ucalgary.ca/~li26/481/

Assignment #2

Assignment #2 Continuation of the interface your team started designing (ideally). Two more design evolutions: Horizontal prototyping (20%) Moderately robust system that implements vertical functionality (80%) Prototype using C# Perform a heuristic evaluation

Horizontal Prototype Deadline: March 6th (Monday) in class Write-up = including redesign rational (i.e., changes from the first prototype), screen snapshots Horizontal prototype presentation freeze Email your slides (PDF files) to me (li26@ucalgary.ca) OR submit in a USB with your write-up Presentation on 7th / 9th during tutorial

Final Project Deadline: April 7th (Friday) in class Complete portfolio (Assignment 1 + new stuff) Redesign rational Implementation freeze = no more changing code after this point Latest screen snapshots Heuristic evaluation of final system Final discussion

Final Project (cont.) USB / DVD: All source code (executable on any lab machine) Required data files README file

Final Project Demo April 10th ~ 14th in lab Roughly 30 mins ALL team members must participate Be prepared!

Assignment #2 March 6th (Monday) in class Horizontal Prototype Redesign + Presentation Slides Freeze March 7th ~ 9th during tutorial Horizontal Prototype Presentation (20%) April 7th (Friday) in class Final Project Submission April 10th ~ 14th in lab Project Demonstration (80%)

Study the handout!

WPF

What is WPF? Windows Presentation Foundation Rendering user interfaces in Windows-based applications (labels, textboxes, buttons, etc.) Good for rapid interface designing WPF uses XAML (Extensive Application Markup Language) = an XMLbased mark-up language WPF separates the appearance of the interface (implemented using XAML) from its behaviour (implemented in C#)

Starting a Project

WPF Application interface explorer XAML coding area

XAML <Window x:class="_481wpf1examples.mainwindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="350" Width="525"> <Grid> </Grid> </Window> XAML code: MainWindow.xaml C# code: MainWindow.xaml.cs

Layouts The Grid is a layout panel that arranges its child controls in a tabular structure of rows and columns. Its functionality is similar to the HTML table but more flexible. The StackPanel is simple layout in WPF. It stacks its child elements below or besides each other depending on its orientation. Useful for creating any kinds of lists. There are others: Dock panel, Wrap panel and Canvas panel.

Grid Layout <Grid Height="320" VerticalAlignment="Bottom"> <Grid.RowDefinitions> <RowDefinition Height="Auto" /> <RowDefinition Height="38" /> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto" /> <ColumnDefinition Width="200"/> </Grid.ColumnDefinitions> <Label Grid.Row="0" Grid.Column= 0" Content="Name:"/> <Label Grid.Row="1" Grid.Column= 0" Content="E- Mail:"/> <Label Grid.Column= 1" Grid.Row= 0" Margin="3" Content="Sowmya Somanath"/> <Label Grid.Column="1" Grid.Row= 1" Margin="3" Content="ssomanat@ucalgary.ca"/> </Grid>

StackPanel Layout <StackPanel> <TextBlock Margin="10" FontSize= 20"> How do you like your coffee? </TextBlock> <Button Margin="10">Black</Button> <Button Margin="10">With milk</button> <Button Margin="10">With Sugar</Button> </StackPanel>

Button Drag and drop from TOOLBOX onto the main screen in MainWindow.xaml XAML code: <Grid> <Button Content="Click Here" HorizontalAlignment="Left" Margin="101,123,0,0" VerticalAlignment="Top" Width="210" Height="90"/> </Grid>

Label Drag and drop from TOOLBOX onto the main screen in MainWindow.xaml XAML code: <Grid> <Label Content="I am a label" HorizontalAlignment="Left" Margin="101,70,0,0" VerticalAlignment="Top" Width="210"/> </Grid>

Event Handling Double click on your button, and it should redirect you to MainWindow.xaml.cs: private void Button_Click(object sender, RoutedEventArgs e) { } This is an event handler for button click. Events are messages constantly sent by the visual elements to your main program.

Event Handling (cont.) MainWindow.xaml.cs: private void Button_Click(object sender, RoutedEventArgs e) { label1.content = Hello World! ; } This changes the label content when the button is pressed.

Event Handling (cont.) List of events

Multiple Events <Label Name="label1" Content="" HorizontalAlignment="Left" Margin="164,112,0,0" VerticalAlignment="Top" Width="210"/> <Button Content="Button" HorizontalAlignment="Left" Height="100" Margin="103,159,0,0" VerticalAlignment="Top" Width="308" MouseEnter="Button_MouseEnter" MouseLeave= Button_MouseLeave"/> private void Button_MouseEnter(object sender, MouseEventArgs e) { label1.content = "Mouse Enter"; } private void Button_MouseLeave(object sender, MouseEventArgs e) { label1.content = "Mouse Leave"; }

Image Add an image to your interface <Grid> <Image HorizontalAlignment="Left" Height="182" Margin="104,55,0,0 VerticalAlignment="Top" Width="271"/> </Grid>

Image (cont.) Change the source to your image

Exercise Fruit Selection I Selected: Apple Orange

Visibility

Visibility (cont.) In MainWindow.xaml.cs in the radio box event handler: private void radial1_checked(object sender, RoutedEventArgs e) { bool radial1val = radial1.ischecked.value; if (radial1val == true) { label1.content = "Apples"; appleimage.visibility = Visibility.Visible; orangeimage.visibility = Visibility.Hidden; } else { label1.content = ""; } } Similarly for radio box 2

Next Week More WPF! Feel free to show me your horizontal prototypes

Thank You