C# WPF UI Tutorials: 02 - TreeViews and Value Converters

Поділитися
Вставка
  • Опубліковано 7 вер 2024

КОМЕНТАРІ • 564

  • @AngelSix
    @AngelSix  5 років тому +6

    My Setup & Recommendations www.amazon.co.uk/shop/angelsix

  • @runtimeterror4027
    @runtimeterror4027 3 роки тому +53

    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.

  • @marcelkelm3234
    @marcelkelm3234 4 роки тому +77

    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!

    • @TheDuerden
      @TheDuerden 4 роки тому +2

      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.

    • @RugbugRedfern
      @RugbugRedfern 3 роки тому +4

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

    • @miriadetasy
      @miriadetasy 3 роки тому

      Thanks

    • @anthonykim5561
      @anthonykim5561 3 роки тому +1

      Thank God you saved my day.

    • @TheStylergirly
      @TheStylergirly 2 роки тому

      Thank you

  • @raviprasad2379
    @raviprasad2379 7 років тому +78

    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.

    • @AngelSix
      @AngelSix  7 років тому +24

      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 :)

  • @GonzoGonschi
    @GonzoGonschi 7 років тому +102

    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 ;)

    • @AngelSix
      @AngelSix  7 років тому +9

      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

    • @michaelbear3581
      @michaelbear3581 7 років тому +1

      thanks a lot, could you please explain how you added scrollbar to your treeview??

    • @AngelSix
      @AngelSix  7 років тому +1

      +Michael Bear just wrap it into a scroll viewer

    • @timomuller9392
      @timomuller9392 6 років тому

      yes!

    • @Thiagocords08
      @Thiagocords08 6 років тому

      Totally agree!!! Great quality video and teaching!

  • @AlejandroHernandez-hx9mh
    @AlejandroHernandez-hx9mh 5 років тому +2

    Hello! I am a native spanish speaker and I need to thank you because your tutorials are amazing and you speak pretty well

  • @varunsingh1748
    @varunsingh1748 4 роки тому +2

    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!

  • @sinajahromi3534
    @sinajahromi3534 5 років тому +7

    One of the most informative and instructive tuts that i've ever seen for WPF and bindings! great work ... thanks

  • @starmole5000
    @starmole5000 5 років тому +3

    It's a pleasure to both watch you code and listen to your lovely Yorkshire lilt! Thanks so much these videos are amazing.

  • @vu5700
    @vu5700 3 роки тому +2

    After first tutorial this one is kinda harder but thats the reason i like it even more!
    Great video!

  • @Trust_Me_Im_An_Engineer
    @Trust_Me_Im_An_Engineer 4 роки тому +10

    If your image does not want to load from the folder just right-click it go to Properties and set Build Action to Resources.

    • @lightyagami3650
      @lightyagami3650 4 роки тому +1

      You just saved my life. Thanks a lot :D

    • @matteoblasoni8726
      @matteoblasoni8726 3 роки тому

      still doesn't show, what should i do then?

    • @Tiffypox
      @Tiffypox 2 роки тому

      Thank you!

    • @Tiffypox
      @Tiffypox 2 роки тому

      Also had to make mine 'Copy Always' which got it working

  • @johnpelitidis6297
    @johnpelitidis6297 7 років тому

    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!!!

    • @AngelSix
      @AngelSix  7 років тому

      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

  • @serhiiberkovskyi9109
    @serhiiberkovskyi9109 7 років тому +2

    I comment videos very rare, but yours are one of the best on youtube programming tutorials. Thank you so much!

    • @AngelSix
      @AngelSix  7 років тому +1

      Serhii Berkovskyi no problem glad you like them

  • @vargonian
    @vargonian 5 років тому +4

    Outstanding tutorial series, and perfect timing as I'm having to revisit WPF after many years away from it.

  • @armandoferreira1346
    @armandoferreira1346 6 років тому +2

    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.

  • @fpvm4k3r
    @fpvm4k3r 4 роки тому +1

    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!

  • @jannickbreunis
    @jannickbreunis 3 роки тому

    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!

  • @reycelandes7493
    @reycelandes7493 6 років тому +6

    I love how you explained EVERYTHING ❤❤❤

  • @k4kfh
    @k4kfh 5 років тому

    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.

    • @AngelSix
      @AngelSix  5 років тому

      Glad I could help

  • @Living4Memes
    @Living4Memes Рік тому

    I've finally decided to switch form WF to WPF. Thank you for your work!

  • @Jackaldev
    @Jackaldev 4 роки тому +1

    Thanks so much for taking the time to make these acceptional tutorials! I have already learned so much from the first video alone.

  • @easyhealtheducation
    @easyhealtheducation 7 років тому

    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! :-)

  • @bnfgh123
    @bnfgh123 7 років тому +45

    *Watched first episode
    "Alright, this looks fairly easy, let's learn it"
    *Watched this one
    "What the fuck!?"

    • @AngelSix
      @AngelSix  7 років тому +6

      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

    • @bnfgh123
      @bnfgh123 7 років тому +2

      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
      @AngelSix  7 років тому +2

      I have the C# series too, and I'll try to add more to that shortly to fill in the gaps

    • @Cmppayne26542
      @Cmppayne26542 7 років тому +2

      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.

    • @jscix
      @jscix 6 років тому +1

      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.

  • @sobaver
    @sobaver 4 роки тому +1

    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 :)

  • @hoangthongdinh8074
    @hoangthongdinh8074 3 роки тому +3

    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?

  • @petermankge6921
    @petermankge6921 2 роки тому

    You making life easy, wanted to get your name and follow you. thanks for this man.

  • @neniugrava
    @neniugrava 6 років тому

    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.

    • @AngelSix
      @AngelSix  6 років тому

      Really glad I could help :)

  • @tunAliUTube
    @tunAliUTube 7 років тому

    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!

    • @AngelSix
      @AngelSix  7 років тому +2

      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.

    • @tunAliUTube
      @tunAliUTube 7 років тому

      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.

  • @Tydides64
    @Tydides64 5 років тому +3

    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!

    • @AngelSix
      @AngelSix  5 років тому

      Yeah WPF and these principles are hard to grasp for sure. Glad I could help though

  • @Tiffypox
    @Tiffypox 2 роки тому +2

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

    • @derekfelton1668
      @derekfelton1668 2 роки тому +2

      Thanks SO MUCH for this comment ... I was encountering the same problem, but your tip made everything work perfectly!

    • @Tiffypox
      @Tiffypox 2 роки тому +1

      @@derekfelton1668 You are very welcome 😃

    • @sashamugs
      @sashamugs 2 роки тому

      you're a life saver tiffany

  • @myaloy
    @myaloy 3 роки тому +1

    Very helpful - thanks. I can see why it is considered a steep learning curve though.

  • @saikirangattu2924
    @saikirangattu2924 6 років тому

    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
      @AngelSix  6 років тому +1

      Yep that comes in the videos you will watch after the next few :) Hope you enjoy

  • @jmontyy
    @jmontyy 5 років тому

    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!

  • @electrobrain6193
    @electrobrain6193 7 років тому +21

    I can't believe you exist. You're like a God of Code.

    • @AngelSix
      @AngelSix  7 років тому +1

      Thanks :)

    • @watherby29
      @watherby29 5 років тому

      Thor, Loki and Cody: The Dark Code

  • @michelbrodda4438
    @michelbrodda4438 2 роки тому

    These videos are pure Gold!
    Thanks a lot for putting in so much effort!

  • @nigelfelgate1254
    @nigelfelgate1254 5 років тому

    These really are excellent videos, I like for seeing how you think through the app creation. Thanks!

    • @AngelSix
      @AngelSix  5 років тому

      Thanks, yes hopefully you will learn a lot from them

  • @dumitrudan608
    @dumitrudan608 4 роки тому

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

    • @AngelSix
      @AngelSix  4 роки тому

      Glad I could help and glad you like the videos!

  • @zpinacz
    @zpinacz 2 роки тому

    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.

  • @riekumar6999
    @riekumar6999 6 років тому

    Great tutorial, you explained bindings fairly well especially since its not an easy topic to explain. I'm looking forward to your MVVM video.

  • @dmitrymelnikov4918
    @dmitrymelnikov4918 4 роки тому +1

    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!

  • @NoxaDreshar
    @NoxaDreshar 3 роки тому

    Just stepped over this. Magnificient content. Clean speech, solid and detailed explaination. 10/5 Stars :).

  • @zhupdhk
    @zhupdhk 6 років тому

    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!

  • @351yt
    @351yt 4 роки тому

    Really engaging video. Great example to get me started on WPF. IThanks for sharing.

    • @AngelSix
      @AngelSix  4 роки тому

      Glad you enjoyed it!

  • @bq4069
    @bq4069 5 років тому

    This works for me where I am currently. Job well done.... Look forward to the next one.

  • @edcantrell5369
    @edcantrell5369 4 роки тому

    Excellent!! Thank you very much for the time and care you put into this clear instruction.

  • @praveendesilva464
    @praveendesilva464 6 років тому

    These Videos are awesome. I especially like how well explained everything is. Keep up the good work

    • @AngelSix
      @AngelSix  6 років тому

      Thanks glad you like them

  • @ctbram0627
    @ctbram0627 5 років тому

    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!

  • @lordwilliamsr
    @lordwilliamsr 5 років тому

    Really thorough training, thanks for your existence

  • @preciseestimatingltd2579
    @preciseestimatingltd2579 4 роки тому

    Fantastic series, thanks AngelSix, we're really enjoying it!

  • @caseya8809
    @caseya8809 Рік тому +2

    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.

  • @johnagapi5970
    @johnagapi5970 7 років тому +1

    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.

  • @creatorsunilverma1290
    @creatorsunilverma1290 7 років тому

    I am new in wpf and I am learning from this website

  • @SebastianTheNovice
    @SebastianTheNovice 7 років тому

    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 :)

    • @AngelSix
      @AngelSix  7 років тому +1

      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!

    • @SebastianTheNovice
      @SebastianTheNovice 7 років тому

      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

    • @AngelSix
      @AngelSix  7 років тому +1

      Cool. I better get recording more :)

  • @tiberiuscoman9525
    @tiberiuscoman9525 4 роки тому

    I really like the way you explain...please keep doing great videos!!!

  • @HerbertNijkamp
    @HerbertNijkamp 3 роки тому

    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

  • @gear1100
    @gear1100 6 років тому

    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.

    • @AngelSix
      @AngelSix  6 років тому

      Cool thanks and will do

  • @AndrewEG
    @AndrewEG 10 місяців тому

    hey Luke thanks for the videos, they are the best on youtube!

  • @stepan7396
    @stepan7396 7 років тому +24

    You are the best!!! Thank you!!!!

    • @AngelSix
      @AngelSix  7 років тому +4

      Thanks. Glad you are liking the videos

  • @tomsupis8724
    @tomsupis8724 4 роки тому +1

    Thanks a lot, cool video! 40 more hours to go! :)

  • @vishrutchandra3745
    @vishrutchandra3745 2 роки тому

    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!!

  • @shubhambahre9021
    @shubhambahre9021 6 років тому +3

    Your programming practices are Awesome.

  • @Luca-sz5uy
    @Luca-sz5uy 5 років тому +5

    Just for the sake of fun: "physical code" 1:13:20

  • @jojomondag
    @jojomondag 7 років тому

    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!

    • @AngelSix
      @AngelSix  7 років тому +1

      Thanks. Yes these are not really beginner tutorials in general, simply beginners to WPF. I definitely plan to make more beginner C# videos though

  • @obione8933
    @obione8933 2 роки тому +1

    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

  • @ImSplashGG
    @ImSplashGG 3 роки тому +1

    Hi, awesome tutorial but.
    The image "drive.png" is displayed correctly in the XAML designer but when running the program it is not displayed.

    • @ff0x
      @ff0x 3 роки тому +1

      Try changing the path to the full location - worked for me...

  • @vvalentinee168
    @vvalentinee168 4 роки тому

    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)

  • @munkhn73
    @munkhn73 5 років тому

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

    • @AngelSix
      @AngelSix  5 років тому +1

      Glad I could help. If you don't get it after a few more watches, I'll perhaps do a vide specifically on converters

  • @ymts_vladyslav3707
    @ymts_vladyslav3707 3 роки тому

    Wouu , i really understand all you say. Unbelievable !

  • @Ethorbit
    @Ethorbit 3 роки тому +1

    At the part where Path.GetDirectoryName doesn't work, you can also use Path.GetFileName instead

  • @georgeblm9983
    @georgeblm9983 6 років тому +1

    Just a heads up, you can actually just return a string from the value converter. You don't need to make a Bitmap image.

    • @AngelSix
      @AngelSix  6 років тому +1

      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?

    • @georgeblm9983
      @georgeblm9983 6 років тому

      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

    • @AngelSix
      @AngelSix  6 років тому

      Ok cool no it should be easy enough I will try and remember to change that in the future videos

  • @AzizjanAyupov_leo
    @AzizjanAyupov_leo 4 роки тому +1

    Thank you! It was exactly what I was needed :)

  • @kentswan3230
    @kentswan3230 3 роки тому

    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.

    • @ahmedtalaat27
      @ahmedtalaat27 3 роки тому

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

  • @tomas120
    @tomas120 7 років тому +1

    Amazing tutorial! For me, Is difficult the converter. But great tutorial. You forgot make the system for folder open. ;)

  • @dumitrudan608
    @dumitrudan608 4 роки тому

    You can use Path.GetFileName(dirPath) instead of Path.GetdirectoryName(dirPath)

  • @willianandress1473
    @willianandress1473 10 місяців тому

    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?

  • @salmansaleh1
    @salmansaleh1 3 роки тому

    you are making this look easy !
    Thank you :)

  • @HenrikKleist
    @HenrikKleist 4 роки тому

    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.

    • @AngelSix
      @AngelSix  4 роки тому

      Good to know. I think it's about 10 months from production myself

  • @gekk1985
    @gekk1985 4 роки тому

    instead of helper method to get last direcory name you can use new DirectoryInfo(directoryPath).Name

  • @hamitenes5573
    @hamitenes5573 2 роки тому

    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.

  • @usmanahmed8836
    @usmanahmed8836 4 роки тому

    Thank you so much for these tutorials, really helpful.

  • @pmayfield5020
    @pmayfield5020 3 роки тому

    Great tutorial. Thanks for posting.

  • @pornicar85
    @pornicar85 6 років тому

    This is simply beautiful.

  • @ahmedtalaat27
    @ahmedtalaat27 3 роки тому

    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?

  • @toha152
    @toha152 4 роки тому +1

    Thank for Git. I love you!!!)))

  • @GhalibMustafa
    @GhalibMustafa 7 років тому

    Thankyou so much for sharing your knowledge with us.

    • @AngelSix
      @AngelSix  7 років тому

      +Ghalib Mustafa your welcome. Glad it's useful

  • @Marko-the-Beast-Master
    @Marko-the-Beast-Master 4 роки тому

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

  • @josbexerr5166
    @josbexerr5166 4 роки тому +1

    Gracias AngelSix muy emocionado con el curso......, en visual studio 2019 no se ve lo iconos

  • @davidjennings6293
    @davidjennings6293 Рік тому

    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.

    • @davidjennings6293
      @davidjennings6293 Рік тому

      Found it: Select the images in the Solution Explorer, choose properties, set Build Action to Resource

    • @ericgrieser7628
      @ericgrieser7628 Рік тому

      @@davidjennings6293 Thank you!! I was tearing my hair out!

  • @Tall-Cool-Drink
    @Tall-Cool-Drink 3 роки тому

    I like your presentation
    Please, do a video on WPF and MVVM.

  • @lzw1015bean
    @lzw1015bean 6 років тому +1

    Hi AngelSix, it's a very good video. Thank you for sharing. But u do forgot to use folder-open.png:-)

    • @AngelSix
      @AngelSix  6 років тому +1

      thanks... yeah I left that as a challenge to viewers :)

  • @YadigarM
    @YadigarM 5 років тому

    Thank you very much for your videos!!! It is very good tutorial.

    • @AngelSix
      @AngelSix  5 років тому

      Thanks and your welcome

  • @maxalmonte14
    @maxalmonte14 5 років тому

    Man, you're really good at this 👍

  • @reinotran
    @reinotran 5 років тому

    Thanks very much for the very well explained video

  • @chrisanderson687
    @chrisanderson687 6 років тому

    Great work, this video was super helpful!

  • @sal96ali
    @sal96ali 3 роки тому

    16:30 Images couldn't appears?? any suggestion?
    Note: when I put an Image into another it appears.

    • @notsoful
      @notsoful 3 роки тому +1

      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 [...]"

    • @enigmatizando4090
      @enigmatizando4090 7 місяців тому

      Same for me. Even if i set build action to "resource" it only works encapsulating inside a StackPanel.

  • @isaacweymouth1700
    @isaacweymouth1700 4 роки тому

    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.

    • @isaacweymouth1700
      @isaacweymouth1700 4 роки тому

      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 :)

    • @AngelSix
      @AngelSix  4 роки тому

      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.

  • @zxhnear7800
    @zxhnear7800 7 років тому

    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.

  • @Poyser1911
    @Poyser1911 7 років тому +7

    Noice watched it all :D

  • @formygoddess1002
    @formygoddess1002 6 років тому

    best C# gui tutorial!

  • @bloodraven2.036
    @bloodraven2.036 7 років тому

    I really like your explanation

    • @AngelSix
      @AngelSix  7 років тому

      MaD Mover thanks