Тёмный

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

AngelSix
Подписаться 61 тыс.
Просмотров 336 тыс.
50% 1

Опубликовано:

 

30 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 564   
@AngelSix
@AngelSix 5 лет назад
My Setup & Recommendations www.amazon.co.uk/shop/angelsix
@marcelkelm3234
@marcelkelm3234 4 года назад
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 года назад
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 года назад
@@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 года назад
Thank God you saved my day.
@TheStylergirly
@TheStylergirly 2 года назад
Thank you
@runtimeterror4027
@runtimeterror4027 4 года назад
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.
@hoangthongdinh8074
@hoangthongdinh8074 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?
@raviprasad2379
@raviprasad2379 7 лет назад
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 лет назад
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 лет назад
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 лет назад
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 лет назад
thanks a lot, could you please explain how you added scrollbar to your treeview??
@AngelSix
@AngelSix 7 лет назад
+Michael Bear just wrap it into a scroll viewer
@timomuller9392
@timomuller9392 6 лет назад
yes!
@Thiagocords08
@Thiagocords08 6 лет назад
Totally agree!!! Great quality video and teaching!
@Trust_Me_Im_An_Engineer
@Trust_Me_Im_An_Engineer 5 лет назад
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 года назад
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
@bnfgh123
@bnfgh123 7 лет назад
*Watched first episode "Alright, this looks fairly easy, let's learn it" *Watched this one "What the fuck!?"
@AngelSix
@AngelSix 7 лет назад
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 лет назад
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 лет назад
I have the C# series too, and I'll try to add more to that shortly to fill in the gaps
@Cmppayne26542
@Cmppayne26542 7 лет назад
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 7 лет назад
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.
@caseya8809
@caseya8809 Год назад
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.
@kylelarson7741
@kylelarson7741 7 месяцев назад
Thanks!
@sinajahromi3534
@sinajahromi3534 5 лет назад
One of the most informative and instructive tuts that i've ever seen for WPF and bindings! great work ... thanks
@obione8933
@obione8933 2 года назад
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
@Luca-sz5uy
@Luca-sz5uy 5 лет назад
Just for the sake of fun: "physical code" 1:13:20
@vu5700
@vu5700 3 года назад
After first tutorial this one is kinda harder but thats the reason i like it even more! Great video!
@samopoem
@samopoem 4 года назад
I can't see images, code is same, I use VS19 while using only stack is ok, insert code in treeview inside, I can't see image github.com/samopoem/wpf/tree/master
@josbexerr5166
@josbexerr5166 4 года назад
No puedo visualizar tambien los iconos, alguna solucion
@vvalentinee168
@vvalentinee168 4 года назад
The same
@reycelandes7493
@reycelandes7493 6 лет назад
I love how you explained EVERYTHING ❤❤❤
@AngelSix
@AngelSix 6 лет назад
Thanks :)
@ImSplashGG
@ImSplashGG 3 года назад
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 года назад
Try changing the path to the full location - worked for me...
@stephenyork7318
@stephenyork7318 5 лет назад
I love this video and your presentation style but for the love of god use Path.GetFilename(path) and Path.GetDirectoryName(path). THOSE are the cross platform way of getting the trailing text after the last slash or backslash.
@AngelSix
@AngelSix 5 лет назад
Yes this was done in this video to show how it's done behind the scenes
@armandoferreira1346
@armandoferreira1346 6 лет назад
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.
@starmole5000
@starmole5000 5 лет назад
It's a pleasure to both watch you code and listen to your lovely Yorkshire lilt! Thanks so much these videos are amazing.
@vargonian
@vargonian 5 лет назад
Outstanding tutorial series, and perfect timing as I'm having to revisit WPF after many years away from it.
@varunsingh1748
@varunsingh1748 4 года назад
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!
@johnagapi5970
@johnagapi5970 7 лет назад
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.
@Tiffypox
@Tiffypox 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 года назад
Thanks SO MUCH for this comment ... I was encountering the same problem, but your tip made everything work perfectly!
@Tiffypox
@Tiffypox 2 года назад
@@derekfelton1668 You are very welcome 😃
@sashamugs
@sashamugs 2 года назад
you're a life saver tiffany
@AlejandroHernandez-hx9mh
@AlejandroHernandez-hx9mh 5 лет назад
Hello! I am a native spanish speaker and I need to thank you because your tutorials are amazing and you speak pretty well
@stepan7396
@stepan7396 7 лет назад
You are the best!!! Thank you!!!!
@AngelSix
@AngelSix 7 лет назад
Thanks. Glad you are liking the videos
@Ethorbit
@Ethorbit 3 года назад
At the part where Path.GetDirectoryName doesn't work, you can also use Path.GetFileName instead
@serhiiberkovskyi9109
@serhiiberkovskyi9109 7 лет назад
I comment videos very rare, but yours are one of the best on youtube programming tutorials. Thank you so much!
@AngelSix
@AngelSix 7 лет назад
Serhii Berkovskyi no problem glad you like them
@myaloy
@myaloy 3 года назад
Very helpful - thanks. I can see why it is considered a steep learning curve though.
@willianandress1473
@willianandress1473 11 месяцев назад
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?
@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).
@dmitrymelnikov4918
@dmitrymelnikov4918 4 года назад
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!
@ltkdt
@ltkdt 4 года назад
If you run your application and got ''WPF Application Has Stopped Working'', it's due to unhandled exceptions( the try-catch block cant handle this anymore ).Check out this solution : www.c-sharpcorner.com/blogs/how-to-handle-wpf-application-has-stopped-working
@IT_Scientist
@IT_Scientist 2 года назад
22:40 .. what happened, I dont get it.. what a strange syntax, would mind at least give us a few words about that line: var item = (TreeViewItem)sender; ? Could you please simplify it to normal syntax? Thank you for your content, it is great! Although it is too fast sometimes :)
@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!!
@golibxayrullayev1353
@golibxayrullayev1353 3 года назад
Закреплено пользователем AngelSix Закреплено пользователем AngelSix AngelSix Hi, Given a WPF Image control, is it possible to determine its HWND?
@sobaver
@sobaver 4 года назад
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 :)
@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)
@gekk1985
@gekk1985 4 года назад
instead of helper method to get last direcory name you can use new DirectoryInfo(directoryPath).Name
@josbexerr5166
@josbexerr5166 4 года назад
Gracias AngelSix muy emocionado con el curso......, en visual studio 2019 no se ve lo iconos
@yougiely
@yougiely 7 лет назад
first c# development without wizard so far.
@fpvm4k3r
@fpvm4k3r 4 года назад
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!
@AngelSix
@AngelSix 4 года назад
Haha cool
@tomsupis8724
@tomsupis8724 4 года назад
Thanks a lot, cool video! 40 more hours to go! :)
@AngelSix
@AngelSix 4 года назад
Have fun!
@quaitheqarth2645
@quaitheqarth2645 Год назад
How does that Item_Expanded automatically typed out on 22:26?
@bobbyp456
@bobbyp456 6 лет назад
I think you are one of the best at explaining coding on youtube, but at minute 15:36 when you type in directory it wont highlight, and says "the name directory does not exist in the current context" I'm a beginner to C# , if you could help me out it would be greatly appreciated. I was thinking about jumping to viewmodel basics, and would just create a class that way it does "exist", would that be better or is that not fixing the problem? using classes for this seems less confusing and more compartmentalized
@AngelSix
@AngelSix 6 лет назад
Put your caret (the flashing thing indicating where your cursor is that looks like this | ) over the text, and then on the keyboad press Ctrl+. to auto-suggestion any missing namespaces. I suspect you are just missing some namespace.
@nonameforest9923
@nonameforest9923 4 года назад
I'm from Russia and since the 17 min I don't undestand anything...
@petermankge6921
@petermankge6921 2 года назад
You making life easy, wanted to get your name and follow you. thanks for this man.
@georgeblm9983
@georgeblm9983 6 лет назад
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 лет назад
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
@Jackaldev
@Jackaldev 4 года назад
Thanks so much for taking the time to make these acceptional tutorials! I have already learned so much from the first video alone.
@lzw1015bean
@lzw1015bean 6 лет назад
Hi AngelSix, it's a very good video. Thank you for sharing. But u do forgot to use folder-open.png:-)
@AngelSix
@AngelSix 6 лет назад
thanks... yeah I left that as a challenge to viewers :)
@윤희중-n5c
@윤희중-n5c 7 лет назад
Thank you for your lecture. it was really helpful for me!! And while i am following your lesson, i coudn't find images files out. where can i get the these stuff. thank you!
@AngelSix
@AngelSix 7 лет назад
I've just quickly uploaded them here file.town/uploaded/nxgntma5o4td5ru9kjukms9ja The link will work for 7 days
@martinfunkquist5037
@martinfunkquist5037 4 года назад
The files are also in the GitHub repo
@zevspitz8925
@zevspitz8925 4 года назад
Can't you use Path.GetFilename (docs.microsoft.com/en-us/dotnet/api/system.io.path.getfilename) instead of writing the GetFileFolderName helper?
@AngelSix
@AngelSix 4 года назад
Yes
@Poyser1911
@Poyser1911 7 лет назад
Noice watched it all :D
@AndrewEG
@AndrewEG 11 месяцев назад
hey Luke thanks for the videos, they are the best on youtube!
@HasnMia-k8s
@HasnMia-k8s 28 дней назад
Brown Margaret Martin Sarah Harris Joseph
@tomas120
@tomas120 7 лет назад
Amazing tutorial! For me, Is difficult the converter. But great tutorial. You forgot make the system for folder open. ;)
@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" .
@dumitrudan608
@dumitrudan608 4 года назад
You can use Path.GetFileName(dirPath) instead of Path.GetdirectoryName(dirPath)
@AngelSix
@AngelSix 4 года назад
Correct
@egoiisticprince7977
@egoiisticprince7977 4 года назад
what are prerequisites for this video? Your previous video isn't enough to understand this. Knowing C# basics ofcourse and prev video. Isn't that enough? What else? to follow along this playlist
@AngelSix
@AngelSix 4 года назад
Hard to say really. Watch it and see what you dont understand then let me know and I can point you in the right direction
@Living4Memes
@Living4Memes Год назад
I've finally decided to switch form WF to WPF. Thank you for your work!
@TheStylergirly
@TheStylergirly 2 года назад
Great Tutorial :) I only have one issue. The URI path at 1:03:52 does not work for me. It feels like ive tried almost everything to fix it but i get a System.IO.IOException every time. The path displayed in the exeption is correct but it does not work.
@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.
@toha152
@toha152 4 года назад
Thank for Git. I love you!!!)))
@AngelSix
@AngelSix 4 года назад
Welcome!
@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!
@nolimitsREAL
@nolimitsREAL 5 лет назад
Sincerely I found it very confusing, most of the things you know it because probably someone showed you or you did this before many times, I don't think anybody knows those properties, classes or methods that good. I passed through the code faster, it was really hard to realize what you're doing exactly sometimes. I did understand the concept, but i think you should go a little slower and describe more one specific subject.
@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?
@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!
@user-pu2zp2ke2l
@user-pu2zp2ke2l 9 месяцев назад
No a good its an excellent introduction
@ChiaHsiangLU
@ChiaHsiangLU 4 года назад
I just wonder how to make the scroll show/enable. Ok, I know it may be shown in the next part of the videos.
@prithvipatel189
@prithvipatel189 3 года назад
Hey.. Thanks for these tutorials. I have a suggestion. Would it be possible to make one WPF video for a Find and Replace Dialog box (with all features like RegEx, Case Sensitive, etc). I have been recently working on software that is more like a proper python-based automated scripting tool and has been done in WPF. Honestly, I couldn't find any proper youtube videos, and also the ones which are available are outdated (my feeling). I think this would be a very good idea for an advanced-level playlist for WPF. Thanks and I really appreciate your work here.
@Tall-Cool-Drink
@Tall-Cool-Drink 3 года назад
I like your presentation Please, do a video on WPF and MVVM.
@cajh8359
@cajh8359 5 лет назад
I tried to copy the project code perfectly, but the window shows only the drives, not any folders.
@AngelSix
@AngelSix 5 лет назад
Sample code is linked in the description
@nganguyenviet152
@nganguyenviet152 4 года назад
Sorry, How we can see the value of variables when hovers the mouse? I am a newbie. Thank you!!!
@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
@sal96ali
@sal96ali 4 года назад
18:50 when I ran the application the names of drives didint appear, WHY?
@denniswilliams6539
@denniswilliams6539 3 года назад
I understand this is a tutorial and you may have made this decision for the purpose of demonstration, but would it not have been a) possible and b) easier to assign the images at the point you added the files and directories to the list since they were already divided into directories, drives, and files?
@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.
@AzizjanAyupov_leo
@AzizjanAyupov_leo 4 года назад
Thank you! It was exactly what I was needed :)
@AngelSix
@AngelSix 4 года назад
Glad I could help
@adanramirez8750
@adanramirez8750 7 лет назад
Great tutorials, professional work. I got a question for you, given this code, how do i add another treeview to turn this app into a simple/basic file explorer? and/or can you make a quick video on a simple file explorer tutorial please?
@AngelSix
@AngelSix 7 лет назад
I will be doing the next few videos down the road on creating the chat application. That will likely have a few treeviews and you will easily be able to see how that could be changed/used in a file explorer. I may come back to this example also to make it more complete
@androidgaming2677
@androidgaming2677 7 лет назад
Why you used var type when you know the data type of variables .
@AngelSix
@AngelSix 7 лет назад
As oppose to? That is how you define your variables. If the type can be ascertained from the right hand side of the operation, like var i = 1; where 1 is an integer, then it saves writing int for no reason. This also means if you have really long types you write (fake code but as example) var a = new Func() instead of Func a = new Func()
@michelbrodda4438
@michelbrodda4438 3 года назад
These videos are pure Gold! Thanks a lot for putting in so much effort!
@davidjennings6293
@davidjennings6293 2 года назад
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 2 года назад
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!
@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.
@maciejzareba9563
@maciejzareba9563 5 лет назад
Im running this project on 2017 visual studio and it throws me expeption that he cant find „images/drive.png”.” even afther copy paste code from "headertoimageconventer" . Compiler doesnt recognise $"pack://application:,,,/" this form of argument
@nietwojzasranyintere
@nietwojzasranyintere 5 лет назад
Mam ten sam problem znalazłeś rozwiązanie??
@maciejzareba9563
@maciejzareba9563 5 лет назад
@@nietwojzasranyintere skopiowałem z jego git huba tą klase i podstawową i poszło
@isaacweymouth1700
@isaacweymouth1700 5 лет назад
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 5 лет назад
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 5 лет назад
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.
@adhoom
@adhoom 7 лет назад
this session is very missey when it comes to the tree view i mean the complexthing is about the directories and stuff u did but for the tree view itself i think it's very easy
@electrobrain6193
@electrobrain6193 7 лет назад
I can't believe you exist. You're like a God of Code.
@AngelSix
@AngelSix 7 лет назад
Thanks :)
@watherby29
@watherby29 5 лет назад
Thor, Loki and Cody: The Dark Code
@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
@sal96ali
@sal96ali 4 года назад
16:30 Images couldn't appears?? any suggestion? Note: when I put an Image into another it appears.
@notsoful
@notsoful 4 года назад
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 8 месяцев назад
Same for me. Even if i set build action to "resource" it only works encapsulating inside a StackPanel.
@Natsu7Dragonil
@Natsu7Dragonil 7 лет назад
Hi Luke, I don't understand why, when I put var name = MainWindow.GetFileFolderName(path); in the breack point, I was specting a blanck string... but it returns me, the string in the path... And my drives, looks like folders.... What could i do?
@AngelSix
@AngelSix 7 лет назад
The FileFolderName I made to return the folder name if its a folder, and a file if its a file. Not the parent. If you send me your code to contact@angelsix.com and point out your issues I can help.
@zianedjeb8495
@zianedjeb8495 5 лет назад
Hello AngelSix, Do you have any example how to implement TreeView w/ CheckBoxes that have the IsThreeState set to True in order to have a Toggeling of ON/OFF/MIXED? thanks in advance.
@AngelSix
@AngelSix 5 лет назад
I do not sorry
@Tydides64
@Tydides64 5 лет назад
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
@tiberiuscoman9525
@tiberiuscoman9525 4 года назад
I am trying to understand where i'm doing wrong because when i write... i get this error... the namespace prefix "(x" is not defined. i am new to WPF and C# in general and so i don't understand how to solve this. Thank you for great videos....they help alot.
@tiberiuscoman9525
@tiberiuscoman9525 4 года назад
@Drink Meplz Thanks mate. you were right.
@ymts_vladyslav3707
@ymts_vladyslav3707 3 года назад
Wouu , i really understand all you say. Unbelievable !
@salmansaleh1
@salmansaleh1 3 года назад
you are making this look easy ! Thank you :)
@pmayfield5020
@pmayfield5020 3 года назад
Great tutorial. Thanks for posting.
@just_a_duck3371
@just_a_duck3371 5 лет назад
So when you use markup extension to assign attribute, the default value converter isn't used then?
@urlgreen8699
@urlgreen8699 6 лет назад
in DirectoryItemViewModel you could've use the Model DirectoryItem instead of re typing the props inside the DirectoryItemViewModel
@AngelSix
@AngelSix 6 лет назад
We didn't because then the view model is hard tied to the data model, and the point is to keep that separation
@edinhamid4274
@edinhamid4274 5 лет назад
i'm using VS2017 and the binding does'nt seems to work on my code. The Path=Tag after all those binding line is not recognize as PropertyPath. It is taken as an object literally.
@rik0904
@rik0904 4 года назад
in my VS2017 work fine
@WTclub
@WTclub 4 года назад
The vibilisity? lol
@prototype8861
@prototype8861 3 года назад
Microsoft is fish brains.
Далее
C# WPF UI Tutorials: 03 - View Model MVVM Basics
1:12:55
Просмотров 330 тыс.
C# WPF UI Tutorials: 01 - The Basics
55:46
Просмотров 1 млн
Шоколадная девочка
00:23
Просмотров 360 тыс.
What is Span in C# and why you should be using it
15:15
WPF INotifyPropertyChanged and Databinding
14:30
Просмотров 40 тыс.
The Home Server I've Been Wanting
18:14
Просмотров 173 тыс.
Being Competent With Coding Is More Fun
11:13
Просмотров 83 тыс.
Is LEARNING WPF still WORTH it in 2023?
10:59
Просмотров 51 тыс.
the TRUTH about C++ (is it worth your time?)
3:17
Просмотров 713 тыс.
Brutally honest advice for new .NET Web Developers
7:19
Шоколадная девочка
00:23
Просмотров 360 тыс.