Omg i had the hover issue last week and spend ages trying to find a clear explanation for why some examples work and other didn't. Thanks for the video!
Thanks a lot for this tutorial!! I tried a few times the MSFT own text tutorials, but for me it was too difficult to understand it in the deep. Here i understood 3 important things within a minute! 🙂
Hello Krampa, thanks a lot for the courses they are great no matter the fact the I work in C# around 2 years and that I know most of the stuff, I still just enjoy listening and watching your courses from the beginning :D Truth to be told I still find quite difficult to understand how the progress bar is working. I don’t mean like normal value that is changing just by adding ++ I mean by using BackgroundWorker class. Can you please make a video and try to explain who should we use PB during async scenarios and how to guess how long the process will take? Thank you very much.
Thanks so much! Great suggestion. The progress bar is one of the trickiest controls when you throw in multithreading, because its not very intuitive on how it's supposed to be used. I will add this to my list of todos!!
I didn’t know we can create a template by clicking on the properties’ style! It would be great if you can make a video of custom listview. Just saying.haha. Thanks for the video! 😆
Thanks! I don't think I have anything on this specifically yet, but you can use "DataTrigger" to use bindings to regularly defined properties. Check out the "DataTrigger" section here, it might help out: wpf-tutorial.com/styles/trigger-datatrigger-event-trigger/
Great tutorial man! Just one question, is there any way to like create a resource file somewhere and just import them to your current window, and it will then auto override all the controls? I just kinda find them a bit annoying clucking on the top of the project file.
Thanks! I think what you are looking for is creating and including resource dictionaries. You can keep all of your styles (explicit and global) in separate files and then merge those dictionaries into your App.xaml and use the styles across your entire project. (or you could do a specific window/usercontrol) I have a bit about doing it here: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-F7DiRnH6Yqo.html and here's a link to a text example: learn.microsoft.com/en-us/windows/apps/design/style/xaml-resource-dictionary#merged-resource-dictionaries
@@KampaPlays Thank you so much for the answer! I have one more question: based on your tutorial series, say I have a usercontrol that has a textbox and button. I then call the usercontrol multiple time on my main window just like in the tutorial (eg last name texbox, first name textbox). Each button when pressed, should save their textbox's value on a string on the main window. How can I achieve something like this? Thank you!
In that case you will need a way for your mainWindow to know that the button has been clicked. You *could* pass your mainWindow to your usercontrols, and use it to call some method in mainWindow when your button is pressed. A better (less-coupling) way to do it would be to create an event in your user control that you invoke on button click, and when your controls are created in mainwindow, subscribe to these events. Events are a bit more advanced of a C# topic, but they are extremely useful, and I recommend looking into them! learn.microsoft.com/en-us/dotnet/standard/events/ (Check the code under the "Events" and "Event Handlers" sections for examples of what I'm talking about)
Thanks! It comes with time and repetition, just like anything. I can recall a large portion of .NET and WPF from memory, but I still check the documentation regularly for things that I don't use often. One piece of advice I give is to write it out as often as you can instead of copy/paste, and you will be able to remember/understand it better. Typing/entry speed is insignificant compared to the time it takes to properly solve the problem!
when i select "convert to new resource" i see the dialog popup, i fill it out and select ok and it puts in the basic stuff with nothing else, no "button.mouseover.background" or anything else, just the normal background color, would that be because i already have a "buttonstyle.xaml" defined from watching your previous video where you taught us about the resource dictionary? UPDATE: Yes it was lol, i just removed the original style from the resource dictionary and tried again and it added all the extra template stuff.
When I added The "Control Template" it shrinks the buttons down to nothing and I have stretch them out. Why is this? The buttons height and width are not set, but I don't need them to be.
When you override the default control template with a blank template it loses all of its standard formatting. What you are describing may be a missing Horizontal/Vertical Alignment of "Stretch". Let me know if this isn't what you meant.
The previous video #20 (ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-F7DiRnH6Yqo.html) shows how to make the style reusable both explicitly and application wide. Hope this helps!
Hey :) First of all, thanks for this tutorial series. I´m just learning WPF and this is by far the best explanations i´ve seen. One question tho. Is there a posibility, to group items into a Grid Row/Column? So instead of saying: it would sometimes be easier to just say Do you know, if this is possible? Thanks :)
Thank you, and definitely! You can put the objects into a parent container of some sort and set that parent's column/row. Grid is quick and easy but sometimes you may want a StackPanel/ScrollViewer/something else specific for your controls to live in.
@@KampaPlays Thanks :) Didn´t read your answer until now, but i found it out by myselfe. I just had to create a new grid, put it in the row/column i want and put everything in that grid. Instead of just typing like i wrote.. Thanks :)