I know I’m late to the party but man I hope you haven’t stopped teaching cause I’m telling you’re gifted for this. I’m just getting into WPF sure feel little overwhelmed but the content is pure Gold thanks for the effort spent to creating this content.
Mention: VS2019 doesn't set the build action for images by default, so if you want to use images with image sources just like "Images/[...]" or "/Images/[...]", you have to set the build action from "none" to "resource" for this image, otherwise it won't be rendered (just click on the image and press f4 to open this property menu. select the dropdown "build action", that's it). Found it out after watching and building your UI. Great tutorial, thank you very much!
Thanks for this, I was trying to set the folder to resource and it was doing my head in....at least this is a work around. Also remember, if you do not run a code clean-up after doing this...it will report the same error.
@@TheDuerden Thank you so much! This fixed it for me. FYI for anyone else: To run Code Cleanup, go to one of your .cs scripts and click the little broom icon in the bottom left.
When I encountered your tutorial I thought who will watch for one hour, but when I started watching believe me I am immersed in it. The explanation is amazing. Please do continue your work like this. Those who can't afford money for tutorials for them you are creating platform with your channel to learn technologies. Thank you so much for creating these kind of videos.
Thanks. Yeah I do them for people who really want to learn the whole process of real-world code. It isn't designed as a quick tip or learn this little bit, its more of a full training course :)
This is awesome once again. I am soo excited for the future videos. Finally someone capable of explaining guiding us all the way through. Thank you man for sharing this with us ;)
Thanks. I'll try and get the next video done tonight if possible, to get into the ViewModel stuff and the DNA framework and make a real start on the chat app after that video
Extremely nicely done video. And I like that you didn’t cut out your debugging and thinking aloud because that’s what all programmers do and it’s important to keep. You and your channel are one of a kind!
I am so impressed... I looked at your youtube home page and discovered you have tutorials on WPF, C# AND!!!!!! SOLIDWORKS API.... I am blown away...because... I love the way you tutor and NOW you can tutor me in the 3 subjects I need most... WPF, C# and Solidworks Api.... WTF!!!
Awesome. Yeah the SolidDNA stuff is fun I want to get back to doing more of it, it is just the WPF fans took over and it was way more popular. I'll do more SolidDNA shortly though
just for anybody that needs it, i find it easier to create a binding like that if i head over to the image properties on the right side, search for Source, click on the little square, select Create Binding and go from there, no worries about curly brackets.
Thank you very much for all these tutorials, they're the best and most in-depth explanations of WPF and C# I've found on youtube. Great teacher! I'm going to start thinking of code in my head in an English accent now, which is fine by me!
Why soo many useless comments? 'Create a list for directories' that's literally what the codes says. But next to that, great tutorial. Getting to know the binding better and better. Thanks for that!
This is amazing. So worth the 1 hour of watching. I learned more in an hour of watching this than I did in 3 hours of parsing through the wordy, verbose Microsoft Documentation.
bnfgh123 this series is for people who know c# and programming but not WPF. So it may be hard to follow if you don't already know the main programming language and concepts already. I plan to make a true beginners WPF series shortly
Well, I'm currently learning C#, but the main problem is, that I can't really find the right order in which I should learn the different features and when I stumble upon anything about C# I just try and see, whether I can or cannot comprehend. Wish that I could find some reasonably paced, ordered and complete series about the language. But judging by the first video, this series on WPF is one of the best tutorials I found so far, I'll just have to do a little bit more training on C# itself and then come back.
AngelSix Honestly the most struggling part I have with WPF is the data binding part. I look forward to your beginner series as I hope it covers that in more detail.
Yea, After watching his first video, then coming to this I was confused as to who his audience was. At first it did seem like total noobs.. but after watching this, it's still fairly confusing, because he explains some things like who would for a noob, but then others he explains them with little context, or as he would for someone with much more experience. This video expects knowledge of C#, OOP, and MVC Design Pattern. If you don't know at least all 3 of these, you'l prob get lost watching this. At the very least, youl have trouble understanding certain things.
Like this series so far :) I found another way to create the tree-view item and it's path and header. You could change: //Create a new item for it var item = new TreeViewItem(); //Set header and path item.Header = drive; item.Tag = drive; to var item = new TreeViewItem {Header = drive, Tag = drive}; Both works for me :) Just two ways to do the same thing :)
You are awesome for (and awesome at) making these videos. The whole integrated nature of WPF has been a hurdle for me as I am not a web or desktop/GUI developer (I'm an embedded guy making a new tool for work). Seeing the real working examples with all of the moving parts has really helped me grok WPF. Thank you.
I learn quite alot from this video. I learn: 1. How to populate TreeView on Window_Loaded event which is seem like good place to do it. 2. How to define template of TreeViewItem interface design. 3. That TreeViewItem has Header as primary data and Tag as secondary data (or as additional placeholder). 4. Using #region to tidy up. 5. Attaching event handler to event via delegate operator. 6. Programming skill on when to break and inspect data before continue with detail coding to ensure intended method. 7. Binding including using of Path token and default path. 8. That I can bind image source, visibility property (or other non-string properties I reckon) to a string data using Converter. 9. Also if string data to be used as source change on condition, using Converter is also ideal. 10. How to create a converter class which inherit from IValueConverter. The above is typically seen in everywhere which include MSDN, example, questions in stack overflow but I'm just not proficient to understand it. Now it seem clear, at least at basic. However I seem could not understand the RelativeSource token. Question 1: I could not understand why a subitem, or subsubitem or subsubsubitem (item here is referring to TreeViewItem) would required a RelativeSource to an ancestor (which the ancestor type is also a TreeViewItem). Each TreeViewItem has its Tag field, store with it full path which should be used to determine what type of image to be used in Converter. Also, if the ancestor type is a TreeViewItem, what happen to the top items which define the drive (rather than folder and file)? I taken that the top items have TreeView as ancestor (instead of TreeViewItem). So I'm confused, could not relate and understand the used of RelativeSource in this case. Would you explained when you able? Update to Question 1: I found an article in MSDN. So a TreeViewItem (a HeaderedItemsControl Type) has a "Header" object and an "Items" collection. FolderView has a typical design of showing One Image and One String. So we choose to defined such design in the Header object using Header Template which the design scheme will repeating for each TreeViewItem automatically. Thus because the "Tag" field we needed for Converter is owned by the TreeViewItem (parent of the Header), we need to access the ancestor and get the 'Tag" field (via "Path" token) which is passed to the Converter. In addition, the collection of Item is also filled with TreeViewItem with the same design/scheme. I hope the above understanding is correct. Question 2: in Tutorial 1, you always used "this" keyword to access the UI elements in the code such as "this.WeldCheckbox", "this.LengthText" and "this.FinishDropdown" even the code are from the same class of MainWindow. However it was not in this Tutorial where all UI elements were accessed/written directly without "this" keyword. Which is the good practice to follow? I hope you are not bored with my questions. I'm kinda hopeless. HA-HA. Thanks mate. I'm only at Tutorial #2 but this is awesome!
Yes question 1 you got correct yourself. Question 2. I preferred typing this. for a lot of things, just so it was obvious to the coder (me/you) that the item we are accessing is contained in this class, and not a static item. However, I have since changed my preference and now never use the this. prefix. It is purely your own preference.
I got "corrected" myself - several times. HAHAHA. I've been editing the above post every time I understand some bit. Thanks for checking - that help my confident. I moving on with the next tutorial.
Holy shit this is hard on beginners, I feel I need 10 videos before this one. I then skipped to the 4th video in the playlist and everything was going well until you brought piece of code from this video, the customized look of the window. So now I have to pull through this one even though I don't understand half of the stuff. It would maybe be easier if you didn't include these dummy items after you presented us with the idea of how treeview should look with dummy items, I feel kinda frustrated. However your other videos are 10/10, from this playlist and other ones (I just wish this video didn't exist specifically) . You've helped a lot, big thanks! Subed!
Thanks so much for this tutorial! Very informative. The only problem I had was my images not loading. I had to click their properties and set the Build Action to 'Resource' and below that chose 'Copy Always'.
So far 2 very good videos on WPF, this is the best stuff I have come across. Now looking forward to more hardcore stuff like data binding, viewmodel, UIEvents, ICommands, PropertyChanged Events n more. Thank you
+AngelSIx you are just amazing. Than you for representing the non Indian community in such an awsome way. I don't mean to offend anyone, but hearing clear english allows me to focus on learning instead of deciphering what they meant to say :) Your content is umbelivable, you go fast to keep the lengh of the video to a minimum, awsome, awsome, awsome. Subscribed.
Great video! Thank you so much for teaching. It was exactly exactly what I was looking for. So clear step by step guidance bringing to tangible ( visible :) result. And thanks for GitHub source!
At about 48:20 you say something that made the hair on the back of my neck stand up! You started talking about value converters and bindings and said something along the lines of - "This is just the simple stuff. We'll get into the more complicated things in later videos." At this point, however, my brain's already oversaturated and I know I will not even remember how to do a fraction of what you have already shown, and this is the "simple" stuff. I think I peed myself, a little bit. Also getting relative binds and going back up the tree to get the tag you mention that this is "messy" and "ugly" and here was the scary line again, you say - "and there are so many ways to get bindings...and you just get used to it.". Well, this is the overall problem learning to work within already super complication APIs. It is true there are many ways to do the same thing. But unfortunately, that means there are also many ways to try to get bindings that end up being a mish-mash of all the possible ways to do it right, that end up being WRONG! So you end up running down dead-end rabbit holes until finally, all you want to do is go watch dogs surfing on youtube!
My drive images were not showing up also. I googled, which indicated to set the drive image file property Build Action to Resources. That worked for some people but did not work for me. I had to set the Build Action property to Content and it was also recommended to Copy to Output Directory to Copy if newer. Setting those worked for my drive image.
Thoroughly enjoyed the learning, Took me more than 3 Hours to reach 42:53 and then you did something with either delete or cut paste .. that messed up everything. I just couldn't follow what you did between those 20 seconds. Frustrating to restart from scratch. Since you are the best, I will.
Another fantastic tutorial, I love the depth of the video, and yet I can grasp the concepts fairly easily :) thanks a lot for the effort, greetings again from rainy scotland :)
Thanks. It gets a little harder as you go if you don't already know certain coding concepts as it's not a beginners series as in beginners with no programming experience but if you struggle going forward I plan to do some more basic WPF series in the future that take things slower. Sounds like you are managing well so far anyway!
I think the learning curve is perfect for someone with some coding experience, as myself, and I think it's great that you introduce more advanced concepts already :) already on the 3rd video today and still enjoying it :D
Very cool, thank you. Helping me refresh and take to next level of WPF. Grabbing related image files from github. If you need any help with any animation, 3d modeling, let me know. You rock brother.
Everytime I run the program and I put the breakpoint at "var item = (TreeViewItem)sender:", I hover over "item" and keep getting "null". As a result, it throws an exception. I have been trying for a long time to troubleshoot that issue , but to no avail. Please help!!
Your a king! so many good tips and small tricks in this tutorial very helpfull! sometimes a bit to much information for newcommers i can belive (maybe expand a bit on recursion it can be a hard topic to swallow imo.) But very usefull thx alot!
Brilliant videos but I have a problem with a System.IO.IO Exception, I have checked the image variable in debug and it is showing Images/folder-closed. the exception is it cannot find the folder it is looking for images/folder-closed. i have checked all the code but cannot see where it get image instead of Image need to sort before i move onto next video hope you can point me in the right direction
I'm sorry, but at 16:30 i've got no images of drives, i rewatched videos and redo the code about 5 times and i've got the same, don''t you know why? Also, when i run the program at 9:40 i have images. ( sorry for my English,i know it's pretty bad)
"... i hope you enjoyed this". i didn't understand 2nd half(where using converter to change image). but yes, i enjoyed this. i might get after i'll re-watch it few more times. this is far better than those "for dummies" videos where they just copying/repeating the stuff from the getting started page of the subject.
Really? The value it is expecting is a bitmap. The only reason you can type a string in xaml is because there is an inbuild string to resource converter that gets called, but if you use a custom provider, and return a string, it will not then go to the string to bitmap converter... at least last time I checked it did not?
Spent a frustrating hour or so trying to figure out why the images were not being displayed. Finally found a note that the Properties of the embedded images after being imported have to set with the properties "Build Action" = "Content" and "Copy to Output Directories" = "Copy if Newer" but that didn't work. The only way I could get it to work was with a fully qualified path. I'm using VS19 with .Net Core 3.1. Switched to use .Net Core 5.0. No change using a relative path. ARG!! Moved the project to a different directory nearer the drive root and retried again thinking that the resolved path exceeded MS 260 char limit. Seemed to work. Then did it again and verified that the resolved path was less than 260 but it didn't work. WTF. Couldn't get pack: to work and properly resolve the execution path to the png files. Had to resort to the following. // Find out where the code base is executing in order to get to the Images subdirectory string exePath = System.IO.Path.GetDirectoryName( System.Reflection.Assembly.GetEntryAssembly().Location); // map the subdirectory and drive image name for conversion BitmapImage bitmapImage = new BitmapImage(new Uri($"{exePath}/Images/{image}")); I really like your tutorials and work through them following along step by step in visual studio and pausing to research when I don't quite understand or like above something didn't seem to work.
I'm pretty late to the 🎉, Although the video is so explicit, I couldn't run even the first dummy execution.😢 this is because the IDE shows: The member "HeaderTemplate" is not recognized or is not accessible and it doesn't allow me to run the code, I am working with Microsoft Visual Studio 2022, please if anybody could give a glue why this is happening?
I stumbled upon your videos when I was researching WPF .net core version. I tried the things I saw on the video and much to my surprise, I saw that the WPF .net core version is no where near ready to be used as production program. I converted my WPF .net core to WPF .net framework.
This video is extremely good. Thanks for your effort. But, as a developer who is coming from Winform, ImageSource binding was too complicated. ValueConverter was a little bit more understandable. As a result, I liked much your presentation.
I can add expanded event with an implicit way using ItemTreeView.Expaned in xaml; then using eventrouting (e) but I don't understand what is routedeventargs ? is that like a traveled event through all the treeitems?
Does anyone have any idea why the images show up at design time, but don't show up when I run. Even with the test StackPanel at the beginning (which sits outside the TreeView), when I add the image, it shows up on the layout window, but when I run, the text shows up, but no image. Likewise, when I set the style up in the TreeView and programmatically add the logical drives (in my case, just one) I get the text ("Some folder"), but no image. This frustration aside, AngelSix, your delivery is great. I think I'm going to love this series.
Try Marcel Kelm's comment above yours atm: "Mention: VS2019 doesn't set the build action for images by default, so if you want to use images [...] you have to set the build action from "none" to "resource" for this image [...]"
Using property bindings in XAML (instead of programatically changing properties in C#) must be related to proper MVVM practice, is that right? Is this done only to increase usability of the business logic among different UI setups? Thanks so much for the intensive training materials, most are too slow and generic to be worth the time.
Since leaving this comment, I've rebuilt some business apps and I love using NotifyPropertyChange! Set it and forget it, I haven't touched my UI in days! Although this is a concept from the next video :)
MVVM has two benefits. Firstly it forces you to not hard tie your view logic (like a button should perform an action when clicked) to the actual UI itself. Instead the logic is in the view agnostic view model. This allows for unit testing and changing or using multiple UIs with very little change. It then also forces you to think about your UI as just that, no concern for code behind, just bind to models and react according to models. That makes any significant UI element/event expressable and testable in the view model. Finally, it allows for lack of concern about the UI thread in the view model. Just change the properties, and then when the UI thats hooked into the notify events, it handles jumping back to the UI thread in one place, instead of all over your view model code.
I am trying to expand the folder open. I added the collapsed event to the item and subitems of the folders, something interesting happened: When i tried to collapse the subitem, the collapse event of it triggered, but then, the parent item of it also triggered the collapse event, it's bothered me for a long time.
My Setup & Recommendations www.amazon.co.uk/shop/angelsix
I know I’m late to the party but man I hope you haven’t stopped teaching cause I’m telling you’re gifted for this. I’m just getting into WPF sure feel little overwhelmed but the content is pure Gold thanks for the effort spent to creating this content.
Mention: VS2019 doesn't set the build action for images by default, so if you want to use images with image sources just like "Images/[...]" or "/Images/[...]", you have to set the build action from "none" to "resource" for this image, otherwise it won't be rendered (just click on the image and press f4 to open this property menu. select the dropdown "build action", that's it).
Found it out after watching and building your UI.
Great tutorial, thank you very much!
Thanks for this, I was trying to set the folder to resource and it was doing my head in....at least this is a work around.
Also remember, if you do not run a code clean-up after doing this...it will report the same error.
@@TheDuerden Thank you so much! This fixed it for me.
FYI for anyone else: To run Code Cleanup, go to one of your .cs scripts and click the little broom icon in the bottom left.
Thanks
Thank God you saved my day.
Thank you
When I encountered your tutorial I thought who will watch for one hour, but when I started watching believe me I am immersed in it. The explanation is amazing. Please do continue your work like this. Those who can't afford money for tutorials for them you are creating platform with your channel to learn technologies.
Thank you so much for creating these kind of videos.
Thanks. Yeah I do them for people who really want to learn the whole process of real-world code. It isn't designed as a quick tip or learn this little bit, its more of a full training course :)
This is awesome once again. I am soo excited for the future videos. Finally someone capable of explaining guiding us all the way through. Thank you man for sharing this with us ;)
Thanks. I'll try and get the next video done tonight if possible, to get into the ViewModel stuff and the DNA framework and make a real start on the chat app after that video
thanks a lot, could you please explain how you added scrollbar to your treeview??
+Michael Bear just wrap it into a scroll viewer
yes!
Totally agree!!! Great quality video and teaching!
Hello! I am a native spanish speaker and I need to thank you because your tutorials are amazing and you speak pretty well
Extremely nicely done video. And I like that you didn’t cut out your debugging and thinking aloud because that’s what all programmers do and it’s important to keep. You and your channel are one of a kind!
One of the most informative and instructive tuts that i've ever seen for WPF and bindings! great work ... thanks
It's a pleasure to both watch you code and listen to your lovely Yorkshire lilt! Thanks so much these videos are amazing.
After first tutorial this one is kinda harder but thats the reason i like it even more!
Great video!
If your image does not want to load from the folder just right-click it go to Properties and set Build Action to Resources.
You just saved my life. Thanks a lot :D
still doesn't show, what should i do then?
Thank you!
Also had to make mine 'Copy Always' which got it working
I am so impressed... I looked at your youtube home page and discovered you have tutorials on WPF, C# AND!!!!!! SOLIDWORKS API.... I am blown away...because... I love the way you tutor and NOW you can tutor me in the 3 subjects I need most... WPF, C# and Solidworks Api.... WTF!!!
Awesome. Yeah the SolidDNA stuff is fun I want to get back to doing more of it, it is just the WPF fans took over and it was way more popular. I'll do more SolidDNA shortly though
I comment videos very rare, but yours are one of the best on youtube programming tutorials. Thank you so much!
Serhii Berkovskyi no problem glad you like them
Outstanding tutorial series, and perfect timing as I'm having to revisit WPF after many years away from it.
just for anybody that needs it, i find it easier to create a binding like that if i head over to the image properties on the right side, search for Source, click on the little square, select Create Binding and go from there, no worries about curly brackets.
Thank you very much for all these tutorials, they're the best and most in-depth explanations of WPF and C# I've found on youtube. Great teacher! I'm going to start thinking of code in my head in an English accent now, which is fine by me!
Haha cool
Why soo many useless comments? 'Create a list for directories' that's literally what the codes says. But next to that, great tutorial. Getting to know the binding better and better. Thanks for that!
I love how you explained EVERYTHING ❤❤❤
Thanks :)
This is amazing. So worth the 1 hour of watching. I learned more in an hour of watching this than I did in 3 hours of parsing through the wordy, verbose Microsoft Documentation.
Glad I could help
I've finally decided to switch form WF to WPF. Thank you for your work!
Thanks so much for taking the time to make these acceptional tutorials! I have already learned so much from the first video alone.
I used to be scared of WPF and your videos are helping me to get over that fear! I owe you a biiiig bucket of coffee! Thanks a lot my friend! :-)
thanks
*Watched first episode
"Alright, this looks fairly easy, let's learn it"
*Watched this one
"What the fuck!?"
bnfgh123 this series is for people who know c# and programming but not WPF. So it may be hard to follow if you don't already know the main programming language and concepts already. I plan to make a true beginners WPF series shortly
Well, I'm currently learning C#, but the main problem is, that I can't really find the right order in which I should learn the different features and when I stumble upon anything about C# I just try and see, whether I can or cannot comprehend. Wish that I could find some reasonably paced, ordered and complete series about the language. But judging by the first video, this series on WPF is one of the best tutorials I found so far, I'll just have to do a little bit more training on C# itself and then come back.
I have the C# series too, and I'll try to add more to that shortly to fill in the gaps
AngelSix Honestly the most struggling part I have with WPF is the data binding part. I look forward to your beginner series as I hope it covers that in more detail.
Yea, After watching his first video, then coming to this I was confused as to who his audience was. At first it did seem like total noobs.. but after watching this, it's still fairly confusing, because he explains some things like who would for a noob, but then others he explains them with little context, or as he would for someone with much more experience.
This video expects knowledge of C#, OOP, and MVC Design Pattern. If you don't know at least all 3 of these, you'l prob get lost watching this. At the very least, youl have trouble understanding certain things.
Like this series so far :)
I found another way to create the tree-view item and it's path and header.
You could change:
//Create a new item for it
var item = new TreeViewItem();
//Set header and path
item.Header = drive;
item.Tag = drive;
to
var item = new TreeViewItem {Header = drive, Tag = drive};
Both works for me :)
Just two ways to do the same thing :)
I cannot get image of drive or file in treeview, though i compared my codes and yours are the same. What would be a problem?
You making life easy, wanted to get your name and follow you. thanks for this man.
You are awesome for (and awesome at) making these videos. The whole integrated nature of WPF has been a hurdle for me as I am not a web or desktop/GUI developer (I'm an embedded guy making a new tool for work). Seeing the real working examples with all of the moving parts has really helped me grok WPF. Thank you.
Really glad I could help :)
I learn quite alot from this video.
I learn:
1. How to populate TreeView on Window_Loaded event which is seem like good place to do it.
2. How to define template of TreeViewItem interface design.
3. That TreeViewItem has Header as primary data and Tag as secondary data (or as additional placeholder).
4. Using #region to tidy up.
5. Attaching event handler to event via delegate operator.
6. Programming skill on when to break and inspect data before continue with detail coding to ensure intended method.
7. Binding including using of Path token and default path.
8. That I can bind image source, visibility property (or other non-string properties I reckon) to a string data using Converter.
9. Also if string data to be used as source change on condition, using Converter is also ideal.
10. How to create a converter class which inherit from IValueConverter.
The above is typically seen in everywhere which include MSDN, example, questions in stack overflow but I'm just not proficient to understand it.
Now it seem clear, at least at basic.
However I seem could not understand the RelativeSource token.
Question 1:
I could not understand why a subitem, or subsubitem or subsubsubitem (item here is referring to TreeViewItem) would required a RelativeSource to an ancestor (which the ancestor type is also a TreeViewItem).
Each TreeViewItem has its Tag field, store with it full path which should be used to determine what type of image to be used in Converter.
Also, if the ancestor type is a TreeViewItem, what happen to the top items which define the drive (rather than folder and file)? I taken that the top items have TreeView as ancestor (instead of TreeViewItem).
So I'm confused, could not relate and understand the used of RelativeSource in this case.
Would you explained when you able?
Update to Question 1:
I found an article in MSDN.
So a TreeViewItem (a HeaderedItemsControl Type) has a "Header" object and an "Items" collection.
FolderView has a typical design of showing One Image and One String.
So we choose to defined such design in the Header object using Header Template which the design scheme will repeating for each TreeViewItem automatically.
Thus because the "Tag" field we needed for Converter is owned by the TreeViewItem (parent of the Header), we need to access the ancestor and get the 'Tag" field (via "Path" token) which is passed to the Converter.
In addition, the collection of Item is also filled with TreeViewItem with the same design/scheme.
I hope the above understanding is correct.
Question 2:
in Tutorial 1, you always used "this" keyword to access the UI elements in the code such as "this.WeldCheckbox", "this.LengthText" and "this.FinishDropdown" even the code are from the same class of MainWindow.
However it was not in this Tutorial where all UI elements were accessed/written directly without "this" keyword.
Which is the good practice to follow?
I hope you are not bored with my questions.
I'm kinda hopeless. HA-HA.
Thanks mate.
I'm only at Tutorial #2 but this is awesome!
Yes question 1 you got correct yourself.
Question 2. I preferred typing this. for a lot of things, just so it was obvious to the coder (me/you) that the item we are accessing is contained in this class, and not a static item. However, I have since changed my preference and now never use the this. prefix. It is purely your own preference.
I got "corrected" myself - several times. HAHAHA.
I've been editing the above post every time I understand some bit.
Thanks for checking - that help my confident.
I moving on with the next tutorial.
Holy shit this is hard on beginners, I feel I need 10 videos before this one. I then skipped to the 4th video in the playlist and everything was going well until you brought piece of code from this video, the customized look of the window. So now I have to pull through this one even though I don't understand half of the stuff. It would maybe be easier if you didn't include these dummy items after you presented us with the idea of how treeview should look with dummy items, I feel kinda frustrated.
However your other videos are 10/10, from this playlist and other ones (I just wish this video didn't exist specifically) . You've helped a lot, big thanks! Subed!
Yeah WPF and these principles are hard to grasp for sure. Glad I could help though
Thanks so much for this tutorial! Very informative. The only problem I had was my images not loading. I had to click their properties and set the Build Action to 'Resource' and below that chose 'Copy Always'.
Thanks SO MUCH for this comment ... I was encountering the same problem, but your tip made everything work perfectly!
@@derekfelton1668 You are very welcome 😃
you're a life saver tiffany
Very helpful - thanks. I can see why it is considered a steep learning curve though.
So far 2 very good videos on WPF, this is the best stuff I have come across. Now looking forward to more hardcore stuff like data binding, viewmodel, UIEvents, ICommands, PropertyChanged Events n more. Thank you
Yep that comes in the videos you will watch after the next few :) Hope you enjoy
Two videos into the wpf playlist and I am loving it so far. A great refresher and learned a thing or two in this video as well! Cheers!
I can't believe you exist. You're like a God of Code.
Thanks :)
Thor, Loki and Cody: The Dark Code
These videos are pure Gold!
Thanks a lot for putting in so much effort!
These really are excellent videos, I like for seeing how you think through the app creation. Thanks!
Thanks, yes hopefully you will learn a lot from them
+AngelSIx you are just amazing. Than you for representing the non Indian community in such an awsome way. I don't mean to offend anyone, but hearing clear english allows me to focus on learning instead of deciphering what they meant to say :)
Your content is umbelivable, you go fast to keep the lengh of the video to a minimum, awsome, awsome, awsome. Subscribed.
Glad I could help and glad you like the videos!
This was very easy to follow and very appreciated tutorial ! God bless you for the time spent on sharing this in such a clear manner ! :) Thanks.
Great tutorial, you explained bindings fairly well especially since its not an easy topic to explain. I'm looking forward to your MVVM video.
Thanks
Great video! Thank you so much for teaching. It was exactly exactly what I was looking for. So clear step by step guidance bringing to tangible ( visible :) result. And thanks for GitHub source!
Just stepped over this. Magnificient content. Clean speech, solid and detailed explaination. 10/5 Stars :).
I would like to thank you for making these videos! I am sure it helped, and will help, a lot of people with WPF applications!
Your welcome
Really engaging video. Great example to get me started on WPF. IThanks for sharing.
Glad you enjoyed it!
This works for me where I am currently. Job well done.... Look forward to the next one.
Excellent!! Thank you very much for the time and care you put into this clear instruction.
These Videos are awesome. I especially like how well explained everything is. Keep up the good work
Thanks glad you like them
At about 48:20 you say something that made the hair on the back of my neck stand up! You started talking about value converters and bindings and said something along the lines of - "This is just the simple stuff. We'll get into the more complicated things in later videos." At this point, however, my brain's already oversaturated and I know I will not even remember how to do a fraction of what you have already shown, and this is the "simple" stuff. I think I peed myself, a little bit.
Also getting relative binds and going back up the tree to get the tag you mention that this is "messy" and "ugly" and here was the scary line again, you say - "and there are so many ways to get bindings...and you just get used to it.". Well, this is the overall problem learning to work within already super complication APIs. It is true there are many ways to do the same thing. But unfortunately, that means there are also many ways to try to get bindings that end up being a mish-mash of all the possible ways to do it right, that end up being WRONG!
So you end up running down dead-end rabbit holes until finally, all you want to do is go watch dogs surfing on youtube!
Really thorough training, thanks for your existence
Your welcome
Fantastic series, thanks AngelSix, we're really enjoying it!
My drive images were not showing up also. I googled, which indicated to set the drive image file property Build Action to Resources. That worked for some people but did not work for me. I had to set the Build Action property to Content and it was also recommended to Copy to Output Directory to Copy if newer. Setting those worked for my drive image.
Thanks!
Thoroughly enjoyed the learning, Took me more than 3 Hours to reach 42:53 and then you did something with either delete or cut paste .. that messed up everything. I just couldn't follow what you did between those 20 seconds. Frustrating to restart from scratch. Since you are the best, I will.
I am new in wpf and I am learning from this website
Another fantastic tutorial, I love the depth of the video, and yet I can grasp the concepts fairly easily :) thanks a lot for the effort,
greetings again from rainy scotland :)
Thanks. It gets a little harder as you go if you don't already know certain coding concepts as it's not a beginners series as in beginners with no programming experience but if you struggle going forward I plan to do some more basic WPF series in the future that take things slower. Sounds like you are managing well so far anyway!
I think the learning curve is perfect for someone with some coding experience, as myself, and I think it's great that you introduce more advanced concepts already :) already on the 3rd video today and still enjoying it :D
Cool. I better get recording more :)
I really like the way you explain...please keep doing great videos!!!
Also in 2021 This was a usefull tutorial, you I can rebuild it to get my treeview from a database, so this is a good start to present it as a treee
Very cool, thank you. Helping me refresh and take to next level of WPF. Grabbing related image files from github. If you need any help with any animation, 3d modeling, let me know. You rock brother.
Cool thanks and will do
hey Luke thanks for the videos, they are the best on youtube!
You are the best!!! Thank you!!!!
Thanks. Glad you are liking the videos
Thanks a lot, cool video! 40 more hours to go! :)
Have fun!
Everytime I run the program and I put the breakpoint at "var item = (TreeViewItem)sender:", I hover over "item" and keep getting "null". As a result, it throws an exception. I have been trying for a long time to troubleshoot that issue , but to no avail. Please help!!
Your programming practices are Awesome.
Thanks
Minus that copy paste part, yeah
Just for the sake of fun: "physical code" 1:13:20
Your a king! so many good tips and small tricks in this tutorial very helpfull! sometimes a bit to much information for newcommers i can belive (maybe expand a bit on recursion it can be a hard topic to swallow imo.) But very usefull thx alot!
Thanks. Yes these are not really beginner tutorials in general, simply beginners to WPF. I definitely plan to make more beginner C# videos though
Brilliant videos but I have a problem with a System.IO.IO Exception, I have checked the image variable in debug and it is showing Images/folder-closed. the exception is it cannot find the folder it is looking for images/folder-closed. i have checked all the code but cannot see where it get image instead of Image need to sort before i move onto next video hope you can point me in the right direction
Hi, awesome tutorial but.
The image "drive.png" is displayed correctly in the XAML designer but when running the program it is not displayed.
Try changing the path to the full location - worked for me...
I'm sorry, but at 16:30 i've got no images of drives, i rewatched videos and redo the code about 5 times and i've got the same, don''t you know why? Also, when i run the program at 9:40 i have images. ( sorry for my English,i know it's pretty bad)
"... i hope you enjoyed this". i didn't understand 2nd half(where using converter to change image). but yes, i enjoyed this. i might get after i'll re-watch it few more times. this is far better than those "for dummies" videos where they just copying/repeating the stuff from the getting started page of the subject.
Glad I could help. If you don't get it after a few more watches, I'll perhaps do a vide specifically on converters
Wouu , i really understand all you say. Unbelievable !
At the part where Path.GetDirectoryName doesn't work, you can also use Path.GetFileName instead
Just a heads up, you can actually just return a string from the value converter. You don't need to make a Bitmap image.
Really? The value it is expecting is a bitmap. The only reason you can type a string in xaml is because there is an inbuild string to resource converter that gets called, but if you use a custom provider, and return a string, it will not then go to the string to bitmap converter... at least last time I checked it did not?
Yea I think they changed it. It's working in my project. Can send you the source if you want. Makes it a bit simpler :D
Ok cool no it should be easy enough I will try and remember to change that in the future videos
Thank you! It was exactly what I was needed :)
Glad I could help
Spent a frustrating hour or so trying to figure out why the images were not being displayed. Finally found a note that the Properties of the embedded images after being imported have to set with the properties "Build Action" = "Content" and "Copy to Output Directories" = "Copy if Newer" but that didn't work. The only way I could get it to work was with a fully qualified path. I'm using VS19 with .Net Core 3.1. Switched to use .Net Core 5.0. No change using a relative path.
ARG!! Moved the project to a different directory nearer the drive root and retried again thinking that the resolved path exceeded MS 260 char limit. Seemed to work. Then did it again and verified that the resolved path was less than 260 but it didn't work. WTF.
Couldn't get pack: to work and properly resolve the execution path to the png files. Had to resort to the following.
// Find out where the code base is executing in order to get to the Images subdirectory
string exePath = System.IO.Path.GetDirectoryName(
System.Reflection.Assembly.GetEntryAssembly().Location);
// map the subdirectory and drive image name for conversion
BitmapImage bitmapImage =
new BitmapImage(new Uri($"{exePath}/Images/{image}"));
I really like your tutorials and work through them following along step by step in visual studio and pausing to research when I don't quite understand or like above something didn't seem to work.
i'm using .net core 3.1 and it workd just by a=changing events to "Build Action" = "Content" and "Copy to Output Directories" = "Copy if Newer" .
Amazing tutorial! For me, Is difficult the converter. But great tutorial. You forgot make the system for folder open. ;)
You can use Path.GetFileName(dirPath) instead of Path.GetdirectoryName(dirPath)
Correct
I'm pretty late to the 🎉, Although the video is so explicit, I couldn't run even the first dummy execution.😢 this is because the IDE shows: The member "HeaderTemplate" is not recognized or is not accessible and it doesn't allow me to run the code, I am working with Microsoft Visual Studio 2022, please if anybody could give a glue why this is happening?
you are making this look easy !
Thank you :)
I stumbled upon your videos when I was researching WPF .net core version.
I tried the things I saw on the video and much to my surprise, I saw that the WPF .net core version is no where near ready to be used as production program. I converted my WPF .net core to WPF .net framework.
Good to know. I think it's about 10 months from production myself
instead of helper method to get last direcory name you can use new DirectoryInfo(directoryPath).Name
This video is extremely good. Thanks for your effort. But, as a developer who is coming from Winform, ImageSource binding was too complicated. ValueConverter was a little bit more understandable. As a result, I liked much your presentation.
Thank you so much for these tutorials, really helpful.
Your welcome
Great tutorial. Thanks for posting.
This is simply beautiful.
Thanks
I can add expanded event with an implicit way using ItemTreeView.Expaned in xaml; then using eventrouting (e) but I don't understand what is routedeventargs ? is that like a traveled event through all the treeitems?
Thank for Git. I love you!!!)))
Welcome!
Thankyou so much for sharing your knowledge with us.
+Ghalib Mustafa your welcome. Glad it's useful
I can't find the IValueConverter => System.Windows.Data in .NET CORE 3.1 (SOLVED: ok I had to add Presentation.Framework from nuget, now its working).
Gracias AngelSix muy emocionado con el curso......, en visual studio 2019 no se ve lo iconos
Does anyone have any idea why the images show up at design time, but don't show up when I run. Even with the test StackPanel at the beginning (which sits outside the TreeView), when I add the image, it shows up on the layout window, but when I run, the text shows up, but no image. Likewise, when I set the style up in the TreeView and programmatically add the logical drives (in my case, just one) I get the text ("Some folder"), but no image.
This frustration aside, AngelSix, your delivery is great. I think I'm going to love this series.
Found it: Select the images in the Solution Explorer, choose properties, set Build Action to Resource
@@davidjennings6293 Thank you!! I was tearing my hair out!
I like your presentation
Please, do a video on WPF and MVVM.
Hi AngelSix, it's a very good video. Thank you for sharing. But u do forgot to use folder-open.png:-)
thanks... yeah I left that as a challenge to viewers :)
Thank you very much for your videos!!! It is very good tutorial.
Thanks and your welcome
Man, you're really good at this 👍
Thanks
Thanks very much for the very well explained video
Your welcome
Great work, this video was super helpful!
Glad it was :)
16:30 Images couldn't appears?? any suggestion?
Note: when I put an Image into another it appears.
Try Marcel Kelm's comment above yours atm: "Mention: VS2019 doesn't set the build action for images by default, so if you want to use images [...] you have to set the build action from "none" to "resource" for this image [...]"
Same for me. Even if i set build action to "resource" it only works encapsulating inside a StackPanel.
Using property bindings in XAML (instead of programatically changing properties in C#) must be related to proper MVVM practice, is that right? Is this done only to increase usability of the business logic among different UI setups?
Thanks so much for the intensive training materials, most are too slow and generic to be worth the time.
Since leaving this comment, I've rebuilt some business apps and I love using NotifyPropertyChange! Set it and forget it, I haven't touched my UI in days! Although this is a concept from the next video :)
MVVM has two benefits. Firstly it forces you to not hard tie your view logic (like a button should perform an action when clicked) to the actual UI itself. Instead the logic is in the view agnostic view model. This allows for unit testing and changing or using multiple UIs with very little change. It then also forces you to think about your UI as just that, no concern for code behind, just bind to models and react according to models. That makes any significant UI element/event expressable and testable in the view model. Finally, it allows for lack of concern about the UI thread in the view model. Just change the properties, and then when the UI thats hooked into the notify events, it handles jumping back to the UI thread in one place, instead of all over your view model code.
I am trying to expand the folder open. I added the collapsed event to the item and subitems of the folders, something interesting happened: When i tried to collapse the subitem, the collapse event of it triggered, but then, the parent item of it also triggered the collapse event, it's bothered me for a long time.
Noice watched it all :D
best C# gui tutorial!
Thanks
I really like your explanation
MaD Mover thanks