Chapter 13. Additional Topics in Visual Basic The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill

Similar documents
CSC 330 Object-Oriented

Chapter 10. Database Applications The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill

Chapter 3. Windows Database Applications The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill

10262A VB: Developing Windows Applications with Microsoft Visual Studio 2010

Developing Windows Applications with Microsoft Visual Studio 2010

Chapter 14. Additional Topics in C# 2010 The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill

DOT.NET MODULE 6: SILVERLIGHT

Windows Presentation Foundation for.net Developers

WPF. Source Module 01: Lesson1

Developing Windows Applications with Microsoft Visual Studio 2010 (MS 10262)

Developing Windows Applications with Microsoft Visual Studio 2010

Introduction p. 1 Who Should Read This Book? p. 2 Software Requirements p. 3 Code Examples p. 3 How This Book Is Organized p. 4 Conventions Used in

Windows Presentation Foundation Visual Studio.NET 2008

DE Developing Windows Applications with Microsoft Visual Studio 2010

DEVELOPING WINDOWS APPLICATIONS WITH MICROSOFT VISUAL STUDIO 2010

Visual Studio 2015: Windows Presentation Foundation (using VB.NET Language) Training Course Outline

CHAPTER 1: INTRODUCING C# 3

ExecuTrain Course Outline MOC 6460A: Visual Studio 2008: Windows Presentation Foundation

--Microsoft-- --Windows Phone--

DOT NET Syllabus (6 Months)

Windows Database Applications

DOT NET SYLLABUS FOR 6 MONTHS

Microsoft Visual Studio 2010

Beginning Silverlight 5 in C #

C# Programming: From Problem Analysis to Program Design 2nd Edition. David McDonald, Ph.D. Director of Emerging Technologies. Objectives (1 of 2)

Dot Net Framework 4.0: Advanced Microsoft C#.NET Web Development

Report Designer Report Types Table Report Multi-Column Report Label Report Parameterized Report Cross-Tab Report Drill-Down Report Chart with Static

Road Map for Essential Studio 2011 Volume 4

Windows Presentation Foundation Programming Using C#

Advanced WCF 4.0 .NET. Web Services. Contents for.net Professionals. Learn new and stay updated. Design Patterns, OOPS Principles, WCF, WPF, MVC &LINQ

C# is intended to be a simple, modern, general-purpose, objectoriented programming language. Its development team is led by Anders Hejlsberg.

2310C VB - Developing Web Applications Using Microsoft Visual Studio 2008 Course Number: 2310C Course Length: 5 Days

Fundamentals of XAML and Microsoft Expression Blend

Developing Rich Internet Applications Using Microsoft Silverlight 4

MCTS:.NET Framework 4, Windows Applications Development

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

[MS10553]: Fundamentals of XAML and Microsoft Expression Blend

Managing. mashup of chapters from. rpafi/jl enterprise88. Packt's bestselling Silverlight. Data and Media in Microsoft Silverlight 4: A.

Programming in C# for Experienced Programmers

Developing Rich Internet Applications Using Microsoft Silverlight 4

NE Fundamentals of XAML and Microsoft Expression Blend

Business Insight Authoring

Chapter 1 Getting Started with Windows Presentation Foundation

Cognos. Active Reports Development. Presented by: Craig Randell

Road Map for Essential Studio 2010 Volume 1

C# Programming: From Problem Analysis to Program Design. Fourth Edition

NetAdvantage for WPF 12.2 Service Release Notes May 2013

SharePoint 2010 Central Administration/Configuration Training

Programming with ADO.NET

Variable Scope The Main() Function Struct Functions Overloading Functions Using Delegates Chapter 7: Debugging and Error Handling Debugging in Visual

10267A CS: Developing Web Applications Using Microsoft Visual Studio 2010

Windows Presentation Foundation (WPF)

NET 3.0 and NET 3.0 contains four building blocks, shown in the figure below:

NetAdvantage Reporting Release Notes

20483BC: Programming in C#

Programming in C#

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

Programming in C# (20483)

Writing Reports with Report Designer and SSRS 2014 Level 1

Chapter 9. Web Applications The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill

P a g e 1. Danish Tecnological Institute. Developer Collection Online Course k Developer Collection

Developing Applications Using Visual Basic 2008: Volume 2

ArtOfTest Inc. Automation Design Canvas 2.0 Beta Quick-Start Guide

Apex TG India Pvt. Ltd.

Practical WPF. Learn by Working Professionals

What s New Essential Studio Reporting Edition, 2011 Volume 3

COPYRIGHTED MATERIAL. Contents. Part I: C# Fundamentals 1. Chapter 1: The.NET Framework 3. Chapter 2: Getting Started with Visual Studio

CHAPTER 1: INTRODUCTION TO THE IDE 3

Microsoft. Microsoft Visual C# Step by Step. John Sharp

Introduction. Thank you for picking up Silverlight 1.0 Unleashed! IN THIS CHAPTER. . Who Should Read This Book?. Software Requirements

Kendo UI Builder by Progress : Using Kendo UI Designer

Exploring.Net Orcas. Contents. By Punit Ganshani

Application Aspect. Hierarchical DataGridView v1.7 BOOKLET

Nebraska - eforms. Tips and Tricks

VERSION JANUARY 19, 2015 TEST STUDIO QUICK-START GUIDE STANDALONE & VISUAL STUDIO PLUG-IN TELERIK A PROGRESS COMPANY

How to use data sources with databases (part 1)

Kendo UI. Builder by Progress : Using Kendo UI Designer

Management Reports Centre. User Guide. Emmanuel Amekuedi

DEVELOPING DATABASE APPLICATIONS (INTERMEDIATE MICROSOFT ACCESS, X405.5)

Jim Jackson II Ian Gilman

Certified Visual Basic 2005 Programmer VS-1147

The software shall provide the necessary tools to allow a user to create a Dashboard based on the queries created.

What s New for WinRT. Essential Studio Enterprise Edition 2013 Volume 2

Mastering VB.NET using Visual Studio 2010 Course Length: 5 days Price: $2,500

VB.NET Web : Phone : INTRODUCTION TO NET FRAME WORK

Programming C# 5.0. Ian Griffiths O'REILLY' Beijing Cambridge * Farnham Kbln Sebastopol Tokyo

INFRAGISTICS Silverlight 15.2 Volume Release Notes 2015

Kendo UI. Builder by Progress : What's New

"Charting the Course to Your Success!" MOC B Programming in C# Course Summary

The course introduces many of the techniques and technologies employed by modern desktop and enterprise applications, including:

Microsoft Visual Studio 2010 Training Course Catalogue. Learning Solutions

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

Course Description. Audience. Module Title : 20483B: Programming in C# Duration : 5 days. Course Outline :: 20483B ::

Coding Faster: Getting More Productive with Microsoft Visual

Introduction Accessing MICS Compiler Learning MICS Compiler CHAPTER 1: Searching for Data Surveys Indicators...

Hands-On Lab. Developing BI Applications. Lab version: Last updated: 2/23/2011

Index COPYRIGHTED MATERIAL. Symbols and Numerics

Upgrading to Windows Server 2008

CIS 209 Final Exam. 1. A Public Property procedure creates a property that is visible to any application that contains an instance of the class.

Getting started 7. Setting properties 23

Transcription:

Chapter 13 Additional Topics in Visual Basic McGraw-Hill 2010 The McGraw-Hill Companies, Inc. All rights reserved.

Objectives Write Windows applications that run on mobile devices Display database information on a mobile device Create interfaces with Windows Presentation Foundation (WPF) Query a variety of data sources using Language- Integrated Queries (LINQ) Understand and apply the concepts of localization Use threading in an application using the BackgroundWorker component McGraw-Hill 13-2

Device Applications Creating output for PDAs, cell phones, and pagers requires different protocols Visual Basic can be used to develop applications for these mobile devices The Visual Studio IDE has features for creating solutions that deploy to Smart Devices Mobile devices that run compact and mobile versions of Windows McGraw-Hill 13-3

Using Emulators Smart Device applications developed with VS can be viewed in a regular window or in an emulator Emulators provide a better visual concept of the final output VS Professional Edition installs several emulators and more are available for download McGraw-Hill 13-4

Smart Device Applications Select Smart Device for the project type and the Smart Device Project template McGraw-Hill 13-5

A First Smart Device Application Step-by-Step - 1 Create the project Select Smart Device project type Add menu items File, Display, and Exit Write the code Run the application McGraw-Hill 13-6

A First Smart Device Application Step-by-Step - 2 Add controls to the form Application running in a device emulator McGraw-Hill 13-7

A Database Application Smart Devices can access database files Adding database access to a Smart Device application is similar to Windows Use the Data Sources window or the Data menu Drag a table or fields to the form to create bound controls Change the Data Source to Microsoft SQL Server Compact 3.5 McGraw-Hill 13-8

Changing Column Styles Formatting for the columns of a data grid is different from the Windows DataGridView The data grid contains a TableStyles property, which is a collection Select the GridColumnStyles collection in the DataGridTableStyle Collection Editor Change the width and header text of individual columns McGraw-Hill 13-9

Creating a Data Form The smart tag of the data grid provides the option to Generate Data Forms Generates a form with a New menu item Delete the New menu item and code if not creating a database update program Run a data grid application Double-click on a row in the data grid A single record displays on the form McGraw-Hill 13-10

Updating a Database Difficult to test a database update program using an emulator Emulator does not retain the database from one run to the next without advanced configuration If an actual Smart Device is cradled to the computer, transfer the database file to the device and test the update process McGraw-Hill 13-11

Displaying Records in Details View Drag the table for a data grid or for a details view No binding navigator Use a combo box In the smart tag, set the combo box DataSource and DisplayMember properties Scroll to the top of the Properties window Expand the (DataBindings) entry Select (Advanced) Set the Data Source Update Mode to Never McGraw-Hill 13-12

Windows Presentation Foundation (WPF) - 1 Included in Visual Studio 2008 Create special effects seen in Windows Vista applications Write WPF for Windows XP and Vista Special effects do not appear in XP unless a plug-in is installed and the machine is running XP SP2 Includes development platforms for Windows and Web applications McGraw-Hill 13-13

Windows Presentation Foundation (WPF) - 2 Write stand-alone and browser applications and programs that display XPS documents Browser applications created through Visual Studio require.net components to be installed on the client machine and only run in Internet Explorer Silverlight is a related technology Has some features of WPF Ability to run on multiple browser platforms More universal development option McGraw-Hill 13-14

The Roles of Designer and Programmer Tools make it easy to separate design from programming Programmers generally use Visual Studio Programmer places a button on a window Designers prefer Expression Interactive Designer Designer transforms the button to a flashy design feature WPF applications contain two basic files Window.xaml and Application.xaml XAML browser applications are referred to as XBAP s (XAML browser applications) McGraw-Hill 13-15

WPF Features - 1 Feature set includes layouts and controls Controls are very similar to Windows Forms controls Layout is set up in a panel Most common layout is grid DockPanel, Canvas, and StackPanel are other layouts XAML style element has same type of functionality as a cascading style sheet WPF uses templates, such as data and control templates McGraw-Hill 13-16

WPF Features - 2 Flexible for including multimedia Include text, documents, images, video, audio, and 2D or 3D graphics Use transformations and effects Rotation and resizing of objects Use a Storyboard class for animation WPF includes data binding and interface automation Allows creation of hybrid applications Add WPF features to a Windows Forms application or Windows controls to a WPF page McGraw-Hill 13-17

Creating a WPF Project - 1 Select WPF Application or WPF Browser Application as the project template Name property is set at the top of the window A Search box allows a property to be found quickly Labels have a Content instead of a Text property A Window has a Title property A text box has a Text property McGraw-Hill 13-18

Creating a WPF Project - 2 To change the name of a form Change the name of the file in the Solution Explorer (does not change the name of the class) Use Refractor/Rename to change the name of the class If the name of the startup form is changed, change the Startup URI file to the new name McGraw-Hill 13-19

Interoperability Toolbox for windows applications contains a WPF Interoperability category Contains an ElementHost control A container that allows the addition of WPF controls to a Windows Form Add other WPF controls to the toolbox or add controls in code Add a grid panel inside an ElementHost control Helps lay out multiple controls Add an Imports System.Windows.Controls statement to allow the addition of controls in code McGraw-Hill 13-20

LINQ A standard language to query any data source defined as an object, a database, or as XML Includes arrays, collections, databases, flat files, and XML McGraw-Hill 13-21

LINQ Keywords - 1 Operators are standard regardless of source of the data Primary LINQ operators From, In, Where, and Select McGraw-Hill 13-22

LINQ Keywords - 2 The LINQ Query General Form Dim VariableName = From ItemName In Object Where Condition _ Select ListOfFields/Items No data type is specified LINQ uses type inference to allow the Order By and Where operators to be used on unspecified data types The LINQ Query Example Dim BelowMinimumQuery = From AnItem In AmountDecimal Where AnItem < 100D Select AnItem McGraw-Hill 13-23

A First Look at LINQ In clause refers to the name of the object From is one element in the collection, does not need to be declared Think of the From object as a single element in a For Each loop Where clause allows for a condition If all records are wanted, omit the Where clause Select clause executes the query and gives a result McGraw-Hill 13-24

Additional LINQ Keywords Operators available for sorting and grouping Aggregate operators include Average, Count, Max, Min, and Sum McGraw-Hill 13-25

LINQ to SQL Apply a LINQ query to a relational database Add a LINQ to SQL Classes template to the project Creates a strongly typed DataContext class Use the Object Relational (O/R) Designer Drag database tables from Server Explorer to the design surface Refer to the DataContext when writing code McGraw-Hill 13-26

LINQ to XML - 1 Retrieve data elements from an XElement or XDocument object Refer to elements in an XElement object in the In and/or Select clause of LINQ XML literals simplifies referring to child elements, attributes, and descendants McGraw-Hill 13-27

LINQ to XML - 2 VB three-axis model for referring to elements in a XML document McGraw-Hill 13-28

World-Ready Programs Localization used to mean creating a separate version of an application for each language or country, after-the-fact Today planning of applications used in different countries, languages, and cultures should be part of the original design and development stages McGraw-Hill 13-29

Globalization, Localizability, and Localization - 1 Globalization is process of designing for multiple cultures and locations User interface and output allow for multiple languages Rules and data for a specific language are called a culture/locale Contains information about character sets, formatting, currency, measurement rules, and methods of sorting McGraw-Hill 13-30

Globalization, Localizability, and Localization - 2 Localizability determines whether an object can be localized Resources that change are separated from the rest of the code One set of code can change, another set does not change McGraw-Hill 13-31

Globalization, Localizability, and Localization - 3 Localization is the process of translating the interface for a culture/locale Set the form s Localizable property to true Set different Text values for each control for each language Form s Language property is set to Default The current language set by the operating system Change the Language property to a different language and enter the Text property of each control in that language A separate resource file is created for each language McGraw-Hill 13-32

Globalization, Localizability, and Localization - 4 The CultureInfo class Contains associated language, sublanguage, calendar, and access to cultural conventions Number and date formatting and comparisons of strings Import the System.Globalization namespace to use CultureInfo class McGraw-Hill 13-33

Threading - 1 A thread is a separate execution path that allows a program to do more than one thing at a time A program may have several threads running at once Use the BackgroundWorker component to execute time-consuming operations asynchronously in the background The computer switches rapidly from one thread to another, making it appear that all are executing simultaneously McGraw-Hill 13-34

Threading - 2 Multitasking allows the computer to appear as though it is running several programs at once Each program, or process, gets a share of the processor time A process requires a complete copy of program code and data Within a single program, use Multithreading to accomplish multiple tasks Place each task in a separate thread Uses fewer resources because each thread does not require its own copy of code and data Methods that wait for a response are blocking methods and are placed in a separate thread so that a problem will interrupt just that thread, not the whole program McGraw-Hill 13-35

Background Workers - 1 Add a BackgroundWorker component from the Components section of the toolbox In code, specify which procedure to execute in the background and then call the component s RunWorkerAsync method to run the thread The DoWork method of the Background Worker does the processing Background work can be started while executing any procedure Add an Imports statement for System.ComponentModel to access the BackgroundWorker class in code McGraw-Hill 13-36

Background Workers - 2 McGraw-Hill 13-37