SlideShare a Scribd company logo
1 of 14
.NET 4.5 Infoday, Graz, November 8th 2012



                                                      Rainer Stropek
                                                      software architects gmbh




WPF                                           Mail
                                              Web
                                            Twitter
                                                      rainer@timecockpit.com
                                                      http://www.timecockpit.com
                                                      @rstropek


What’s New in .NET 4.5?
                                                      Saves the day.
Overview
   Ribbon
   Performance improvements
   Data Binding enhancements
    Live shaping
    Binding to static properties
    Delay changes to data source
   Better support for async programming
    Access to collections in non-UI threads
    INotifyDataErrorInfo
    API enhancements for Dispatcher

   For a complete list of all enhancements see MSDN
.NET Infoday, Graz



                              Ribbon
                              System.Windows.Controls.Ribbon
                                (MSDN Link)

                              Use Ribbon for WPF for previous
                                versions of .NET
                                (MS Download Link)




Ribbon
Built-in ribbon in .NET 4.5
.NET Infoday, Graz


<RibbonWindow …>
  <Grid>
                                                                 Ribbon
    <Ribbon …>
      <Ribbon.HelpPaneContent>…</Ribbon.HelpPaneContent>         XAML Code Snippet
      <Ribbon.QuickAccessToolBar>…</Ribbon.QuickAccessToolBar>
      <Ribbon.ApplicationMenu>…</Ribbon.ApplicationMenu>
      <RibbonTab Header="Home" KeyTip="H" >
         <RibbonGroup … Header="Clipboard">
           <RibbonMenuButton
             LargeImageSource="Imagesclipboard.png"
             Label="Paste" KeyTip="V">
           …
         </RibbonGroup>
      </RibbonTab>
    </Ribbon>
  </Grid>
</RibbonWindow>
.NET Infoday, Graz


…
<Window.Resources>
                                                         Perf Improvements
  <CollectionViewSource x:Key="ViewSource">
    <CollectionViewSource.GroupDescriptions>             Enable UI virtualization for
      <PropertyGroupDescription
                                                         grouped data
         PropertyName="Nationality" />                   Reduces time for initial rendering
    </CollectionViewSource.GroupDescriptions>            and scrolling
  </CollectionViewSource>
</Window.Resources>
…
<DataGrid
                                                         Control virtualizing cache using
                                                         new CacheLength and
  ItemsSource="{Binding Source={StaticResource Src}}“
                                                         CacheLengthUnit properties
  VirtualizingPanel.IsVirtualizingWhenGrouping="True">
  <DataGrid.GroupStyle>
    <x:Static Member="GroupStyle.Default"/>
  </DataGrid.GroupStyle>
</DataGrid>
…
.NET Infoday, Graz


 <ListBox VirtualizingPanel.IsVirtualizing="True"
  VirtualizingPanel.ScrollUnit="Pixel">
                                                    Perf Improvements
  <ListBox.Items>
    <sys:String>Item 1</sys:String>                 Enable smooth scrolling in
    <sys:String>Item 2</sys:String>
                                                    virtualizing panel using new
                                                    ScrollUnit attached property
    …
  </ListBox.Items>
  <ListBox.ItemTemplate>
    <DataTemplate>
      <Border Height="100">
         <TextBlock Text="{Binding}" />
      </Border>
    </DataTemplate>
  </ListBox.ItemTemplate>
</ListBox>
.NET Infoday, Graz


…
<CollectionViewSource x:Key="LiveShapingViewSource"
                                                      Live Shaping
  IsLiveSortingRequested="True">
  <CollectionViewSource.SortDescriptions>             Data in grouped/sorted/filtered
    <scm:SortDescription PropertyName="StockValue„
                                                      lists is automatically rearranged.
      Direction="Descending" />
  </CollectionViewSource.SortDescriptions>
</CollectionViewSource>
…
<DataGrid ItemsSource="{Binding Source=
  {StaticResource LiveShapingViewSource}}" />
…
.NET Infoday, Graz


<TextBlock
  Text="{Binding Path=(local:MainWindow.CurrentTickValue)}" />
                                                                 Data Binding
…
private static int currentTickValue;                             Problem: Change notification for
public static int CurrentTickValue {
                                                                 static properties.
                                                                 INotifyPropertyChanged is
  get {
                                                                 no option
    return currentTickValue;
  }                                                              Solution in .NET 4.5: Add a static
  set {                                                          event handler
    currentTickValue = value;
    if (CurrentTickValueChanged != null) {
      CurrentTickValueChanged(null, new EventArgs());
    }
  }
}
public static event EventHandler CurrentTickValueChanged;
…
.NET Infoday, Graz



…                                            Data Binding
<Slider Minimum="0" Maximum="100"
  x:Name="Slider" Width="300“                Use new Delay property to delay
                                             refresh of binding source
  Value="{Binding ElementName=SliderValue,
    Path=Text,
    Delay=1000,
    Mode=OneWayToSource}"/>
<TextBlock x:Name="SliderValue" />
…
.NET Infoday, Graz



                                            Async
                                            Example: Retrieve data from
                                              database or webservice in a
                                              background thread




Access Collections in Background
Threads
Problem: Access only allowed in UI thread
.NET Infoday, Graz


private readonly ObservableCollection<string> strings =
  new ObservableCollection<string>();
                                                            Async
private readonly object stringsSyncObject = new object();
…                                                           Enable modification of collections
                                                            in background threads using
BindingOperations.EnableCollectionSynchronization(
                                                            EnableCollectionSynchronization
   this.strings, this.stringsSyncObject);
…
var timer = new Timer(1000);
timer.Start();
timer.Elapsed += (___, ____) =>
{
   this.strings.Add(DateTime.Now.Ticks.ToString());
};
.NET Infoday, Graz



this.Dispatcher.InvokeAsync(                     Async
  () => /* manipulate UI here */);
                                                 New TPL-compatible API for WPF
                                                 Dispatcher
this.Dispatcher.BeginInvoke(
  new Action(() => /* manipulate UI here */));
.NET Infoday, Graz


<TextBox Text="{Binding Path=ValidationText}" />
…
                                                                Async
public class MyViewModel : …, INotifyDataErrorInfo {
  private async void ValidateAsync() {
                                                                INotifyDataErrorInfo
    var valid = await DoAsyncValidation();
                                                                enables async validation of data
    if (!valid) {                                               Use this mechanism to keep UI
      if (this.ErrorsChanged != null) {                         responsive
         this.ErrorsChanged(this,
           new DataErrorsChangedEventArgs("ValidationText"));
      }
    }
  }
  public event EventHandler<DataErrorsChangedEventArgs>
    ErrorsChanged;
  public IEnumerable GetErrors(string propertyName) {…}
  public bool HasErrors {…}
}
.NET 4.5 Infoday, Graz, November 8th 2012



                                                      Rainer Stropek
                                                      software architects gmbh



                                              Mail    rainer@timecockpit.com

Q&A                                           Web
                                            Twitter
                                                      http://www.timecockpit.com
                                                      @rstropek


Thank You For Coming.
                                                      Saves the day.

More Related Content

What's hot

mDevCamp - The Best from Google IO
mDevCamp - The Best from Google IOmDevCamp - The Best from Google IO
mDevCamp - The Best from Google IOondraz
 
NoSQL and JavaScript: a Love Story
NoSQL and JavaScript: a Love StoryNoSQL and JavaScript: a Love Story
NoSQL and JavaScript: a Love StoryAlexandre Morgaut
 
Vielseitiges In-Memory Computing mit Apache Ignite und Kubernetes
Vielseitiges In-Memory Computing mit Apache Ignite und KubernetesVielseitiges In-Memory Computing mit Apache Ignite und Kubernetes
Vielseitiges In-Memory Computing mit Apache Ignite und KubernetesQAware GmbH
 
Azure Table Storage: The Good, the Bad, the Ugly (15 min. lightning talk)
Azure Table Storage: The Good, the Bad, the Ugly (15 min. lightning talk)Azure Table Storage: The Good, the Bad, the Ugly (15 min. lightning talk)
Azure Table Storage: The Good, the Bad, the Ugly (15 min. lightning talk)Sirar Salih
 
Multi-threaded CoreData Done Right
Multi-threaded CoreData Done RightMulti-threaded CoreData Done Right
Multi-threaded CoreData Done Rightmorrowa_de
 
Improving Performance and Flexibility of Content Listings Using Criteria API
Improving Performance and Flexibility of Content Listings Using Criteria APIImproving Performance and Flexibility of Content Listings Using Criteria API
Improving Performance and Flexibility of Content Listings Using Criteria APINils Breunese
 
MongoDB + Java + Spring Data
MongoDB + Java + Spring DataMongoDB + Java + Spring Data
MongoDB + Java + Spring DataAnton Sulzhenko
 
Java Persistence Frameworks for MongoDB
Java Persistence Frameworks for MongoDBJava Persistence Frameworks for MongoDB
Java Persistence Frameworks for MongoDBTobias Trelle
 
Getting started with Elasticsearch and .NET
Getting started with Elasticsearch and .NETGetting started with Elasticsearch and .NET
Getting started with Elasticsearch and .NETTomas Jansson
 
Data Management 2: Conquering Data Proliferation
Data Management 2: Conquering Data ProliferationData Management 2: Conquering Data Proliferation
Data Management 2: Conquering Data ProliferationMongoDB
 
Java development with MongoDB
Java development with MongoDBJava development with MongoDB
Java development with MongoDBJames Williams
 
Windows 8 Training Fundamental - 1
Windows 8 Training Fundamental - 1Windows 8 Training Fundamental - 1
Windows 8 Training Fundamental - 1Kevin Octavian
 
Spring Data, Jongo & Co.
Spring Data, Jongo & Co.Spring Data, Jongo & Co.
Spring Data, Jongo & Co.Tobias Trelle
 
Agile web development Groovy Grails with Netbeans
Agile web development Groovy Grails with NetbeansAgile web development Groovy Grails with Netbeans
Agile web development Groovy Grails with NetbeansCarol McDonald
 
Clustering your Application with Hazelcast
Clustering your Application with HazelcastClustering your Application with Hazelcast
Clustering your Application with HazelcastHazelcast
 
Data Management 3: Bulletproof Data Management
Data Management 3: Bulletproof Data ManagementData Management 3: Bulletproof Data Management
Data Management 3: Bulletproof Data ManagementMongoDB
 
Morphia, Spring Data & Co.
Morphia, Spring Data & Co.Morphia, Spring Data & Co.
Morphia, Spring Data & Co.Tobias Trelle
 
JavaEE 8 on a diet with Payara Micro 5
JavaEE 8 on a diet with Payara Micro 5JavaEE 8 on a diet with Payara Micro 5
JavaEE 8 on a diet with Payara Micro 5Payara
 
MongoDB + Java - Everything you need to know
MongoDB + Java - Everything you need to know MongoDB + Java - Everything you need to know
MongoDB + Java - Everything you need to know Norberto Leite
 

What's hot (20)

mDevCamp - The Best from Google IO
mDevCamp - The Best from Google IOmDevCamp - The Best from Google IO
mDevCamp - The Best from Google IO
 
NoSQL and JavaScript: a Love Story
NoSQL and JavaScript: a Love StoryNoSQL and JavaScript: a Love Story
NoSQL and JavaScript: a Love Story
 
Vielseitiges In-Memory Computing mit Apache Ignite und Kubernetes
Vielseitiges In-Memory Computing mit Apache Ignite und KubernetesVielseitiges In-Memory Computing mit Apache Ignite und Kubernetes
Vielseitiges In-Memory Computing mit Apache Ignite und Kubernetes
 
Azure Table Storage: The Good, the Bad, the Ugly (15 min. lightning talk)
Azure Table Storage: The Good, the Bad, the Ugly (15 min. lightning talk)Azure Table Storage: The Good, the Bad, the Ugly (15 min. lightning talk)
Azure Table Storage: The Good, the Bad, the Ugly (15 min. lightning talk)
 
Multi-threaded CoreData Done Right
Multi-threaded CoreData Done RightMulti-threaded CoreData Done Right
Multi-threaded CoreData Done Right
 
Improving Performance and Flexibility of Content Listings Using Criteria API
Improving Performance and Flexibility of Content Listings Using Criteria APIImproving Performance and Flexibility of Content Listings Using Criteria API
Improving Performance and Flexibility of Content Listings Using Criteria API
 
MongoDB + Java + Spring Data
MongoDB + Java + Spring DataMongoDB + Java + Spring Data
MongoDB + Java + Spring Data
 
Java Persistence Frameworks for MongoDB
Java Persistence Frameworks for MongoDBJava Persistence Frameworks for MongoDB
Java Persistence Frameworks for MongoDB
 
Getting started with Elasticsearch and .NET
Getting started with Elasticsearch and .NETGetting started with Elasticsearch and .NET
Getting started with Elasticsearch and .NET
 
Data Management 2: Conquering Data Proliferation
Data Management 2: Conquering Data ProliferationData Management 2: Conquering Data Proliferation
Data Management 2: Conquering Data Proliferation
 
Java development with MongoDB
Java development with MongoDBJava development with MongoDB
Java development with MongoDB
 
Bonjour, iCloud
Bonjour, iCloudBonjour, iCloud
Bonjour, iCloud
 
Windows 8 Training Fundamental - 1
Windows 8 Training Fundamental - 1Windows 8 Training Fundamental - 1
Windows 8 Training Fundamental - 1
 
Spring Data, Jongo & Co.
Spring Data, Jongo & Co.Spring Data, Jongo & Co.
Spring Data, Jongo & Co.
 
Agile web development Groovy Grails with Netbeans
Agile web development Groovy Grails with NetbeansAgile web development Groovy Grails with Netbeans
Agile web development Groovy Grails with Netbeans
 
Clustering your Application with Hazelcast
Clustering your Application with HazelcastClustering your Application with Hazelcast
Clustering your Application with Hazelcast
 
Data Management 3: Bulletproof Data Management
Data Management 3: Bulletproof Data ManagementData Management 3: Bulletproof Data Management
Data Management 3: Bulletproof Data Management
 
Morphia, Spring Data & Co.
Morphia, Spring Data & Co.Morphia, Spring Data & Co.
Morphia, Spring Data & Co.
 
JavaEE 8 on a diet with Payara Micro 5
JavaEE 8 on a diet with Payara Micro 5JavaEE 8 on a diet with Payara Micro 5
JavaEE 8 on a diet with Payara Micro 5
 
MongoDB + Java - Everything you need to know
MongoDB + Java - Everything you need to know MongoDB + Java - Everything you need to know
MongoDB + Java - Everything you need to know
 

Viewers also liked

UI Configuration in CoFX
UI Configuration in CoFXUI Configuration in CoFX
UI Configuration in CoFXRainer Stropek
 
NRWConf 2013 - Effort Estimation in Agile Projects
NRWConf 2013 - Effort Estimation in Agile ProjectsNRWConf 2013 - Effort Estimation in Agile Projects
NRWConf 2013 - Effort Estimation in Agile ProjectsRainer Stropek
 
Workshop: .NET Code Contracts
Workshop: .NET Code ContractsWorkshop: .NET Code Contracts
Workshop: .NET Code ContractsRainer Stropek
 
MS TechEd 2013: Continuous Integration with Team Foundation Services and Wind...
MS TechEd 2013: Continuous Integration with Team Foundation Services and Wind...MS TechEd 2013: Continuous Integration with Team Foundation Services and Wind...
MS TechEd 2013: Continuous Integration with Team Foundation Services and Wind...Rainer Stropek
 
SQL Server Reporting Services Training
SQL Server Reporting Services TrainingSQL Server Reporting Services Training
SQL Server Reporting Services TrainingRainer Stropek
 
Workshop: Async and Parallel in C#
Workshop: Async and Parallel in C#Workshop: Async and Parallel in C#
Workshop: Async and Parallel in C#Rainer Stropek
 
C# Scripting with Microsoft's Project Roslyn
C# Scripting with Microsoft's Project RoslynC# Scripting with Microsoft's Project Roslyn
C# Scripting with Microsoft's Project RoslynRainer Stropek
 
Catching The Long Tail With SaaS + Windows Azure
Catching The Long Tail With SaaS + Windows AzureCatching The Long Tail With SaaS + Windows Azure
Catching The Long Tail With SaaS + Windows AzureRainer Stropek
 
Workshop: Modularization of .NET Applications
Workshop: Modularization of .NET ApplicationsWorkshop: Modularization of .NET Applications
Workshop: Modularization of .NET ApplicationsRainer Stropek
 
Developing Android and iOS Apps With C#, .NET, Xamarin, Mono, and Windows Azure
Developing Android and iOS Apps With C#, .NET, Xamarin, Mono, and Windows AzureDeveloping Android and iOS Apps With C#, .NET, Xamarin, Mono, and Windows Azure
Developing Android and iOS Apps With C#, .NET, Xamarin, Mono, and Windows AzureRainer Stropek
 
High Quality C# - Codequality in Practice
High Quality C# - Codequality in PracticeHigh Quality C# - Codequality in Practice
High Quality C# - Codequality in PracticeRainer Stropek
 
BASTA 2013: Custom OData Provider
BASTA 2013: Custom OData ProviderBASTA 2013: Custom OData Provider
BASTA 2013: Custom OData ProviderRainer Stropek
 
Schema presentation
Schema presentationSchema presentation
Schema presentationl.t.j
 
Business Model Generation Patterns
Business Model Generation PatternsBusiness Model Generation Patterns
Business Model Generation PatternsAkiliKing
 
AngularJS with TypeScript and Windows Azure Mobile Services
AngularJS with TypeScript and Windows Azure Mobile ServicesAngularJS with TypeScript and Windows Azure Mobile Services
AngularJS with TypeScript and Windows Azure Mobile ServicesRainer Stropek
 

Viewers also liked (16)

UI Configuration in CoFX
UI Configuration in CoFXUI Configuration in CoFX
UI Configuration in CoFX
 
NRWConf 2013 - Effort Estimation in Agile Projects
NRWConf 2013 - Effort Estimation in Agile ProjectsNRWConf 2013 - Effort Estimation in Agile Projects
NRWConf 2013 - Effort Estimation in Agile Projects
 
Workshop: .NET Code Contracts
Workshop: .NET Code ContractsWorkshop: .NET Code Contracts
Workshop: .NET Code Contracts
 
MS TechEd 2013: Continuous Integration with Team Foundation Services and Wind...
MS TechEd 2013: Continuous Integration with Team Foundation Services and Wind...MS TechEd 2013: Continuous Integration with Team Foundation Services and Wind...
MS TechEd 2013: Continuous Integration with Team Foundation Services and Wind...
 
SQL Server Reporting Services Training
SQL Server Reporting Services TrainingSQL Server Reporting Services Training
SQL Server Reporting Services Training
 
Workshop: Async and Parallel in C#
Workshop: Async and Parallel in C#Workshop: Async and Parallel in C#
Workshop: Async and Parallel in C#
 
C# Scripting with Microsoft's Project Roslyn
C# Scripting with Microsoft's Project RoslynC# Scripting with Microsoft's Project Roslyn
C# Scripting with Microsoft's Project Roslyn
 
Catching The Long Tail With SaaS + Windows Azure
Catching The Long Tail With SaaS + Windows AzureCatching The Long Tail With SaaS + Windows Azure
Catching The Long Tail With SaaS + Windows Azure
 
Workshop: Modularization of .NET Applications
Workshop: Modularization of .NET ApplicationsWorkshop: Modularization of .NET Applications
Workshop: Modularization of .NET Applications
 
Developing Android and iOS Apps With C#, .NET, Xamarin, Mono, and Windows Azure
Developing Android and iOS Apps With C#, .NET, Xamarin, Mono, and Windows AzureDeveloping Android and iOS Apps With C#, .NET, Xamarin, Mono, and Windows Azure
Developing Android and iOS Apps With C#, .NET, Xamarin, Mono, and Windows Azure
 
High Quality C# - Codequality in Practice
High Quality C# - Codequality in PracticeHigh Quality C# - Codequality in Practice
High Quality C# - Codequality in Practice
 
BASTA 2013: Custom OData Provider
BASTA 2013: Custom OData ProviderBASTA 2013: Custom OData Provider
BASTA 2013: Custom OData Provider
 
Portafolio andrés rodriguez
Portafolio andrés rodriguezPortafolio andrés rodriguez
Portafolio andrés rodriguez
 
Schema presentation
Schema presentationSchema presentation
Schema presentation
 
Business Model Generation Patterns
Business Model Generation PatternsBusiness Model Generation Patterns
Business Model Generation Patterns
 
AngularJS with TypeScript and Windows Azure Mobile Services
AngularJS with TypeScript and Windows Azure Mobile ServicesAngularJS with TypeScript and Windows Azure Mobile Services
AngularJS with TypeScript and Windows Azure Mobile Services
 

Similar to Whats New for WPF in .NET 4.5

Developing your first application using FIWARE
Developing your first application using FIWAREDeveloping your first application using FIWARE
Developing your first application using FIWAREFIWARE
 
Enterprise Guice 20090217 Bejug
Enterprise Guice 20090217 BejugEnterprise Guice 20090217 Bejug
Enterprise Guice 20090217 Bejugrobbiev
 
Developing your first application using FI-WARE
Developing your first application using FI-WAREDeveloping your first application using FI-WARE
Developing your first application using FI-WAREFermin Galan
 
比XML更好用的Java Annotation
比XML更好用的Java Annotation比XML更好用的Java Annotation
比XML更好用的Java Annotationjavatwo2011
 
Java Configuration Deep Dive with Spring
Java Configuration Deep Dive with SpringJava Configuration Deep Dive with Spring
Java Configuration Deep Dive with SpringJoshua Long
 
.NET Database Toolkit
.NET Database Toolkit.NET Database Toolkit
.NET Database Toolkitwlscaudill
 
Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...
Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...
Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...Dan Wahlin
 
An Engineer's Intro to Oracle Coherence
An Engineer's Intro to Oracle CoherenceAn Engineer's Intro to Oracle Coherence
An Engineer's Intro to Oracle CoherenceOracle
 
Spring and Cloud Foundry; a Marriage Made in Heaven
Spring and Cloud Foundry; a Marriage Made in HeavenSpring and Cloud Foundry; a Marriage Made in Heaven
Spring and Cloud Foundry; a Marriage Made in HeavenJoshua Long
 
Integrating Wicket with Java EE 6
Integrating Wicket with Java EE 6Integrating Wicket with Java EE 6
Integrating Wicket with Java EE 6Michael Plöd
 
Multi Client Development with Spring
Multi Client Development with SpringMulti Client Development with Spring
Multi Client Development with SpringJoshua Long
 
Building AOL's High Performance, Enterprise Wide Mail Application With Silver...
Building AOL's High Performance, Enterprise Wide Mail Application With Silver...Building AOL's High Performance, Enterprise Wide Mail Application With Silver...
Building AOL's High Performance, Enterprise Wide Mail Application With Silver...goodfriday
 
[Srijan Wednesday Webinars] Ruling Drupal 8 with #d8rules
[Srijan Wednesday Webinars] Ruling Drupal 8 with #d8rules[Srijan Wednesday Webinars] Ruling Drupal 8 with #d8rules
[Srijan Wednesday Webinars] Ruling Drupal 8 with #d8rulesSrijan Technologies
 
Windows 8 metro applications
Windows 8 metro applicationsWindows 8 metro applications
Windows 8 metro applicationsAlex Golesh
 
Hazelcast and MongoDB at Cloud CMS
Hazelcast and MongoDB at Cloud CMSHazelcast and MongoDB at Cloud CMS
Hazelcast and MongoDB at Cloud CMSuzquiano
 
Scaling asp.net websites to millions of users
Scaling asp.net websites to millions of usersScaling asp.net websites to millions of users
Scaling asp.net websites to millions of usersoazabir
 
Taming Core Data by Arek Holko, Macoscope
Taming Core Data by Arek Holko, MacoscopeTaming Core Data by Arek Holko, Macoscope
Taming Core Data by Arek Holko, MacoscopeMacoscope
 
Retrofit Web Forms with MVC & T4
Retrofit Web Forms with MVC & T4Retrofit Web Forms with MVC & T4
Retrofit Web Forms with MVC & T4soelinn
 
Cassandra Day NY 2014: Getting Started with the DataStax C# Driver
Cassandra Day NY 2014: Getting Started with the DataStax C# DriverCassandra Day NY 2014: Getting Started with the DataStax C# Driver
Cassandra Day NY 2014: Getting Started with the DataStax C# DriverDataStax Academy
 
OSCON 2014 - API Ecosystem with Scala, Scalatra, and Swagger at Netflix
OSCON 2014 - API Ecosystem with Scala, Scalatra, and Swagger at NetflixOSCON 2014 - API Ecosystem with Scala, Scalatra, and Swagger at Netflix
OSCON 2014 - API Ecosystem with Scala, Scalatra, and Swagger at NetflixManish Pandit
 

Similar to Whats New for WPF in .NET 4.5 (20)

Developing your first application using FIWARE
Developing your first application using FIWAREDeveloping your first application using FIWARE
Developing your first application using FIWARE
 
Enterprise Guice 20090217 Bejug
Enterprise Guice 20090217 BejugEnterprise Guice 20090217 Bejug
Enterprise Guice 20090217 Bejug
 
Developing your first application using FI-WARE
Developing your first application using FI-WAREDeveloping your first application using FI-WARE
Developing your first application using FI-WARE
 
比XML更好用的Java Annotation
比XML更好用的Java Annotation比XML更好用的Java Annotation
比XML更好用的Java Annotation
 
Java Configuration Deep Dive with Spring
Java Configuration Deep Dive with SpringJava Configuration Deep Dive with Spring
Java Configuration Deep Dive with Spring
 
.NET Database Toolkit
.NET Database Toolkit.NET Database Toolkit
.NET Database Toolkit
 
Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...
Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...
Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...
 
An Engineer's Intro to Oracle Coherence
An Engineer's Intro to Oracle CoherenceAn Engineer's Intro to Oracle Coherence
An Engineer's Intro to Oracle Coherence
 
Spring and Cloud Foundry; a Marriage Made in Heaven
Spring and Cloud Foundry; a Marriage Made in HeavenSpring and Cloud Foundry; a Marriage Made in Heaven
Spring and Cloud Foundry; a Marriage Made in Heaven
 
Integrating Wicket with Java EE 6
Integrating Wicket with Java EE 6Integrating Wicket with Java EE 6
Integrating Wicket with Java EE 6
 
Multi Client Development with Spring
Multi Client Development with SpringMulti Client Development with Spring
Multi Client Development with Spring
 
Building AOL's High Performance, Enterprise Wide Mail Application With Silver...
Building AOL's High Performance, Enterprise Wide Mail Application With Silver...Building AOL's High Performance, Enterprise Wide Mail Application With Silver...
Building AOL's High Performance, Enterprise Wide Mail Application With Silver...
 
[Srijan Wednesday Webinars] Ruling Drupal 8 with #d8rules
[Srijan Wednesday Webinars] Ruling Drupal 8 with #d8rules[Srijan Wednesday Webinars] Ruling Drupal 8 with #d8rules
[Srijan Wednesday Webinars] Ruling Drupal 8 with #d8rules
 
Windows 8 metro applications
Windows 8 metro applicationsWindows 8 metro applications
Windows 8 metro applications
 
Hazelcast and MongoDB at Cloud CMS
Hazelcast and MongoDB at Cloud CMSHazelcast and MongoDB at Cloud CMS
Hazelcast and MongoDB at Cloud CMS
 
Scaling asp.net websites to millions of users
Scaling asp.net websites to millions of usersScaling asp.net websites to millions of users
Scaling asp.net websites to millions of users
 
Taming Core Data by Arek Holko, Macoscope
Taming Core Data by Arek Holko, MacoscopeTaming Core Data by Arek Holko, Macoscope
Taming Core Data by Arek Holko, Macoscope
 
Retrofit Web Forms with MVC & T4
Retrofit Web Forms with MVC & T4Retrofit Web Forms with MVC & T4
Retrofit Web Forms with MVC & T4
 
Cassandra Day NY 2014: Getting Started with the DataStax C# Driver
Cassandra Day NY 2014: Getting Started with the DataStax C# DriverCassandra Day NY 2014: Getting Started with the DataStax C# Driver
Cassandra Day NY 2014: Getting Started with the DataStax C# Driver
 
OSCON 2014 - API Ecosystem with Scala, Scalatra, and Swagger at Netflix
OSCON 2014 - API Ecosystem with Scala, Scalatra, and Swagger at NetflixOSCON 2014 - API Ecosystem with Scala, Scalatra, and Swagger at Netflix
OSCON 2014 - API Ecosystem with Scala, Scalatra, and Swagger at Netflix
 

Recently uploaded

2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 

Recently uploaded (20)

2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 

Whats New for WPF in .NET 4.5

  • 1. .NET 4.5 Infoday, Graz, November 8th 2012 Rainer Stropek software architects gmbh WPF Mail Web Twitter rainer@timecockpit.com http://www.timecockpit.com @rstropek What’s New in .NET 4.5? Saves the day.
  • 2. Overview  Ribbon  Performance improvements  Data Binding enhancements Live shaping Binding to static properties Delay changes to data source  Better support for async programming Access to collections in non-UI threads INotifyDataErrorInfo API enhancements for Dispatcher  For a complete list of all enhancements see MSDN
  • 3. .NET Infoday, Graz Ribbon System.Windows.Controls.Ribbon (MSDN Link) Use Ribbon for WPF for previous versions of .NET (MS Download Link) Ribbon Built-in ribbon in .NET 4.5
  • 4. .NET Infoday, Graz <RibbonWindow …> <Grid> Ribbon <Ribbon …> <Ribbon.HelpPaneContent>…</Ribbon.HelpPaneContent> XAML Code Snippet <Ribbon.QuickAccessToolBar>…</Ribbon.QuickAccessToolBar> <Ribbon.ApplicationMenu>…</Ribbon.ApplicationMenu> <RibbonTab Header="Home" KeyTip="H" > <RibbonGroup … Header="Clipboard"> <RibbonMenuButton LargeImageSource="Imagesclipboard.png" Label="Paste" KeyTip="V"> … </RibbonGroup> </RibbonTab> </Ribbon> </Grid> </RibbonWindow>
  • 5. .NET Infoday, Graz … <Window.Resources> Perf Improvements <CollectionViewSource x:Key="ViewSource"> <CollectionViewSource.GroupDescriptions> Enable UI virtualization for <PropertyGroupDescription grouped data PropertyName="Nationality" /> Reduces time for initial rendering </CollectionViewSource.GroupDescriptions> and scrolling </CollectionViewSource> </Window.Resources> … <DataGrid Control virtualizing cache using new CacheLength and ItemsSource="{Binding Source={StaticResource Src}}“ CacheLengthUnit properties VirtualizingPanel.IsVirtualizingWhenGrouping="True"> <DataGrid.GroupStyle> <x:Static Member="GroupStyle.Default"/> </DataGrid.GroupStyle> </DataGrid> …
  • 6. .NET Infoday, Graz <ListBox VirtualizingPanel.IsVirtualizing="True" VirtualizingPanel.ScrollUnit="Pixel"> Perf Improvements <ListBox.Items> <sys:String>Item 1</sys:String> Enable smooth scrolling in <sys:String>Item 2</sys:String> virtualizing panel using new ScrollUnit attached property … </ListBox.Items> <ListBox.ItemTemplate> <DataTemplate> <Border Height="100"> <TextBlock Text="{Binding}" /> </Border> </DataTemplate> </ListBox.ItemTemplate> </ListBox>
  • 7. .NET Infoday, Graz … <CollectionViewSource x:Key="LiveShapingViewSource" Live Shaping IsLiveSortingRequested="True"> <CollectionViewSource.SortDescriptions> Data in grouped/sorted/filtered <scm:SortDescription PropertyName="StockValue„ lists is automatically rearranged. Direction="Descending" /> </CollectionViewSource.SortDescriptions> </CollectionViewSource> … <DataGrid ItemsSource="{Binding Source= {StaticResource LiveShapingViewSource}}" /> …
  • 8. .NET Infoday, Graz <TextBlock Text="{Binding Path=(local:MainWindow.CurrentTickValue)}" /> Data Binding … private static int currentTickValue; Problem: Change notification for public static int CurrentTickValue { static properties. INotifyPropertyChanged is get { no option return currentTickValue; } Solution in .NET 4.5: Add a static set { event handler currentTickValue = value; if (CurrentTickValueChanged != null) { CurrentTickValueChanged(null, new EventArgs()); } } } public static event EventHandler CurrentTickValueChanged; …
  • 9. .NET Infoday, Graz … Data Binding <Slider Minimum="0" Maximum="100" x:Name="Slider" Width="300“ Use new Delay property to delay refresh of binding source Value="{Binding ElementName=SliderValue, Path=Text, Delay=1000, Mode=OneWayToSource}"/> <TextBlock x:Name="SliderValue" /> …
  • 10. .NET Infoday, Graz Async Example: Retrieve data from database or webservice in a background thread Access Collections in Background Threads Problem: Access only allowed in UI thread
  • 11. .NET Infoday, Graz private readonly ObservableCollection<string> strings = new ObservableCollection<string>(); Async private readonly object stringsSyncObject = new object(); … Enable modification of collections in background threads using BindingOperations.EnableCollectionSynchronization( EnableCollectionSynchronization this.strings, this.stringsSyncObject); … var timer = new Timer(1000); timer.Start(); timer.Elapsed += (___, ____) => { this.strings.Add(DateTime.Now.Ticks.ToString()); };
  • 12. .NET Infoday, Graz this.Dispatcher.InvokeAsync( Async () => /* manipulate UI here */); New TPL-compatible API for WPF Dispatcher this.Dispatcher.BeginInvoke( new Action(() => /* manipulate UI here */));
  • 13. .NET Infoday, Graz <TextBox Text="{Binding Path=ValidationText}" /> … Async public class MyViewModel : …, INotifyDataErrorInfo { private async void ValidateAsync() { INotifyDataErrorInfo var valid = await DoAsyncValidation(); enables async validation of data if (!valid) { Use this mechanism to keep UI if (this.ErrorsChanged != null) { responsive this.ErrorsChanged(this, new DataErrorsChangedEventArgs("ValidationText")); } } } public event EventHandler<DataErrorsChangedEventArgs> ErrorsChanged; public IEnumerable GetErrors(string propertyName) {…} public bool HasErrors {…} }
  • 14. .NET 4.5 Infoday, Graz, November 8th 2012 Rainer Stropek software architects gmbh Mail rainer@timecockpit.com Q&A Web Twitter http://www.timecockpit.com @rstropek Thank You For Coming. Saves the day.