XAML User Interface Creation in C#

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

Introduction to HTML & CSS
XML: Extensible Markup Language
The Web Warrior Guide to Web Design Technologies
Dinko Jakovljević Microsoft Student Partner | BambooLab
Windows Presetation Foundation (WPF) 1. Introduction.
XHTML1 Building Document Structure. XHTML2 Objectives In this chapter, you will: Learn how to create Extensible Hypertext Markup Language (XHTML) documents.
Web Development Using ASP.NET CA – 240 Kashif Jalal Welcome to week – 3-1 of…
ASP.NET Programming with C# and SQL Server First Edition
1 An Introduction to Visual Basic Objectives Explain the history of programming languages Define the terminology used in object-oriented programming.
Course Textbook: Build Your Own ASP.Net Website: Chapter 2
Overview of Previous Lesson(s) Over View  ASP.NET Pages  Modular in nature and divided into the core sections  Page directives  Code Section  Page.
Rujchai Ung-arunyawee Department of Computer Engineering Khon Kaen University.
Microsoft Visual Basic 2005: Reloaded Second Edition
Lesley Bross, August 29, 2010 ArcGIS 10 add-in glossary.
ASP.NET  ASP.NET is a web development platform, which provides a programming model, a comprehensive software infrastructure and various services required.
COMPUTER PROGRAMMING Source: Computing Concepts (the I-series) by Haag, Cummings, and Rhea, McGraw-Hill/Irwin, 2002.
Next Generation for Desktop Applications Doncho Minkov Telerik School Academy schoolacademy.telerik.com Technical Trainer
CNIT 133 Interactive Web Pags – JavaScript and AJAX JavaScript Environment.
Windows Presentation Foundation. Goal The goal of Windows Presentation Foundation (WPF) is to provide these advances for Windows. Included in version.
XHTML1 Building Document Structure Chapter 2. XHTML2 Objectives In this chapter, you will: Learn how to create Extensible Hypertext Markup Language (XHTML)
Tutorial 121 Creating a New Web Forms Page You will find that creating Web Forms is similar to creating traditional Windows applications in Visual Basic.
XP Tutorial 9 1 Working with XHTML. XP SGML 2 Standard Generalized Markup Language (SGML) A standard for specifying markup languages. Large, complex standard.
Object Oriented Software Development 9. Creating Graphical User Interfaces.
USING XML AS A DATA SOURCE. Data binding is a process by which information in a data source is stored as an object in computer memory. In this presentation,
1 Introduction  Extensible Markup Language (XML) –Uses tags to describe the structure of a document –Simplifies the process of sharing information –Extensible.
Tutorial 13 Validating Documents with Schemas
A Lap Around Windows Presentation Foundation. Why hasn’t UX taken off in software? It’s Difficult! Animation 2D 3D Documents Styled Controls Video Windows.
CHAPTER 15 WPF Windows Presentation Foundation Dr. John Abraham Professor, UTPA.
Windows Presentation Foundation (WPF). Introduction Separates appearance of user interface from behavior Appearance usually specified by XAML Behavior.
ControlTemplate and DataTemplate Doncho Minkov Telerik School Academy Technical Trainer
ANDROID AND MODEL / VIEW / CONTROLLER. Slide 2 Design Patters Common solutions to programming problems are called design patterns Design patterns are.
JAVA BEANS JSP - Standard Tag Library (JSTL) JAVA Enterprise Edition.
Module 4 Taking Control of the User Interface. Module Overview Sharing Logical Resources in an Application Creating Consistent User Interfaces by Using.
XP Review 1 New Perspectives on JavaScript, Comprehensive1 Introducing HTML and XHTML Creating Web Pages with HTML.
Javascript Basic Concepts Presentation By: Er. Sunny Chanday Lecturer CSE/IT RBIENT.
XML Extensible Markup Language
Part of the Microsoft.NET Framework 3.0 Tomer Shamam.NET Technologies Expert Sela Group
ASP.NET Architecture Mike Taulty Developer & Platform Group Microsoft Ltd
XML Namespaces In this first lesson XML Namespaces, you will learn to:
HTML Structure & syntax
Java FX: Scene Builder.
Computing with C# and the .NET Framework
ASP.NET Forms.
Getting Started with CSS
Lesson # 9 HP UCMDB 8.0 Essentials
Tutorial 9 Working with XHTML
Important New Concepts In WPF
Unit testing your metro style apps built using XAML
Chapter 8 User Controls.
JavaScript is a programming language designed for Web pages.
XML QUESTIONS AND ANSWERS
Database Processing with XML
DHTML Javascript Internet Technology.
WPF AKEEL AHMED.
.NET and .NET Core 7. XAML Pan Wuming 2017.
Silverlight Technology
Namespace Review 21-Nov-18.
DHTML Javascript Internet Technology.
Working with Text and Cascading Style Sheets
Namespace Review 29-Dec-18.
JavaServer Faces: The Fundamentals
Using Cascading Style Sheets (CSS)
ASP.NET.
Web Development Using ASP .NET
Understand basic HTML and CSS terminology, concepts, and basic operations. Objective 3.01.
JavaScript Basics What is JavaScript?
Chapter 7 Event-Driven Pages
An Introduction to JavaScript
Namespace Review 14-Oct-19.
Presentation transcript:

XAML User Interface Creation in C# By Vanessa Winnecke XAML User Interface Creation in C#

XAML eXtensible Application Markup Language A declaritive markup language Used to create an application’s user interface Got its start in 2006 when Windows Presentation Foundation (WPF) was introduced WPF is part of the .NET Framework

Declarative Markup Language Common declarative languages include those of database query languages such as SQL Code is written in such a way that it describes what you want to do, not how you want to. Context independent. Alternative to declaritive is Imperative. What should appear, not possible interactions. User interface is part of the machine that handles the human-machine interactions.

Windows presentation foundation(WPF) Employs XAML to define and link various interface elements. Can be hosed as an embedded object in a website. Aims to unify a number of common user interface elements, such as 2D/3D rendering, runtime animation, and media. Elements can be linked and manipulated based on various events, user interactions, and data bindings.

Xaml overview (wpf) XAML simplifies creating a UI for .NET Framework application. Create visible UI elements in declarative XAML markup, and then separate the UI definition from the run-time logic by using code-behind files, joined to the markup through partial class definitions. XAML directly represents the instantiation of objects in a specific set of backing types. Unlike other languages, which are interpreted language without such a direct tie to a backing type system. XAML is declarative(like HTML), it requires the addition of code if you need to add run-time logic to application.

Example: If your application uses only XAML, you can create and animate UI elements, and configure them to respond in a limited way to user input(by using event triggers), but your application cannot perform and respond to calculations or spontaneously create new UI elements without the addition of code. Code is stored in a separate file. Seperation of UI design and underlying code enables developers and designers to work more closely together, without delaying progress.

Code behind – c# Avoid or limit the use of inline code. Maintaing a separation between markup and code-behind keeps the designer and developer roles much more distinct. Inline code can be awkward to write, because you are always writing into the XAML generated partial class, and can only use the default XML namespace mappings. Because you cannot use using statements, you must fully qualify API calls.

Code-Behind – c# continued http://www.c-sharpcorner.com/1/190/xaml.aspx Details: using XAML GridView, ListBox, ToolTip, TextBox, Slider, etc.

XAML object elements An object element typically declares an instance of a type. Object element syntax always starts with an opening angle bracket(<), followed by the name of the type where you want to create an instance.

Attribute syntax (properties) Properties of an object can often be expressed as attributes of the object element. An attribute syntax names the property that is being set in attribute syntax, followed by the assignment operator (=)

Property Element Syntax This is another way of doing the same thing. It is useful when attribute syntax is not possible, object or information necessary to proved the property value cannot be adequately expressed within the quotation mark and string restrictions of attribute syntax. Syntax for the tag is <typeName.propertyName>

Collection syntax Optimizations that produce more human-readable markup Items that you declare in markup as child elements within that property’s value become part of the collection.

Attribute Syntax (events) Attribute syntax can be used for members that are events rather than properties. The attribute’s name is frequently the name of the event. In the WPF implementation of events for XAML, the attribute’s value is the name of the handler that implements that event’s delegate. This example, markup assigns a handler for the Click event to a Button created in markup.

Markup extensions Markup extensions are a XAML language concept. Used to provide the value of an attribute syntax, curly braces ({and}) indicate a markup extension. Example: the Style property takes an instance of the Style class, the attibute references the extension, StaticResource. Retures a style that was previously instantiated in a resource dictionary.

Xaml root elements and xaml namespaces XAML file must have only one root element. Use a root element that has a prominent meaning in WPF application model (Window or Page for page, ResourceDictionary for an external dictionary, or Application for the application definition.) Contains xmlns and xmlns:x, indicate XAML processor.

The x: prefix x:Key: sets a unique key for each resource in ResourceDictionary, and will probably account for 90% of the x: usages x:Class: Specifies the CLR namespace and class name for the code-behind. x:Name: Specifies a run-time object name for the instance that exists in run-time code after an object element is processed.

Events and xaml code-behind Within a project, the xaml is written as a .xaml file, and a CLR language such as C# is used to write a code-behind file. The location of the XAML code-behind file for the XAML file is identified by specifying a namespace(ExampleNamespace) and class(ExamplePage) as the x:Class(ExampleNamespace.ExamplePage). For adding a behavior for an object element, use an existing event of the element class, and write a specific handler for that even, when the event is raised at run time.

https://msdn.microsoft.com/en-us/library/ms752059(v=vs.110).aspx