6 ListViewGridViewFlipView.

Slides:



Advertisements
Similar presentations
Introduction to Web Application
Advertisements

Nov 2005 MSc Slide 1 - Another Example of a Structural Pattern Alternative way of adding Functionality to an existing class (alternative to a derived class)
Copyright © 2012 Pearson Education, Inc. Chapter 9 Delegates and Events.
WinJS Priorities max: 15 high: 13 aboveNormal: 9 normal: 0 belowNormal: -9 idle: -13 min: -15.
Arrays & Enum & Events. Arrays Arrays are data structures consisting of related data items of the same type. Arrays are fixed-length entities—they remain.
ARTech FLASH User Interface Drawing Tools Study Guide 8 th Grade Technology | Wakefield Middle School.
Programming Based on Events
Event Notification Pattern Dr. Neal CIS 480. Event Notification Pattern When a class abc has something happening that class xyz needs to know about you.
Syncing Audio, Video and Animations in Silverlight Dan Wahlin.
Visual Basic 2008 Express Edition The IDE. Visual Basic 2008 Express The Start Page Recent Projects Open an existing project Create a New Project.
EEC-492/592 Kinect Application Development Lecture 10 Wenbing Zhao
Extension Methods Programming in C# Extension Methods CSE Prof. Roger Crawfis.
V 1.0 Programming III. Creation of additional windows Routed events.
CST238 Week 5 Questions / Concerns? Announcements – HW#1 due (Project ideas) – Check-off Take Home lab#4 Recap New topics – Drawing Coming up: – GUI Bloopers.
Module 11 Control Customization. Module Overview Overview of Control Authoring Creating Controls Managing Control Appearance by Using Visual States Integrating.
Applets CS 3331 Sections 3.3 & 4.7 of [Jia03].
UNIVERSITY of GREENWICH 1E. I. Teodorescu Dependency/Attached properties Enumerations Starting a game – flying pig Visual Application Development E. I.
V 1.0 Programming III. Automatic notifications (…Changed, INofityPropertyChanged, ObservableCollection ) Data formatters Data conversions Resources.
Web hosting in app Creating a Windows Store app with web assets.
Arrays Part 9 dbg. Arrays An array is a fixed number of contiguous memory locations, all containing data of the same type, identified by one variable.
C# D1 CSC 298 Elements of C# code (part 2). C# D2 Writing a class (or a struct)  Similarly to Java or C++  Fields: to hold the class data  Methods:
Carnegie Mellon University MSCF1 C#/.NET Basics 2 Some code is from “C# in a Nutshell”
private void Goto2(object sender, Windows.UI.Xaml.RoutedEventArgs e) { var app = App.Current as Common.BootStrapper; var nav = app.NavigationService;
.NET 2.0 and Visual Studio 2005 SigWin Outline Language enhancements in C# Language enhancements in C# –Generics –Partial types –Anonymous methods.
VB and C# Programming Basics. Overview Basic operations String processing Date processing Control structures Functions and subroutines.
Module 12 Attached Properties and Behaviors in WPF.
Students : Hiba Ghannam Hawa Osama Superviser: Haya Sammaneh.
CIS 338: Classes and Modules Dr. Ralph D. Westfall May, 2011.
Controls. Adding Controls to Form -You can pick controls from the toolbox. -To add the controls from Toolbox to the Form You have be in design view. -To.
Introduction to C#. Why C#? Develop on the Following Platforms ASP.NET Native Windows Windows 8 / 8.1 Windows Phone WPF Android (Xamarin) iOS (Xamarin)
Dr. Martin Zhao Sept 4, Topics HTML and related tutorials on w3schools.com Related HTML tags Adding interesting features using JavaScript What is.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Outline 21.1 Test-Driving the Painter Application.
Internet & World Wide Web How to Program, 5/e. © by Pearson Education, Inc. All Rights Reserved.
Module 8: Delegates and Events. Overview Delegates Multicast Delegates Events When to Use Delegates, Events, and Interfaces.
12/5/2015 EEC492/693/793 - iPhone Application Development 1 EEC-693/793 Applied Computer Vision with Depth Cameras Lecture 4 Wenbing Zhao
CS324e - Elements of Graphics and Visualization Timing Framework.
Module 4: Creating a Web Application with Web Forms
Module 4 Taking Control of the User Interface. Module Overview Sharing Logical Resources in an Application Creating Consistent User Interfaces by Using.
From C++ to C# Part 5. Enums Similar to C++ Similar to C++ Read up section 1.10 of Spec. Read up section 1.10 of Spec.
CIS3023: Programming Fundamentals for CIS Majors II Summer 2010 Ganesh Viswanathan Abstract Classes Course Lecture Slides 7 June 2010 “None of the abstract.
2/16/2016 EEC492/693/793 - iPhone Application Development 1 EEC-693/793 Applied Computer Vision with Depth Cameras Lecture 4 Wenbing Zhao
 2002 Prentice Hall. All rights reserved. 1 Outline Mouse Event Handling Keyboard Event Handling Graphical User Interface Concepts:
Support standard JavaScript code with static typing Encapsulation through classes and modules Support for constructors, properties and.
Leveraging TypeScript in Cross-functional development teams Aaron McGee, Richard Brookes M216.
Dependency Property Mahender Senior Software Engineer United Health Group.
Game On! With HTML5. AUTHD on oreilly.com How a Game Works Time Passed Frame 1 Frame 2 Frame 3Frame 4.
3/3/2016 EEC492/693/793 - iPhone Application Development 1 EEC-693/793 Applied Computer Vision with Depth Cameras Lecture 4 Wenbing Zhao
1.NETDelegates & eventsNOEA / PQC 2007 Delegates & events Observer pattern Delegates –Semantics –Cil – code –Usage Events Asynchronious delegates.
Arrays & Enum & Events. Arrays Arrays are data structures consisting of related data items of the same type. Arrays are fixed-length entities—they remain.
Parts of the Clock Click on the minute hand. Click on the clock’s face.
Graphical User Interfaces Part 2 1 Outline TreeViews ListViews Tab Control.
REC [ ] How to implement CAMERA RECORDING for USB WEBCAM or IP CAMERA in C#.NET SOURCE CODE: ! Welcome to this presentation that explains.
Internet & World Wide Web How to Program, 5/e.  JavaScript events  allow scripts to respond to user interactions and modify the page accordingly  Events.
Andy Wigley Device Application Development MVP APPA Mundi Ltd SESSION CODE: WEM309.
~80 System Colors (and Brushes) ~80 System Colors (and Brushes) XAML Control Colors Map to ~80 system colors SystemBaseHighColor (SystemControlHighlightBaseHighBrush)
What is a Function Expression?
Delegates and Events Svetlin Nakov Telerik Corporation
Ben Riga 02 | Basics of View Models Ben Riga
Delegates and Events 14: Delegates and Events
Binary Search Trees.
EEC-693/793 Applied Computer Vision with Depth Cameras
Tips and tricks for developing Metro style apps using XAML
EEC-693/793 Applied Computer Vision with Depth Cameras
Delegates & Events 1.
ONLINE COLOR COLOR.
Web Service.
EEC-693/793 Applied Computer Vision with Depth Cameras
EEC-693/793 Applied Computer Vision with Depth Cameras
EEC-693/793 Applied Computer Vision with Depth Cameras
עקרונות תכנות מונחה עצמים תרגול 7 – Design Patterns
Presentation transcript:

6 ListViewGridViewFlipView

Defining the WinJS control (function () { "use strict"; WinJS.Namespace.define("Samples.UI", { ClockControlHTMLUI: WinJS.Class.define(function (element) { // Create an element if none provided element = element || document.createElement("div"); element.winControl = this; this.element = element; element.style.display = "inline-block"; this._drawClock(); }, { _drawClock: function () { // Draw the control }, }, { }) }); })();

Adding properties (XAML / C#) // Creating dependency properties public static readonly DependencyProperty ClockFillBrushProperty = DependencyProperty.Register("ClockFillBrush", typeof(Brush), typeof(ClockControlXAMLProps), new PropertyMetadata(null)); public Brush ClockFillBrush { get { return (Brush)this.GetValue(ClockFillBrushProperty); } set { this.SetValue(ClockFillBrushProperty, value); } }

Consuming properties (XAML / C#) var myClock = new B_CustomClockXAMLProps.ClockControlXAMLProps() { ClockFillBrush = new SolidColorBrush(Colors.Blue), MinWidth = 150, MinHeight = 150 }; MyClockControlProps.ClockFillBrush = new SolidColorBrush(Colors.Black);

Adding properties (HTML / WinJS) ClockControlHTMLProps: WinJS.Class.define(function (element, options) { // allow a null options parameter options = options || {}; // WinJS utility function to assign/create properties from anonymous options object WinJS.UI.setOptions(self, options); //Omitted for brevity }, { color: { get: function () { return this._color || "red"; }, set: function (value) { if (this._color != value) { this._color = value; //Redraw the User Interface this._drawClock(); } } }, }, })

Consuming properties (HTML / WinJS) var clock = new Samples.UI.ClockControlHTMLProps(MyClock, { color: 'blue' }); clock.color='green'; clockControlPropsDiv.winControl.color='green‘;

Adding callback events (XAML / C#) public static readonly DependencyProperty IsRunningProperty = DependencyProperty.Register("IsRunning", typeof(bool), typeof(ClockControlXAMLEvents), new PropertyMetadata(true, PropertyChangedCallback(OnIsRunningChanged))); private static void OnIsRunningChanged( DependencyObject d, DependencyPropertyChangedEventArgs e) { var clock = d as ClockControlXAMLEvents; clock.UpdateTimerState(); }

Adding standard events (XAML / C#) public event EventHandler Ticked; public class ClockEventArgs : System.EventArgs { public DateTime When { get; set; } public ClockEventArgs(DateTime when) { this.When = when; } } private void RaiseEvents() { var currentTime = DateTime.Now; var eh = this.Ticked; if (eh != null) { eh(this, new ClockEventArgs(currentTime)); } }

Consuming events (XAML / C#) MyClockControlEvents.Ticked += MyClock_Ticked; private void MyClock_Ticked(object sender, ClockEventArgs e) { ticker.Text = e.When.ToString(); } private void MyClock_FiveSecondsElapsed( object sender, ClockEventArgs e) { ticker5.Text = e.When.ToString(); }

Adding events (HTML / WinJS) WinJS.Namespace.define("Samples.UI", { ClockControlHTMLEvents: WinJS.Class.define(function (element, options) { //omitted for brevity }, { //omitted for brevity _drawHands: function () { //Omitted for brevity this.dispatchEvent("tick", { when: now }); if (sec % 5 == 0) { this.dispatchEvent("fiveseconds", {when:now}); }; }, }, { }) }); WinJS.Class.mix(Samples.UI.ClockControlHTMLEvents, WinJS.UI.DOMEventMixin, WinJS.Utilities.createEventProperties("tick","fiveseconds"));

Consuming events (HTML / WinJS) clockCtDiv.winControl.addEventListener("tick", function (e) { tick.innerText = e.detail.when; }); clockCtlDiv.winControl.addEventListener("fiveSeconds", function (e) { fiveSeconds.innerText = e.detail.when; });

IntelliSense support (XAML / C#) public static readonly DependencyProperty IsRunningProperty = /*Omitted for Brevity*/; /// /// Is it running? /// public bool IsRunning { get { return (bool)this.GetValue(IsRunningProperty); } set { this.SetValue(IsRunningProperty, value); } } /// /// Event that fires every five seconds /// public event EventHandler FiveSecondsElapsed;

IntelliSense support (HTML / WinJS) /// Creates a Clock Control /// The root element for the control /// The JSON options for the control /// Sets the color of the hands and the outline of the clock face /// Sets the height of the clock face