Developing Windows and Web Applications using Visual Studio.NETPeter GfaderSenior Software Architect
Homework?
„Add New“ disabledProblems with Lab / homework?
Unused methods, after removing UI controlsTip
C# 3.0, C# 4.0,   C# 5LINQData with LINQSession 2: Last week?
User Experience (UX)Tips and Techniques, Best practicesWindows Forms Capabilities and Demo’sTools to better UX & codeUX ResourcesAgenda
Better User Experience with .NET
Better User Experience with .NET
Business applications
Enter data Find data Show dataEvery business app does
Professional Feel Enter data ValidationFind data Filter dataRich data queryShow dataDifferent ViewsReports (nice printing)Authorization?Every business app
User Experience
User experience3 pillars
UX - Look
UX - Usability
Make site feel aliveReact fastInteract with user“Joy of use”UX - Feel
How can we improve UX
DevelopersNeed a UI to test their software as they buildUI increases in complexity as software is builtApplication grows but the UI isn’t consistentKnow how the controls work (or they should!!)DesignersMay design the UI but not realize WHAT is possibleMay understand a Visual Consistency but not how its builtWho designs the UI?
The userWho uses the UI?
„User driven“Do testing with the userPrototypingUsability testingLet user solve a task and see (measure) what he doesUser
Why choose Windows Forms?
Bandwidth – Presentation layerCache / persistent stateFaster ServerBecause of less requests and less work… thanks to processing power being used on clientRicher interfaceNo buggy DHTML/JavaScriptMore responsiveFaster to developNo cross-browser issuesBuild complex controls quicklyWhy Windows Forms?
Not allowed in Standard Operating EnvironmentCross-platform requirements (Linux, PC, Mac)Deployment of the Application is harder / Centralised logicRequires an always-connected data serviceWhy NOT Windows Forms?
Network AdminsDevelopersEnd UsersAccountsWho Do I Please?Browser Based SolutionRich Client Solution
Who uses prototypes?SketchflowBalsamiqDo you design a mockup UI first?
Avoid the thought of a “throw away” prototype.Use as the first step to start a project (or get a project) - WYSIWYGGet great initial feedbackBetter than 100 page documentGet designer involved if need be (Developers can’t design)Tip: Always add client logo + colours. They are easily impressed!Designing a Mockup UI
Would you design Database first or UI?Database schema should be designed before the UI is startedIf you are doing fixed price work, signed-off mockups serve as a great way to stop goal posts moving. Any changes to the mockups thereafter will result in additional work.Designing a Mockup UI
Windows Forms – Best practices
Visual InheritanceComposition and Containment (Panels, Usercontrols)DatabindingToolTipsError Provider and ValidatorsAppsettingsWinform Architecture
The constructor of each form/control class contains a call of a private method "InitializeComponent()". If B is derived from A, then the constructor of A is called firstA()A.InitializedComponent()B()B.InitialzeComponent()Visual Inheritance
Controls on the Base Form are BY DEFAULT “private” and cannot be edited in the inherited formSolution: Change the modifer to “Protected”Visual Inheritance
Common BehaviourCompany Icon Remembering its size and locationAdding itself to a global forms collection (to find forms that are already open, or to close all open forms)  	** Application.OpenFormsLogging usage frequency and performance of forms (load time)No Controls!Inherited Forms – For Every Form
CenterParent only for modal dialogs (to prevent multi-monitor confusion) CenterScreen only for the main form (MainForm), or a splash screen WindowsDefaultLocation for everything else (99% of forms) - prevents windows from appearing on top of one anotherStartPosition
FixedDialog only for modal dialog boxes FixedSingle only for the the main form (MainForm) - FixedSingle has an icon whereas FixedDialog doesn'tNone for splash screen Sizable for any form that has multi-line textbox, grid, listbox or suchFormBorderStyle
Base Data Entry Form3412
Do you encapsulate (aka lock) values of forms?
Hiding Values
Developers fiddle!Browsable: whether a property or event should be displayed in a Properties window. http://msdn.microsoft.com/en-us/library/system.componentmodel.browsableattribute.aspxEditorBrowsable: whether a property or method is viewable in an editor.http://msdn.microsoft.com/en-us/library/system.componentmodel.editorbrowsableattribute.aspxHiding Values
Hiding Valuesusing System.ComponentModel;[Browsable(false), EditorBrowsable(false)]public new Font Font{   get   {      return base.Font;   }   set   {base.Font = value;   }	}Imports System.ComponentModel<Browsable(False), EditorBrowsable(false)> _ Public Shadows Property Font() As Font   Get      Return MyBase.Font   End Get    Set(ByVal Value As Font)      'MyBase.Font = Value      'normal property syntaxMyBase.Font = New Font(Me.Font.FontFamily, 20)   End SetEnd Property
Do you know when to use User Controls?
You lose the AcceptButton and CancelButton properties from the Designer e.g. OK, Cancel, Apply	Therefore the OK, Cancel and Apply buttons cannot be on User Controls.       User Controls
You can use a user control more than once on the same form e.g. Mailing Address, Billing Address You can reuse logic in the code behind the controls e.g. Search control User controls are less prone to visual inheritance errors       User Controls
User ControlsControls only used onceBad! »
User ControlsOnly for reuseGood! »
User Controls – TabPagesException! »
Possible Exception:When a form has multiple tabs, and each tab has numerous controls – it can be easier to use User Control in this caseSmaller designer generated codeMore than one person can be working on a different ‘tab’User Controls – TabPages
Code intensiveMust manually handle the Validating event of each control you want to validateMust be manually running the validation methods when the OK or Apply button is clickedError Provider
Controls that “attach” themselves to existing Do you use validator controls?
Validator ControlsGoodNo code, all in the designer (integrates with the ErrorProvider)
Windows Forms – Validation
Validation logic is in the ModelValidation with Entity Frameworkpublic partial class Employee{ partial void OnLastNameChanging(string value) {   if (string.Compare(value, "Gfader", StringComparison.InvariantCultureIgnoreCase) == 0)   {        throw new ArgumentException("No GFADER allowed");   } }}
Validation logic is in the ModelValidation with Entity Frameworkpublicpartialclass Employee{partialvoidOnLastNameChanging(string value)   {if (string.Compare(value, "Gfader", StringComparison.InvariantCultureIgnoreCase) == 0)     {thrownewArgumentException("No GFADERallowed");     }   }}
Partial class holds validation logicPartial class
Hook up ErrorProvider
Better User Experience with .NET
Happens in modelDifferent UI layers can react to validation differentlyWeb pageWindows FormSilverlightWPF...Validation
Monitor Performance betterGood user feedbackEasy to doAdamE thinks“general user’s don’t care about technical details, a progress bar is better”Do you use a status bar to show load time?
Don't use splash screens for branding. Avoid using splash screens because they may cause users to associate your program with poor performance. Use them only to give feedback and reduce the perception of time for programs that have unusually long load times.Don't use animated splash screens. Users often assume that the animated splash screen is the reason for a long load time. Too often, that assumption is correct.Splash Screens
Two-way binding means that the object/data structure is bound to the UI Element/ControlThe setting/getting and the positioning of elements in a collection is handled by the databindingmechansismsDatabinding is VASTLY superior in WPFDo you always use the Visual Studio designer for data binding where possible?
Bad – write your own boring codePrivate Sub OnLoad()OrderDetailsService.Instance.GetAll(Me.OrderDetailsDataSet1)        Dim row As OrderDetailsDataSet.OrderDetailsRow = 	Me.OrderDetailsDataSet1.OrderDetails(0)        Me.TextBox1.Text = row.UnitPrice.ToString("c")    End Sub    Private Sub Save()        Dim row As OrderDetailsDataSet.OrderDetailsRow = 	Me.OrderDetailsDataSet1.OrderDetails(0)row.UnitPrice = Decimal.Parse(Me.TextBox1.Text, 	System.Globalization.NumberStyles.Currency)    End Sub
Using the DesignerSimpleBinding to a single propertyComplexBinding to a list
MDI Forms
MDI FormsHangover from Access 2.0 	and Windows 3.1Clutter the applicationOnly one window on 	the taskbarNo multiple monitor support
Do you make common control with certain width?
Bad/Good Example #1
Bad/Good Example #2
TestingDon‘t trust anyone
Part of Visual Studio 2010 "Ultimate" editionMicrosoft Test Manager
Microsoft Test Manager
Better User Experience with .NET
Generate Coded UI test
Use existing recording
Generated coded UI test[TestMethod]publicvoid CodedUITestMethod1(){this.UIMap.StartApplication();this.UIMap.LoginToApplication();this.UIMap.SeeDetailsform();this.UIMap.ClickOnnextRecord();this.UIMap.SeetheNextRecord();}
Automated recordingIntelliTrace (drill through to Visual Studio)Bug in TFSVideo.wmvDetailed stepsLots of details (you don’t need if you get intelliTrace)Stack traceSystem infoMicrosoft Test Manager
Better User Experience with .NET
Book "User Interface Design for Programmers“Bloghttp://www.joelonsoftware.com/UX patternshttp://quince.infragistics.com/Resources
http://www.windowforms.nethttp://www.ssw.com.au/ssw/Standards/Rules/RulesToBetterInterfaces.aspxWindows UX Guidelineshttp://msdn.microsoft.com/en-us/library/aa511258.aspxDesigning Interfaceshttp://designinginterfaces.com/Automate UI - VS2010 Test ManagerResources
Covers Windows UI reference guidelinesThis should be your main ‘Bible’ when designing Windows Forms (not Web) if you’re not a designer as it provides a consistent standardWindows UX Guidelines
What's next?
Thank You!Gateway Court Suite 10 81 - 91 Military Road Neutral Bay, Sydney NSW 2089 AUSTRALIA ABN: 21 069 371 900 Phone: + 61 2 9953 3000 Fax: + 61 2 9953 3105 info@ssw.com.auwww.ssw.com.au

More Related Content

PDF
C Sharp Cornerarticle
PDF
Rc085 010d-vaadin7
PDF
Access tips access and sql part 4 building select queries on-the-fly
PDF
Building richwebapplicationsusingasp
DOCX
Selenium Testing Training in Bangalore
PDF
當ZK遇見Front-End
PDF
User Interface Testing. What is UI Testing and Why it is so important?
PDF
How to easily design and automate test cases.pdf
C Sharp Cornerarticle
Rc085 010d-vaadin7
Access tips access and sql part 4 building select queries on-the-fly
Building richwebapplicationsusingasp
Selenium Testing Training in Bangalore
當ZK遇見Front-End
User Interface Testing. What is UI Testing and Why it is so important?
How to easily design and automate test cases.pdf

What's hot (20)

PPTX
STARWEST 2010 - 7 Steps To Improving Software Quality using Microsoft Test Ma...
PPT
CTTDNUG ASP.NET MVC
PPS
Transforming Power Point Show with VBA
PDF
Accessible custom radio buttons and checkboxes
PDF
POLITEKNIK MALAYSIA
PDF
Introduction to Angular Js
DOCX
ID E's features
PDF
Creating accessible modals and autocompletes
PDF
The EffiChange XPager Suite: Understanding XPages Scaffolding
PDF
HTML5 Up and Running
PPTX
Workflow functional concept on openerp7
PPTX
ASP.NET MVC Presentation
PPTX
3-TIER ARCHITECTURE IN ASP.NET MVC
PPSX
12 asp.net session17
PPTX
Rits Brown Bag - TypeScript
PPTX
Building xamarin.forms apps with prism and mvvm
PDF
Testing Banking Applications. Here is a practical example
PPT
Active x control
PDF
10 ways to bind multiple models on a view in mvc code project
PDF
Salesforce interview preparation toolkit formula and validation rules in sale...
STARWEST 2010 - 7 Steps To Improving Software Quality using Microsoft Test Ma...
CTTDNUG ASP.NET MVC
Transforming Power Point Show with VBA
Accessible custom radio buttons and checkboxes
POLITEKNIK MALAYSIA
Introduction to Angular Js
ID E's features
Creating accessible modals and autocompletes
The EffiChange XPager Suite: Understanding XPages Scaffolding
HTML5 Up and Running
Workflow functional concept on openerp7
ASP.NET MVC Presentation
3-TIER ARCHITECTURE IN ASP.NET MVC
12 asp.net session17
Rits Brown Bag - TypeScript
Building xamarin.forms apps with prism and mvvm
Testing Banking Applications. Here is a practical example
Active x control
10 ways to bind multiple models on a view in mvc code project
Salesforce interview preparation toolkit formula and validation rules in sale...
Ad

Viewers also liked (13)

DOC
Examples of Good and Bad Web Design
PDF
Why User Experience Matters
PDF
Ruth's User Experience Nightmares
PPT
Examples Of Good And Bad Essays
PPT
7 Examples of good and bad e-commerce websites
PDF
Good Examples of Bad Design
PDF
Evans, Our God is Awesome: God Passion
PPTX
Good/Bad Web Design
PPTX
Cep 817 design ed good bad design
PPTX
Bad design in examples by Ross Sokolovski
PDF
Introduction to User Experience - Mike Biggs
PDF
User Experience: The good, the bad, and the ugly
PPT
Five principles of document design
Examples of Good and Bad Web Design
Why User Experience Matters
Ruth's User Experience Nightmares
Examples Of Good And Bad Essays
7 Examples of good and bad e-commerce websites
Good Examples of Bad Design
Evans, Our God is Awesome: God Passion
Good/Bad Web Design
Cep 817 design ed good bad design
Bad design in examples by Ross Sokolovski
Introduction to User Experience - Mike Biggs
User Experience: The good, the bad, and the ugly
Five principles of document design
Ad

Similar to Better User Experience with .NET (20)

PPT
Grasping The LightSwitch Paradigm
PPTX
Visual Studio 2015 / Visual Studio Team Services Overview
PPTX
Asp.Net MVC Intro
PPT
PPTX
Model View Presenter (MVP) In Aspnet
PPT
Getting Started with Iron Speed Designer
PDF
IBM Cognos 10 Framework Manager Metadata Modeling: Tips and Tricks
DOC
235042632 super-shop-ee
PPT
A Lap Around Visual Studio 2010
ODP
AD207 Presentation
DOCX
ASP.NET MVC3 RAD
PDF
D17251 gc20 47_us
PPTX
STARWEST 2011 - 7 Steps To Improving Software Quality using Microsoft Test Ma...
PPTX
Coded ui test
PPT
Metamorphosis from Forms to Java: A technical lead's perspective, part II
PPT
MVC Pattern. Flex implementation of MVC
PPTX
Improving Software Quality- 2-day Tester Training
DOCX
A report on mvc using the information
PPTX
User Tutorial
PPTX
MongoDB.local Dallas 2019: MongoDB Stitch Tutorial
Grasping The LightSwitch Paradigm
Visual Studio 2015 / Visual Studio Team Services Overview
Asp.Net MVC Intro
Model View Presenter (MVP) In Aspnet
Getting Started with Iron Speed Designer
IBM Cognos 10 Framework Manager Metadata Modeling: Tips and Tricks
235042632 super-shop-ee
A Lap Around Visual Studio 2010
AD207 Presentation
ASP.NET MVC3 RAD
D17251 gc20 47_us
STARWEST 2011 - 7 Steps To Improving Software Quality using Microsoft Test Ma...
Coded ui test
Metamorphosis from Forms to Java: A technical lead's perspective, part II
MVC Pattern. Flex implementation of MVC
Improving Software Quality- 2-day Tester Training
A report on mvc using the information
User Tutorial
MongoDB.local Dallas 2019: MongoDB Stitch Tutorial

More from Peter Gfader (20)

PDF
Achieving Technical Excellence in Your Software Teams - from Devternity
PDF
You Can't Be Agile If Your Testing Practices Suck - Vilnius October 2019
PDF
You Cant Be Agile If Your Code Sucks (with 9 Tips For Dev Teams)
PPTX
How to make more impact as an engineer
PDF
13 explosive things you should try as an agilist
PPTX
You cant be agile if your code sucks
PDF
Use Scrum and Continuous Delivery to innovate like crazy!
PDF
Innovation durch Scrum und Continuous Delivery
PPTX
Speed = $$$
PPTX
Qcon london2012 recap
PPTX
Continuous Delivery with TFS msbuild msdeploy
PPTX
Silverlight vs HTML5 - Lessons learned from the real world...
PPTX
Clean Code Development
PPTX
Data Mining with SQL Server 2008
PPTX
SSAS - Other Cube Browsers
PPTX
Reports with SQL Server Reporting Services
PDF
OLAP – Creating Cubes with SQL Server Analysis Services
PPT
Business Intelligence with SQL Server
PPTX
SQL Server - Full text search
PPTX
Usability AJAX and other ASP.NET Features
Achieving Technical Excellence in Your Software Teams - from Devternity
You Can't Be Agile If Your Testing Practices Suck - Vilnius October 2019
You Cant Be Agile If Your Code Sucks (with 9 Tips For Dev Teams)
How to make more impact as an engineer
13 explosive things you should try as an agilist
You cant be agile if your code sucks
Use Scrum and Continuous Delivery to innovate like crazy!
Innovation durch Scrum und Continuous Delivery
Speed = $$$
Qcon london2012 recap
Continuous Delivery with TFS msbuild msdeploy
Silverlight vs HTML5 - Lessons learned from the real world...
Clean Code Development
Data Mining with SQL Server 2008
SSAS - Other Cube Browsers
Reports with SQL Server Reporting Services
OLAP – Creating Cubes with SQL Server Analysis Services
Business Intelligence with SQL Server
SQL Server - Full text search
Usability AJAX and other ASP.NET Features

Recently uploaded (20)

PPTX
macro complete discussion with given activities
PPTX
Entrepreneurship Management and Finance - Module 1 - PPT
PDF
Global strategy and action plan on oral health 2023 - 2030.pdf
PDF
Developing speaking skill_learning_mater.pdf
PPTX
CHF refers to the condition wherein heart unable to pump a sufficient amount ...
PPTX
Single Visit Endodontics.pptx treatment in one visit
PPTX
UCSP Section A - Human Cultural Variations,Social Differences,social ChangeCo...
PPTX
MALARIA - educational ppt for students..
PDF
V02-Session-4-Leadership-Through-Assessment-MLB.pdf
PDF
BSc-Zoology-02Sem-DrVijay-Comparative anatomy of vertebrates.pdf
PDF
The 10 Most Inspiring Education Leaders to Follow in 2025.pdf
PDF
3-Elementary-Education-Prototype-Syllabi-Compendium.pdf
PDF
English 2nd semesteNotesh biology biopsy results from the other day and I jus...
DOCX
HELMET DETECTION AND BIOMETRIC BASED VEHICLESECURITY USING MACHINE LEARNING.docx
PPTX
GW4 BioMed Candidate Support Webinar 2025
PPTX
Unit1_Kumod_deeplearning.pptx DEEP LEARNING
PDF
HSE and their team are going through the hazards of the issues with learning ...
PPTX
ENGlishGrade8_Quarter2_WEEK1_LESSON1.pptx
PDF
WHAT NURSES SAY_ COMMUNICATION BEHAVIORS ASSOCIATED WITH THE COMP.pdf
PPT
hsl powerpoint resource goyloveh feb 07.ppt
macro complete discussion with given activities
Entrepreneurship Management and Finance - Module 1 - PPT
Global strategy and action plan on oral health 2023 - 2030.pdf
Developing speaking skill_learning_mater.pdf
CHF refers to the condition wherein heart unable to pump a sufficient amount ...
Single Visit Endodontics.pptx treatment in one visit
UCSP Section A - Human Cultural Variations,Social Differences,social ChangeCo...
MALARIA - educational ppt for students..
V02-Session-4-Leadership-Through-Assessment-MLB.pdf
BSc-Zoology-02Sem-DrVijay-Comparative anatomy of vertebrates.pdf
The 10 Most Inspiring Education Leaders to Follow in 2025.pdf
3-Elementary-Education-Prototype-Syllabi-Compendium.pdf
English 2nd semesteNotesh biology biopsy results from the other day and I jus...
HELMET DETECTION AND BIOMETRIC BASED VEHICLESECURITY USING MACHINE LEARNING.docx
GW4 BioMed Candidate Support Webinar 2025
Unit1_Kumod_deeplearning.pptx DEEP LEARNING
HSE and their team are going through the hazards of the issues with learning ...
ENGlishGrade8_Quarter2_WEEK1_LESSON1.pptx
WHAT NURSES SAY_ COMMUNICATION BEHAVIORS ASSOCIATED WITH THE COMP.pdf
hsl powerpoint resource goyloveh feb 07.ppt

Better User Experience with .NET

  • 1. Developing Windows and Web Applications using Visual Studio.NETPeter GfaderSenior Software Architect
  • 3. „Add New“ disabledProblems with Lab / homework?
  • 4. Unused methods, after removing UI controlsTip
  • 5. C# 3.0, C# 4.0, C# 5LINQData with LINQSession 2: Last week?
  • 6. User Experience (UX)Tips and Techniques, Best practicesWindows Forms Capabilities and Demo’sTools to better UX & codeUX ResourcesAgenda
  • 10. Enter data Find data Show dataEvery business app does
  • 11. Professional Feel Enter data ValidationFind data Filter dataRich data queryShow dataDifferent ViewsReports (nice printing)Authorization?Every business app
  • 16. Make site feel aliveReact fastInteract with user“Joy of use”UX - Feel
  • 17. How can we improve UX
  • 18. DevelopersNeed a UI to test their software as they buildUI increases in complexity as software is builtApplication grows but the UI isn’t consistentKnow how the controls work (or they should!!)DesignersMay design the UI but not realize WHAT is possibleMay understand a Visual Consistency but not how its builtWho designs the UI?
  • 20. „User driven“Do testing with the userPrototypingUsability testingLet user solve a task and see (measure) what he doesUser
  • 22. Bandwidth – Presentation layerCache / persistent stateFaster ServerBecause of less requests and less work… thanks to processing power being used on clientRicher interfaceNo buggy DHTML/JavaScriptMore responsiveFaster to developNo cross-browser issuesBuild complex controls quicklyWhy Windows Forms?
  • 23. Not allowed in Standard Operating EnvironmentCross-platform requirements (Linux, PC, Mac)Deployment of the Application is harder / Centralised logicRequires an always-connected data serviceWhy NOT Windows Forms?
  • 24. Network AdminsDevelopersEnd UsersAccountsWho Do I Please?Browser Based SolutionRich Client Solution
  • 25. Who uses prototypes?SketchflowBalsamiqDo you design a mockup UI first?
  • 26. Avoid the thought of a “throw away” prototype.Use as the first step to start a project (or get a project) - WYSIWYGGet great initial feedbackBetter than 100 page documentGet designer involved if need be (Developers can’t design)Tip: Always add client logo + colours. They are easily impressed!Designing a Mockup UI
  • 27. Would you design Database first or UI?Database schema should be designed before the UI is startedIf you are doing fixed price work, signed-off mockups serve as a great way to stop goal posts moving. Any changes to the mockups thereafter will result in additional work.Designing a Mockup UI
  • 28. Windows Forms – Best practices
  • 29. Visual InheritanceComposition and Containment (Panels, Usercontrols)DatabindingToolTipsError Provider and ValidatorsAppsettingsWinform Architecture
  • 30. The constructor of each form/control class contains a call of a private method "InitializeComponent()". If B is derived from A, then the constructor of A is called firstA()A.InitializedComponent()B()B.InitialzeComponent()Visual Inheritance
  • 31. Controls on the Base Form are BY DEFAULT “private” and cannot be edited in the inherited formSolution: Change the modifer to “Protected”Visual Inheritance
  • 32. Common BehaviourCompany Icon Remembering its size and locationAdding itself to a global forms collection (to find forms that are already open, or to close all open forms) ** Application.OpenFormsLogging usage frequency and performance of forms (load time)No Controls!Inherited Forms – For Every Form
  • 33. CenterParent only for modal dialogs (to prevent multi-monitor confusion) CenterScreen only for the main form (MainForm), or a splash screen WindowsDefaultLocation for everything else (99% of forms) - prevents windows from appearing on top of one anotherStartPosition
  • 34. FixedDialog only for modal dialog boxes FixedSingle only for the the main form (MainForm) - FixedSingle has an icon whereas FixedDialog doesn'tNone for splash screen Sizable for any form that has multi-line textbox, grid, listbox or suchFormBorderStyle
  • 35. Base Data Entry Form3412
  • 36. Do you encapsulate (aka lock) values of forms?
  • 38. Developers fiddle!Browsable: whether a property or event should be displayed in a Properties window. http://msdn.microsoft.com/en-us/library/system.componentmodel.browsableattribute.aspxEditorBrowsable: whether a property or method is viewable in an editor.http://msdn.microsoft.com/en-us/library/system.componentmodel.editorbrowsableattribute.aspxHiding Values
  • 39. Hiding Valuesusing System.ComponentModel;[Browsable(false), EditorBrowsable(false)]public new Font Font{ get { return base.Font; } set {base.Font = value; } }Imports System.ComponentModel<Browsable(False), EditorBrowsable(false)> _ Public Shadows Property Font() As Font Get Return MyBase.Font End Get Set(ByVal Value As Font) 'MyBase.Font = Value 'normal property syntaxMyBase.Font = New Font(Me.Font.FontFamily, 20) End SetEnd Property
  • 40. Do you know when to use User Controls?
  • 41. You lose the AcceptButton and CancelButton properties from the Designer e.g. OK, Cancel, Apply Therefore the OK, Cancel and Apply buttons cannot be on User Controls. User Controls
  • 42. You can use a user control more than once on the same form e.g. Mailing Address, Billing Address You can reuse logic in the code behind the controls e.g. Search control User controls are less prone to visual inheritance errors User Controls
  • 43. User ControlsControls only used onceBad! »
  • 44. User ControlsOnly for reuseGood! »
  • 45. User Controls – TabPagesException! »
  • 46. Possible Exception:When a form has multiple tabs, and each tab has numerous controls – it can be easier to use User Control in this caseSmaller designer generated codeMore than one person can be working on a different ‘tab’User Controls – TabPages
  • 47. Code intensiveMust manually handle the Validating event of each control you want to validateMust be manually running the validation methods when the OK or Apply button is clickedError Provider
  • 48. Controls that “attach” themselves to existing Do you use validator controls?
  • 49. Validator ControlsGoodNo code, all in the designer (integrates with the ErrorProvider)
  • 50. Windows Forms – Validation
  • 51. Validation logic is in the ModelValidation with Entity Frameworkpublic partial class Employee{ partial void OnLastNameChanging(string value) { if (string.Compare(value, "Gfader", StringComparison.InvariantCultureIgnoreCase) == 0) { throw new ArgumentException("No GFADER allowed"); } }}
  • 52. Validation logic is in the ModelValidation with Entity Frameworkpublicpartialclass Employee{partialvoidOnLastNameChanging(string value) {if (string.Compare(value, "Gfader", StringComparison.InvariantCultureIgnoreCase) == 0) {thrownewArgumentException("No GFADERallowed"); } }}
  • 53. Partial class holds validation logicPartial class
  • 56. Happens in modelDifferent UI layers can react to validation differentlyWeb pageWindows FormSilverlightWPF...Validation
  • 57. Monitor Performance betterGood user feedbackEasy to doAdamE thinks“general user’s don’t care about technical details, a progress bar is better”Do you use a status bar to show load time?
  • 58. Don't use splash screens for branding. Avoid using splash screens because they may cause users to associate your program with poor performance. Use them only to give feedback and reduce the perception of time for programs that have unusually long load times.Don't use animated splash screens. Users often assume that the animated splash screen is the reason for a long load time. Too often, that assumption is correct.Splash Screens
  • 59. Two-way binding means that the object/data structure is bound to the UI Element/ControlThe setting/getting and the positioning of elements in a collection is handled by the databindingmechansismsDatabinding is VASTLY superior in WPFDo you always use the Visual Studio designer for data binding where possible?
  • 60. Bad – write your own boring codePrivate Sub OnLoad()OrderDetailsService.Instance.GetAll(Me.OrderDetailsDataSet1) Dim row As OrderDetailsDataSet.OrderDetailsRow = Me.OrderDetailsDataSet1.OrderDetails(0) Me.TextBox1.Text = row.UnitPrice.ToString("c") End Sub Private Sub Save() Dim row As OrderDetailsDataSet.OrderDetailsRow = Me.OrderDetailsDataSet1.OrderDetails(0)row.UnitPrice = Decimal.Parse(Me.TextBox1.Text, System.Globalization.NumberStyles.Currency) End Sub
  • 61. Using the DesignerSimpleBinding to a single propertyComplexBinding to a list
  • 63. MDI FormsHangover from Access 2.0 and Windows 3.1Clutter the applicationOnly one window on the taskbarNo multiple monitor support
  • 64. Do you make common control with certain width?
  • 68. Part of Visual Studio 2010 "Ultimate" editionMicrosoft Test Manager
  • 73. Generated coded UI test[TestMethod]publicvoid CodedUITestMethod1(){this.UIMap.StartApplication();this.UIMap.LoginToApplication();this.UIMap.SeeDetailsform();this.UIMap.ClickOnnextRecord();this.UIMap.SeetheNextRecord();}
  • 74. Automated recordingIntelliTrace (drill through to Visual Studio)Bug in TFSVideo.wmvDetailed stepsLots of details (you don’t need if you get intelliTrace)Stack traceSystem infoMicrosoft Test Manager
  • 76. Book "User Interface Design for Programmers“Bloghttp://www.joelonsoftware.com/UX patternshttp://quince.infragistics.com/Resources
  • 78. Covers Windows UI reference guidelinesThis should be your main ‘Bible’ when designing Windows Forms (not Web) if you’re not a designer as it provides a consistent standardWindows UX Guidelines
  • 80. Thank You!Gateway Court Suite 10 81 - 91 Military Road Neutral Bay, Sydney NSW 2089 AUSTRALIA ABN: 21 069 371 900 Phone: + 61 2 9953 3000 Fax: + 61 2 9953 3105 [email protected]

Editor's Notes

  • #2: Click to add notesPeter Gfader Developing Windows and Web applications
  • #5: Show View call hierarchy: for finding uncalled methodsCtrl+K, Ctrl+T
  • #6: Who did the C# tutorial?What is .NET?What is .NET framework?What is the CLR?What is OOP?Classes, Objects, Properties, Events, MethodsEncapsulation, Abstraction, Inheritance, Polymorphism
  • #9: Browse iPhone apps on the web without iTuneshttp://www.yappler.com/
  • #14: User Experience consists of usability, look and feelWe want to improve the feel and usability
  • #16: ease with which people can employ a particular tool or other human-made object in order to achieve a particular goal
  • #17: Make the site feel alive
  • #18: How can we make our users happy
  • #19: What do they do?
  • #20: Its all about the user!
  • #69: Demo Test managerRecord interaction with NorthwindEntities (from lab week2)