Sources for Learning WPF/XAML

So I’ve been using pyRevit now for the past couple of years and got couple of basic plugins up and running. I’ve learned a lot just from reading through the codebase for all of the great extensions that come with pyRevit. I’ve used much of this code for my own extensions. However, I’ve kind of hit a wall when it comes to WPF/XAML. There’s a huge knowledge gap that I’m having a hard time crossing, in large part because many of the resources online are so prescriptive and don’t really explain some of the concepts at a high level, such as how to organize my code and how to template reusable pieces of code (not to mention the inner workings of data-binding). Plus most resource rely on a working knowledge of C# (which I do not have) rather than python.

How did you learn WPF/XAML? As a designer, I have a strong desire to create some reasonably good-looking custom UIs for my applications, and I don’t have a background in computer science (though I’ve been an avid programmer for the past 7 or so years as a hobby).

Thanks for all that you guys contribute to the community. :slight_smile:

2 Likes

Welcome to the wpf wall!

The two resources I recommend are the pyrevit youtube channel series on this topic and eftools’ code which has fully developed examples.

It will take time to make sense and there isn’t any complete guide from 0 to 100 out there.

1 Like

Let’s hit the wall :stuck_out_tongue:
Besides the ones from Ehsan,
Pretty basic ones, but it gives you some of the basics:

  • Erik’s did a great job with his ui in EF-Tools
  • Look also at pyChilizer extension, they use the rpw module quite extensively (that comes with pyrevit and is packed with tools to build complex UI, pretty much like Data-Shapes in Dynamo)
  • Look at the rwp module code as well

https://revitpythonwrapper.readthedocs.io/en/latest/ui.html

2 Likes
2 Likes

@_bitsy

I feel your pain as I have been searching high and low to see if there are more tutorials like this one " GUI Basics: First “Hello World” WPF Window" by Ehsan and not been able to find anything similar.

I will share with you what I have found so far and this is purely my understanding, and it could be wrong, so could the experienced users correct me please.

I have broken down the process in 3 different sections:

Section 1 is creating the Xaml file, which in my opinion is the easiest part. I have been using this as a guide https://youtu.be/Vjldip84CXQ?si=figdkjY-5x892rdn

Section 2 - Is understanding Xaml Datatemplates , been using this website WPF Tutorial | Data Templates and youtube and general google search

Section 3 - Exchange data between your python script and Xaml file, which I think is the hardest part to understand. I have been using lots of the existing tools from EF_Tools (Thanks to Erik) and others to understand how they have done it.

Hope this help

1 Like

Thanks all for the helpful feedback! I know it’s a pretty broad question, but I appreciate y’all pointing me to these resources. Python is such an easy gateway into Revit plugin development, but WPF feels like quite a different animal.

Same here! Ehsan’s videos are excellent, my only “complaint” is that I wish there were more in the series. I have learned a lot from looking at the pyRevit scripts themselves, but there’s only so much I can extrapolate from those examples.

Between EF-Tools and SingletonSean (and all the other great resources), it sounds like I’ve got some good homework for the next few weeks.

1 Like

I guess I can’t mark more than one solution? :slight_smile:

1 Like