John Daintree Chief Architect Dyalog Windows Presentation Foundation.

Slides:



Advertisements
Similar presentations
Win8 on Intel Programming Course Desktop : WPF Cédric Andreolli Intel Software
Advertisements

Pages and boxes Building quick user interfaces. learning objectives o Build a quick UI with pages and boxes o understand how pages and boxes work o click.
Introduction to Windows Presentation Foundation (WPF) Dr. Frank McCown COMP 445 – GUI Programming.
Data Binding in GUI Application Development Patrick O’Brien.
Lessons learned from developing a Windows 8 Metro application in C# Frode Nilsen Nilsen Labs Ticki.
Dinko Jakovljević Microsoft Student Partner | BambooLab
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Weather Viewer Application Introducing Microsoft Silverlight, XML, LINQ to XML.
Windows Presetation Foundation (WPF) 1. Introduction.
1 Moderne GUI og Silverlight Windows Presentation Foundation.
The Microsoft’s solution for building cross-platform Rich Internet Applications.
Ronnie Saurenmann Principal Architect Microsoft Switzerland.
WPF 3rd Party Controls WPF = Windows Presentation Foundation
Jump into WPF! Tim Huckaby CEO, InterKnowlogy Microsoft RD & MVP Level: Beginner / Intermediate.
READING, WRITING, BINDING, VALIDATING AND VISUALISING YOUR DATA Business value with Silverlight.
.NET Database Technologies: Introduction to WPF and Entity Framework DataBinding.
Introduction to Silverlight By Alan Cobb 2008-Jan-10 Sacramento, CA
V 1.0 Programming III. XML XAML Data Binding I.. V 1.0ÓE-NIK, 2014 XML (w3schools.com) A hierarchical way of defining data XML declaration + elements.
1 COS240 O-O Languages AUBG, COS dept Lecture 33 Building Apps Technologies C# (WPF part 1)
WPF chapter 15 Dr. John Abraham Professor UTPA. WPF –an introduction WPF provides a single platform capable of handling graphics, audio and video. WPF.
Target: dependency property Source: any public property CLR and WPF properties Target: dependency property Source: any public property CLR and WPF properties.
Introduction to Mobile Programming. Slide 2 Overview Fundamentally, it all works the same way You get the SDK for the device (Droid, Windows, Apple) You.
A Jumpstart to WPF by Kevin Grossnicklaus ArchitectNow.
1 Intro XAML Attribute syntax & property syntax Panels Reusable resources Controls Data binding Steen Jensen, spring 2014.
V 1.1 Programming III. GUI APIs WPF Hello World Important UI elements UI elements / content models UI elements / inheritance.
An Introduction to Silverlight Matt Harrington Developer Evangelist, Microsoft October 20, 2011.
Windows Presentation Foundation. Agenda Introduction Developing Applications WPF and WF interoperability Custom Controls Styles and Templates Data Binding.
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
Ronnie Saurenmann Principal Architect Microsoft Switzerland blogs.msdn.com/swiss_dpe_team.
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.
Declarative based UI programming: WPF, Silverlight & Surface Tim Huckaby CEO, InterKnowlogy Microsoft RD & MVP.
Copyright ©2004 Virtusa Corporation | CONFIDENTIAL Windows Presentation Foundation Ruwan Wijesinghe.
John Daintree Data Binding Reloaded. Data Binding (2013) Data Binding Reloaded (2014) Data Binding Revolutions (2015) The Databinding Trilogy.
Svetlin Nakov Telerik Corporation
Discover, Master, Influence1 Windows Presentation Foundation David Burela Senior Developer, Readify.
Lecture 10 JavaScript: DOM and Dynamic HTML Boriana Koleva Room: C54
CHAPTER 15 WPF Windows Presentation Foundation Dr. John Abraham Professor, UTPA.
SEEM3460 Tutorial GUI in Java. Some Basic GUI Terms Component (Control in some languages) the basic GUI unit something visible something that user can.
ControlTemplate and DataTemplate Doncho Minkov Telerik School Academy Technical Trainer
Module 3 Designing and Developing a User Interface.
.NET Framework Presentation. About Me Patrik Löwendahl –C# MVP –Certified Vista Touchdown Trainer Cornerstone
Silverlight 101 Ahead! If you know Silverlight and are looking for more advanced content check out : ‘Microsoft Silverlight “Media” : Moving at 60fps’
A Lap Around Windows Presentation Foundation (WPF) 4.5 Pete Brown | XAML and Gadget Guy Microsoft Corporation DEV335.
An Introduction to Developing Applications for Microsoft Silverlight Jaime Rodriguez
Session Objectives 1.Introduce new User Interface components 2.Introduce new form patterns 3.Demonstrate how to model components/forms 4.Demonstrate.
V 1.0 Programming III. XAML Data Binding I.. V 1.0ÓE-NIK, 2014 XAML namespaces Namespaces define the allowed tags and attributes The one without the prefix.
WPF Windows Presentation Foundation or is it? Worried? Puzzled? Flummoxed?
Copyright ©2004 Virtusa Corporation | CONFIDENTIAL Windows Presentation Foundation Ruwan Wijesinghe.
Soyatec Contents Needs Architecture XAML fundamentals Data Binding Advanced features Style Q&A.
Part of the Microsoft.NET Framework 3.0 Tomer Shamam.NET Technologies Expert Sela Group
Data Binding, Binding Properties Doncho Minkov Telerik School Academy Technical Trainer
Adam Schultz MVVM and WPF. MVVM Model, View, ViewModel A software architecture designed to separate out User Interface design, Business Logic, and Data.
Introduction to Silverlight
In Windows 8 Store Applications
Windows Presentation Foundation
Multi-Platform User Interfaces using HTMLRenderer
Windows Presentation Foundation Layout with Panels
Ben Riga 02 | Basics of View Models Ben Riga
Adapting UI for Different Screens and Orientations
Introduction to Silverlight
Windows Presentation Foundation
Resources & Controls AKEEL AHMED.
MIX 09 12/8/2018 4:33 PM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Lists and List Items in Windows Runtime Apps
Dyalog Version 15.0 Highlights
Bringing existing managed code into Metro style apps
Data/Code driven UI using WPF part 2
Data/Code driven UI with WPF part 1
Presentation transcript:

John Daintree Chief Architect Dyalog Windows Presentation Foundation

John Daintree Chief Architect Dyalog Windows Presentation Foundation Oh, and Data Binding (A sneak preview)

What is WPF?

'.' ⎕ ws 'coord' 'pixel' 'f' ⎕ wc 'form' 'GUI Comparison' ('size' ) 'f.filter' ⎕ wc 'edit' '' (10 10)(30 280) 'f.all' ⎕ wc 'List' '' (50 10)( ) 'f.filtered' ⎕ wc 'List' '' (50 155)( ) 'f.filter' ⎕ wc 'edit' '' (10 10)(25 280) Dyalog ⎕ WC

⎕ USING←, ⊂ 'System.Windows.Forms,system.windows.forms.dll' ⎕ USING,← ⊂ 'System.Drawing,system.drawing.dll' f← ⎕ NEW Form ⋄ f.ClientSize← ⎕ NEW Size( ) filter← ⎕ NEW TextBox filter.(AutoSize Top Left Height Width)← all← ⎕ NEW ListBox all.(Top Left Height Width)← filtered← ⎕ NEW ListBox filtered.(Top Left Height Width)← f.Controls.Add¨filter all filtered f.Visible←1 System.Windows.Forms

⎕ USING←, ⊂ 'System.Windows.Controls,WPF/PresentationFramework.dll' ⎕ USING,← ⊂ 'System.Windows,WPF/PresentationFramework.dll' f← ⎕ NEW Window ⋄ f.SizeToContent←f.SizeToContent.WidthAndHeight sp← ⎕ NEW StackPanel wp← ⎕ NEW WrapPanel filter← ⎕ NEW TextBox ⋄ filter.Margin← ⎕ NEW Thickness 5 all← ⎕ NEW ListBox ⋄ all.Margin← ⎕ NEW Thickness 5 filtered← ⎕ NEW ListBox ⋄ filtered.Margin← ⎕ NEW Thickness 5 filter.Width←280 ⋄ all.Width←135 ⋄ filtered.Width←135 (all filtered).Height←340 {}wp.Children.Add¨all filtered {}sp.Children.Add¨filter wp f.Content←sp ⋄ f.Show WPF

XAML Extensible Application Markup Language

<Window xmlns=" xmlns:x=" SizeToContent="WidthAndHeight"> <ListBox Name="all" Width="135" Height="340" Margin="5"/> <ListBox Name="filtered" Width="135" Height="340" Margin="5"/> WPF / XAML

<Window xmlns=" xmlns:x=" SizeToContent="WidthAndHeight"> <ListBox Name="all" Width="135" Height="340" Margin="5"/> <ListBox Name="filtered" Width="135" Height="340" Margin="5"/> WPF / XAML

WrapPanel

StackPanel

<Window xmlns=" xmlns:x=" SizeToContent="WidthAndHeight"> <ListBox Name="all" Width="135" Height="340" Margin="5"/> <ListBox Name="filtered" Width="135" Height="340" Margin="5"/> WPF / XAML

<Window xmlns=" xmlns:x=" SizeToContent="WidthAndHeight"> <ListBox Name="all" Width="135" Height="340" Margin="5"/> <ListBox Name="filtered" Width="135" Height="340" Margin="5"/> WPF / XAML TextBox Text="Dyalog WPF Demo" Margin="5"/>

<Window xmlns=" xmlns:x=" SizeToContent="WidthAndHeight"> The WPF Grid

<Window xmlns=" xmlns:x=" SizeToContent="WidthAndHeight"> The WPF Grid

A thought Demo

"In over 20 years of doing APL conferences this is quite possibly the coolest presentation that I've given." Demo

"Not only is it cool, it's going to turn out to be useful too." Demo

"I apologise unreservedly for not having done it sooner." Demo

Data Binding

"Is awesome (sorry) "

No Binding ⎕ WC InputNoBinding QuadWC win.filter.onKeyPress←'text_changed_no_binding' win.all.Items←DyalogNames r←text_changed_no_binding a;list 2 ⎕ NQ a list←{ ⍵ / ⍨ { ∨ /(win.filter.Text) ⍷⍵ }¨ ⍵ }DyalogNames win.filtered.Items←list r←0

No Binding WPF InputNoBinding2 WindowsPresentationFoundation win.filter.onTextChanged←'text_changed_no_binding2' {}win.all.Items.Add ∘⊂ ¨DyalogNames text_changed_no_binding2 a;list list←{ ⍵ / ⍨ { ∨ /(win.filter.Text) ⍷⍵ }¨ ⍵ }DyalogNames win.filtered.Items.Clear {}win.filtered.Items.Add ∘⊂ ¨list

Anatomy of a bind "Text" Property A Workspace char array nested array "ItemsSource" Property Source Binding namespace Source Binding "ItemsSource" Property

With Binding InputWithBinding;binding win←WindowsPresentationFoundation win.all.ItemsSource←2015 ⌶ 'DyalogNames' FilteredList←0 ⍴⊂ '' Filter←'' win.filtered.ItemsSource←2015 ⌶ 'FilteredList' FilterSource←2015 ⌶ 'Filter' binding← ⎕ NEW Data.Binding( ⊂ 'Filter') binding.Source←FilterSource binding.Mode←Data.BindingMode.TwoWay binding.UpdateSourceTrigger← Data.UpdateSourceTrigger.PropertyChanged win.filter.SetBinding TextBox.TextProperty binding win.filter.onTextChanged←'text_changed_with_binding' text_changed_with_binding a;list FilteredList←{ ⍵ / ⍨ { ∨ /Filter ⍷⍵ }¨ ⍵ }DyalogNames

With Binding InputWithBinding2;b1;b2;b3 win←WindowsPresentationFoundation MySource← ⎕ NS'' MySource.Filter←'' MySource.FilteredList←0 ⍴⊂ '' MySource.DyalogNames←DyalogNames win.DataContext←2015 ⌶ 'MySource' b1← ⎕ NEW Data.Binding( ⊂ ‘DyalogNames') b2← ⎕ NEW Data.Binding( ⊂ 'FilteredList') win.all.SetBinding ListBox.ItemsSourceProperty b1 win.filtered.SetBinding ListBox.ItemsSourceProperty b2 b3← ⎕ NEW Data.Binding( ⊂ 'Filter') b3.Mode←Data.BindingMode.TwoWay b3.UpdateSourceTrigger← Data.UpdateSourceTrigger.PropertyChanged win.filter.SetBinding TextBox.TextProperty b3 win.filter.onTextChanged←'text_changed_with_binding2' text_changed_with_binding2 a MySource.(FilteredList←{ ⍵ / ⍨ { ∨ /Filter ⍷⍵ }¨ ⍵ }DyalogNames)

With Binding and XAML InputWithBinding3a;Source MySource← ⎕ NS'' MySource.Filter←'' MySource.FilteredList←0 ⍴⊂ '' MySource.DyalogNames←DyalogNames Source←2015 ⌶ 'MySource' Source.onElementChanged←'text_changed_with_binding3a' win←WPF.Load InputWithBindingXaml win.DataContext←Source win.Show text_changed_with_binding3 args MySource.(FilteredList←{ ∨ /Filter ⍷ ↑ ⍵ )/ ⍵ }DyalogNames) r←Load text r←XamlReader.Load ⎕ NEW XmlTextReader( ⎕ NEW StringReader( ⊂ text)

With Binding and XAML <Window xmlns=" xmlns:x=" SizeToContent="WidthAndHeight"> <TextBox Name="filter" Margin="5" Text="{Binding Filter, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/> <ListBox Name="all" Width="135" Height="340" Margin="5" ItemsSource="{Binding DyalogNames}"/> <ListBox Name="filtered" Width="135" Height="340" Margin="5" ItemsSource="{Binding FilteredList}"/>

With Binding and XAML InputWithBinding3a;Source MySource← ⎕ NS'' MySource.Filter←'' MySource.FilteredList←0 ⍴⊂ '' MySource.DyalogNames←DyalogNames Source←2015 ⌶ 'MySource' Source.onElementChanged←'text_changed_with_binding3a' win←WPF.Load InputWithBindingXaml win.DataContext←Source win.Show <Window xmlns=" xmlns:x=" SizeToContent="WidthAndHeight"> <TextBox Name="filter" Margin="5" Text="{Binding Filter, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/> <ListBox Name="all" Width="135" Height="340" Margin="5" ItemsSource="{Binding DyalogNames}"/> <ListBox Name="filtered" Width="135" Height="340" Margin="5" ItemsSource="{Binding FilteredList}"/> text_changed_with_binding3a a MySource.(FilteredList←{ ∨ /Filter ⍷ ↑ ⍵ )/ ⍵ }DyalogNames)

So we can bind to... Simple arrays Filter Nested arrays DyalogName FilteredList Namespace MySource High rank arrays

"Ask not what you can do with Dyalog APL – ask what Dyalog APL can do for you." Demo

DEMO Demo

<Window xmlns=" xmlns:x=" Demo

<Window xmlns=" xmlns:x=" Demo2

<Window xmlns=" xmlns:x=" DisplayMemberPath="Title"

<Window xmlns=" xmlns:x="

<Window xmlns=" xmlns:x=" Demo5

<Window xmlns=" xmlns:x=" <TextBlock Grid.Column="3" Text="{Binding Duration}" Margin="10,0,10,0"/> Demo6

<Window xmlns=" xmlns:x=" Demo7

<Window xmlns=" xmlns:x="

<Window xmlns=" xmlns:x=" <TextBlock Style="{StaticResource AlbumStyle}"

<Window xmlns=" xmlns:x=" <TextBlock Style="{StaticResource AlbumStyle}"

<Window xmlns=" xmlns:x=" Demo10

Syncfusion Syncfusion is a leading vendor of ”enterprise class” components for a number of platforms –ASP.NET, Mobile, Silverlight, WinForms, Windows Phone, WinRT, WPF and Javascript Dyalog has acquired the rights to bundle the WPF and Javascript libraries with APL until October Dyalog users have the rights to distribute these controls as components of applications written in APL –Under the same terms as the Dyalog Licence that is being used (including non-commercial and educational licences)

Libraries Syncfusion is a leading (and ascending) vendor of ”enterprise class” components for many platforms – ASP.NET, Mobile, Silverlight, WinForms, Windows Phone, WinRT, WPF and Javascript Dyalog has acquired the rights to bundle the WPF and Javascript libraries with APL Dyalog users have the rights to distribute these controls as components of applications written in APL – Under the same terms as the Dyalog Licence that is being used (including non-commercial and educational licences)

<Window xmlns=" xmlns:x="

<Window xmlns=" xmlns:sf="clr-namespace:Syncfusion.Windows.Shared;assembly=Syncfusion.Shared.Wpf" xmlns:x=" <sf:Carousel Grid.Row="0" ItemsSource="{Binding}" Name="MyList" Height="200" Width="1000" Foreground="{StaticResource FCol}" > Demo11 xmlns:sf="clr-namespace:Syncfusion.Windows.Shared; assembly=Syncfusion.Shared.Wpf"

Demo12

ItemsPerPage="10" VisualMode="CustomPath" Demo14

<Window xmlns=" xmlns:x=" <ListBox ItemsSource="{Binding Path=SelectedItem.Tracks, ElementName=MyList}" <sf:Carousel ItemsSource="{Binding Path=SelectedItem.Content.Tracks, ElementName=MyList}" Demo14 <TextBlock Grid.Column="3" Style="{StaticResource AlbumStyle}" Text="{Binding Duration}" Margin="10,0,10,0"/>

<Border Grid.Row="1" Height="300" Width="200“ HorizontalAlignment="Center" VerticalAlignment="Bottom" Margin="0,0,0,-150" RenderTransformOrigin="0.5,0.5"> Name="image" Demo15

<TextBlock Grid.Column="3" Style="{StaticResource AlbumStyle}" Text="{Binding Duration}" Margin="10,0,10,0"/> Demo16

. <BitmapImage x:Key="PlayImage" UriSource="x:\conferences\Florida2013\Binding\play.png" DecodePixelWidth="16"/> <BitmapImage x:Key="PauseImage" UriSource="x:\conferences\Florida2013\Binding\pause.png" DecodePixelWidth="16"/> <Image Name="Play" Grid.Column="0" Source="{StaticResource PlayImage}"/> Demo17

<Window xmlns=" xmlns:x=" xmlns:sf="clr-namespace:Syncfusion.Windows.Shared;assembly=Syncfusion.Shared.Wpf">. Demo17

Routed Events “A routed event is a type of event that can invoke handlers on multiple listeners in an element tree, rather than just on the object that raised the event.” “An event that you can handled at any level in an object’s hierarchy”

Routed Events So for a “MouseDown” event on an Image we could: – Attach the handler to the Image itself – To its parent – To its parent’s parent – To its parent’s parent’s parent – etc – To the top level Window that owns it – Or all of the above!

Routed Events Don’t show up in EventList or ⎕ NL 8 Can’t be attached with onMouseDown Are attached with the AddHandler function: – obj.AddHandler event callback handled – A bit nasty in Dyalog (at the moment)

<Window xmlns=" xmlns:x=" xmlns:sf="clr-namespace:Syncfusion.Windows.Shared;assembly=Syncfusion.Shared.Wpf">. Demo17

<Window xmlns=" xmlns:sf="clr-namespace:Syncfusion.Windows.Shared;assembly=Syncfusion.Shared.Wpf" xmlns:x=" <sf:Carousel Grid.Row="0" ItemsSource="{Binding}" Name="MyList" Height="200" Width="1000" Foreground="{StaticResource FCol}" > xmlns:sf="clr-namespace:Syncfusion.Windows.Shared; assembly=Syncfusion.Shared.Wpf"

<ws:MyWindow xmlns=" xmlns:x=" xmlns:sf="clr-namespace:Syncfusion.Windows.Shared;assembly=Syncfusion.Shared.Wpf" xmlns:ws="clr-namespace:;assembly=DyalogActiveWorkspace">. <Image Name="Play" Grid.Column="0" Source="{StaticResource PlayImage}" MouseDown="play"/> <ws:MyWindow xmlns:ws="clr- namespace:;assembly=DyalogActiveWorkspace" </ws:MyWindow

Demo18

miTunes

⎕ NEW miTunes

<StackPanel xmlns=" xmlns:x=" xmlns:sf="clr-namespace:Syncfusion.Windows.Shared;assembly=Syncfusion.Shared.Wpf" Background="Black" > 92 Lines of XAML (Is-y) 35 lines of APL 19 of which are used to play the track (Do-y)

Zero to iTunes in 45 minutes

Chad Church Product Manager Syncfusion The Syncfusion Libraries

Chad Church Product Manager Microsoft Certified Solution Developer Nearly 4 years with Syncfusion Key demonstrator and presenter Liases between the developers who create Syncfusion products and the developers who use them

What is Data Binding? var←'good morning' F.ed.Text← var var←'bonjour' F.ed.Text good morning Type “buongiorno” into edit field var bonjour

What is Data Binding? var←'good morning' F.ed.Text← var var←'bonjour' F.ed.Text bonjour Type “buongiorno” in edit field var buongiorno

What is Data Binding? var←'good morning' F.ed.Text←2015 ⌶ var var←'bonjour' F.ed.Text bonjour Type “buongiorno” in edit field var buongiorno

What is Data Binding? var←'good morning' F.ed.Text←2015 ⌶ var var←'bonjour' F.ed.Text bonjour Type “buongiorno” in edit field var buongiorno