tags:

views:

173

answers:

7
+3  Q: 

WPF fundamentals?

At the University we teach .NET (both VB and C#) using Windows Forms. We want to introduce the concept of Windows Presentation Foundation (WPF) to our advanced course. Which fundamentals of WPF does students need to learn in order to get the basic knowledge of WPF?

The idea is for student to use WPF in at least one of six assignments, and to learn all of these WPF Fundamentals seems a bit daunting. Which three-four basics is considered mandatory?

Thanx for your time!

+2  A: 

Dependency Properties, Routed Events and layout model are absolutely necessary in my opinion. Data Binding & MVVM come next.

I'm not a WPF guru, but i think that technically, WPF is much more complex, that Windows Forms, and if students are common with later, it will be hard to code using a "WPF-way" ( especially, if there is no html/xml background ). I doubt, that it is possible to write robust code using WPF without knowing some major aspects of it. WPF is really a bad choice for quick or simple UI's. It needs a considerable amount of learning time to dive in.

n535
That's a good point! My Professor wants me to "add a few bullits" on WPF, but what your really saying that isn't the way to go. This is valuable input too me -Thanx!
BennySkogberg
+2  A: 

They're all called fundamentals for a reason. You should have at least a basic understanding of all of them if you're planning on building any sort of successful WPF application.

If I had to single some things out so that your class could at least get started with building something, I would probably say:

XAML and Data Binding are both musts. Dependency Properties are a close second. Input/Commands/Routed Events all would be included as well.

Justin Niessner
It was my first thought. Probably one can start on a few fundamental topics, building sceletons with XAML and in the next assignment continue with Data Binding and Dependency Properties. Thanx for your input!
BennySkogberg
+3  A: 

I really don't believe that three or four topics is enough. But talking about highest priorities, I'd say

  1. XAML and markup extensions,
  2. Layout and panels,
  3. Routed events,
  4. Dependency- and attached properties.
Dmitry Ornatsky
Thanx. Maybe one should divide the course in two halves instead. WPF 50% and Windows Forms 50%? Appreciate your input!
BennySkogberg
+1  A: 

I found Charles Petzhold's book "Applications = Code + Markup" to be extremely helpful when I started out with WPF. The first half of the book is entirely C# code, teaching the basic concepts of WPF (dependency properties, eventing, etc.) with no XAML whatsoever. The second half of the book introduces the concept of XAML and how it relates to everything you learned in the first half of the book. If I were teaching a class on WPF, I would definitely lay things out in a similar way -- teach the concepts in code first, then introduce XAML.

Matt Bridges
True that. Students are familiar with C# (and VB) programming concepts. Maybe one can work faster through these concepts and pay grater attention to XAML when the first part is done from the book. Thanx for your input!
BennySkogberg
+1  A: 

Although this is quite subjective, I think a good four would be (from that link):

  • Element Tree and Serialization: This is completely new from WinForms to WPF and getting an understanding of how the Visual and Logical tree's work is quite important in understanding how things get done in WPF.
  • Events (WPF) - Again, this varies substantially from WinForms and brings in all the goodies of WPFs event modelling.
  • Styles and Templates - This is what brings WPF to life. All the bindings to the UI and what not also fall into this category.
  • Layout System - Well, it's WPF isn't it? The layout is an integral part of the process.

Apart from these, Dependency Properties are Important as well as at least understanding how XAML works. There is no real "only option" when it comes to WPF. It's a brand new way of doing things if you have worked with models such as WinForms. I would try to learn as much as possible.

Kyle Rozendo
The reference and difference to WinForms is pretty much what I'm after. Students have a good knowledge on WinForms from preceding course (.NET basic course) - so I think your idea is great. Thanx!
BennySkogberg
+3  A: 

If you think about how to didactically structure your course, you should consider Petzold's book. The way he structures his chapters works perfectly well for live courses. It is very fine tuned didactically and we made some good experience structuring a course around this book. We have also made the experience that it works especially well for people with a Windows Forms background. It starts out with code only (c#) and only later introduces XAML. This helps a great deal to grasp the concepts of the framework.

bitbonk
Thanx for the tip on the book! From the ToC it looks like the one I need to read before changing the assignments and lectures to the spring course. Thanx!
BennySkogberg
+1 for Petzold's :)
Avatar
+5  A: 

Here is the list. I prepared for my junior programmer.

1) XAML Basics & Basic controls such as TextBox, Buttons etc.,
2) VisualTree and LogicalTree
3) Bubbling and Tunneling

4) DependencyProperty
5) AttachedProperty

6) DataTemplate
7) ControlTemplate

8) Style

9) DataBinding

Triggers:
10) EventTriggers
11) DataTriggers

MVVM Basics & Commands:
12) DelegateCommand
13) RelayCommand
14) ApplicationCommands
15) RoutedEvent
16) RoutedCommand

Transformations:
17) RenderTransform
18) LayoutTransform

Resources:
19) BinaryResource
20) LogicalResource
21) StaticResource
22) DynamicResource
23) RelativeResource

Panles and Basic Controls:
24) Layouts and Panels
25) UserControl
26) ContentControl
27) Some Controls like Grid, TreeView and Charts

Interfaces and Collections:
28) IValueConverter
29) INotifyPropertyChanged
30) ObservableCollection
31) CollectionViewSource

HTH

Avatar
Wow, thats an extensive list of things to learn. I appreciate your effort, Avatar! Thanx!
BennySkogberg