1 / 77

Developing Windows and Web Applications using Visual Studio.NET

Developing Windows and Web Applications using Visual Studio.NET. Drew Robson. Tip. Unused methods, after removing UI controls. Session 2: Last week?. C# 3.0, C# 4.0 http://www.extensionmethod.net/ LINQ Databining with LINQ. Agenda. User Experience (UX)

trung
Télécharger la présentation

Developing Windows and Web Applications using Visual Studio.NET

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Developing Windows and Web Applications using Visual Studio.NET Drew Robson

  2. Tip • Unused methods, after removing UI controls

  3. Session 2: Last week? • C# 3.0, C# 4.0 • http://www.extensionmethod.net/ • LINQ • Databining with LINQ

  4. Agenda • User Experience (UX) • Tips and Techniques, Best practices • Windows Forms Capabilities and Demo’s • Tools to better UX & code • UX Resources

  5. Poor User Experience

  6. Good User Experience

  7. Business applications

  8. Every business app does • Data entry

  9. Every business app does • Finding data

  10. Every business app does • Displaying data

  11. Every business app • Data entry • Validation • Finding data • Filtering data • Rich data queries • Displaying data • Different Views • Reports (nice printing) • Authorization?

  12. Over Complicated Design

  13. Lack of Design

  14. Too Many Options

  15. User Experience

  16. User Experience • 3 pillars

  17. UX - Look

  18. UX - Usability

  19. UX - Feel • Make a site feel alive • React fast • Interact with user • “Joy of use”

  20. How can we improve UX

  21. Who designs the UI?

  22. Who designs the UI? • Developers • UI to test their software as they build • UI increases in complexity • Application grows but the UI isn’t consistent • Know how the controls work (or they should!!) • Designers • Design the UI but not realize WHAT is possible • Understand a Visual Consistency but not how its built

  23. Who uses the UI?

  24. User • “User driven“ • Testing is done with the user • Prototyping • Usability testing • Let the user solve a task and see (measure) what he does

  25. Why choose Windows Forms?

  26. Why Windows Forms? • Bandwidth – Presentation layer • Cache / persistent state • Faster Server • Because of less requests and less work… thanks to processing power being used on client • Richer interface • No buggy DHTML/JavaScript • More responsive • Faster to develop • No cross-browser issues • Build complex controls quickly

  27. Why NOT Windows Forms? • Not allowed in some Standard Operating Environments • Cross-platform requirements (Linux, PC, Mac) • Deployment of the Application is harder / Centralised logic • Requires an always-connected data service

  28. Who Do I Please? • Network Admins • Developers • End Users • Accountants Browser Based Solution Rich Client Solution        

  29. Do you design a mockup UI first? • Who uses prototypes? • Sketchflow • Balsamiq

  30. Designing a Mockup UI • Avoid the thought of a “throw away” prototype. • Use as the first step to start a project (or get a project) - WYSIWYG • Get great initial feedback • Better than 100 page document • Get a designer involved if need be (Developers can’t design) • Tip: Always add the client logo + colours. They are easily impressed!

  31. Designing a Mockup UI • Would you design the Database first or the UI? • The database schema should be designed before the UI is started • If 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.

  32. Windows Forms – Best practices

  33. Winform Architecture • Visual Inheritance • Composition and Containment (Panels, Usercontrols) • Databinding • ToolTips • Error Provider and Validators • Appsettings

  34. Visual Inheritance • 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 first • A() • A.InitializedComponent() • B() • B.InitialzeComponent()

  35. Visual Inheritance • Controls on the Base Form are BY DEFAULT “private” and cannot be edited in the inherited form • Solution: Change the modifer to “Protected”

  36. Inherited Forms – For Every Form • Common Behaviour • Company Icon • Remembering its size and location • Adding itself to a global forms collection (to find forms that are already open, or to close all open forms) ** Application.OpenForms • Logging usage frequency and performance of forms (load time) • No Controls!

  37. StartPosition • 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 another

  38. FormBorderStyle • FixedDialog only for modal dialog boxes • FixedSingle only for the main form: MainForm(FixedSingle has an icon whereas FixedDialog doesn't) • None for splash screen • Sizable for any form that has multi-line textbox, grid, listbox or such

  39. Base Data Entry Form 1 2

  40. Do you encapsulate (aka lock) the values of forms?

  41. Hiding Values

  42. 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.aspx EditorBrowsable: whether a property or method is viewable in an editor.http://msdn.microsoft.com/en-us/library/system.componentmodel.editorbrowsableattribute.aspx

  43. Hiding Values using 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

  44. Do you know when to use User Controls?

  45. 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.

  46. 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

  47. User Controls • Each control is used only once

  48. User Controls • Implemented for reuse

  49. User Controls – TabPages

  50. User Controls – TabPages Possible Exception: • When a form has multiple tabs, and each tab has numerous controls – it can be easier to use User Control in this case • Smaller designer generated code • More than one person can be working on a different ‘tab’

More Related