Тёмный

C# WPF Tutorial #21 - Styles and ControlTemplates 

Kampa Plays
Подписаться 6 тыс.
Просмотров 17 тыс.
50% 1

Наука

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

 

8 авг 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 63   
@wookyumkim4669
@wookyumkim4669 Год назад
As always, your video is awesome! I'm again amazed by your proficiency on C# WPF. Thank you very much for making this series 😊😊
@KampaPlays
@KampaPlays Год назад
Thank you for the kind words, glad it is helpful!
@sem_the_man
@sem_the_man 2 месяца назад
thank you so much, learned a lot and never knew you could just take the default style like that!
@WIckedOmenOfThunder
@WIckedOmenOfThunder Год назад
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!
@KampaPlays
@KampaPlays Год назад
Haha! I know that feeling. Glad it helped!
@kojhkimo
@kojhkimo Год назад
Thank you for providing the videos. It is useful to me as a WPF beginner.
@KampaPlays
@KampaPlays Год назад
Very glad it is helpful!
@thomasaminer
@thomasaminer 14 дней назад
Thank you, a highly useful video!
@kuzelk6571
@kuzelk6571 5 месяцев назад
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! 🙂
@KampaPlays
@KampaPlays 5 месяцев назад
Thanks, glad to help!!!
@KRYVV
@KRYVV 8 месяцев назад
Thank you very much for this awesome Series!
@KampaPlays
@KampaPlays 8 месяцев назад
Glad to help!!
@dannyhunn6025
@dannyhunn6025 Год назад
Keep up the amazing work
@KampaPlays
@KampaPlays Год назад
Thanks so much!!
@rulexplay5935
@rulexplay5935 6 месяцев назад
It's very useful video! Thank you for your work!❤
@KampaPlays
@KampaPlays 6 месяцев назад
Thank you!!!
@maheshkulkarni6920
@maheshkulkarni6920 Год назад
Eagerly waiting for your next video
@KampaPlays
@KampaPlays Год назад
Thank you, I'm a bit behind because of work but I should have the 1st MVVM video out Monday or Tuesday!
@bogdanlazar3278
@bogdanlazar3278 3 месяца назад
Thank you :) This is nice :D
@KampaPlays
@KampaPlays 3 месяца назад
Thank you !!
@maheshkulkarni6920
@maheshkulkarni6920 Год назад
Thank you very much for this playlist Please make MVVM CRUD EF and Dependency injection small application Great Explanation
@KampaPlays
@KampaPlays Год назад
Thank you! I will add these to my list. I'm working on MVVM now!
@vitalijgrabovan2061
@vitalijgrabovan2061 Год назад
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.
@KampaPlays
@KampaPlays Год назад
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!!
@arascivileng
@arascivileng Год назад
awesome💓
@KampaPlays
@KampaPlays Год назад
Thank you!!
@user-mj1ms6jb3z
@user-mj1ms6jb3z 10 месяцев назад
Wonderful
@KampaPlays
@KampaPlays 10 месяцев назад
Thank you!
@fooballers7883
@fooballers7883 Год назад
thank you... love all these tips... just brilliant.
@KampaPlays
@KampaPlays Год назад
Thanks!!!
@ArturBerkut
@ArturBerkut 8 месяцев назад
thanks a lot
@KampaPlays
@KampaPlays 8 месяцев назад
Happy to help!
@user-xy1lg5rr9p
@user-xy1lg5rr9p 10 часов назад
IT WORKS ON new version. You dont have to REDEFINE content template
@Stars.Stripes.andVan
@Stars.Stripes.andVan Год назад
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! 😆
@KampaPlays
@KampaPlays Год назад
Glad to help! Will add it to the list!
@n1mi-
@n1mi- 9 месяцев назад
thx, man
@KampaPlays
@KampaPlays 9 месяцев назад
welcome! glad to help.
@tum6300
@tum6300 9 месяцев назад
How would you bind some Property to a Trigger Value? Love your Videos!
@KampaPlays
@KampaPlays 9 месяцев назад
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/
@dc37wwe2kmods
@dc37wwe2kmods Год назад
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.
@KampaPlays
@KampaPlays Год назад
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
@dc37wwe2kmods
@dc37wwe2kmods Год назад
@@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!
@KampaPlays
@KampaPlays Год назад
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)
@dc37wwe2kmods
@dc37wwe2kmods Год назад
@@KampaPlays Do you have any video tutorials for this?
@KampaPlays
@KampaPlays Год назад
Not yet, it's on my list for the more intermediate/advanced Playlist i want to do next.
@scramjet4610
@scramjet4610 Год назад
Excellent video, but how does one remember this wide range of WPF material when working on a big project?
@KampaPlays
@KampaPlays Год назад
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!
@milentiusgaming
@milentiusgaming Год назад
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.
@KampaPlays
@KampaPlays Год назад
Good catch, and good problem solving!! I didn't think to mention this, but I bet this comment will help someone else!
@helloyou191
@helloyou191 10 месяцев назад
Worked for me as well, thanks!
@lantisdylan
@lantisdylan Год назад
Sir hopefully you build project have database.
@KampaPlays
@KampaPlays Год назад
I will add database integration to the to-do list! Thanks!
@Erraticfox
@Erraticfox Год назад
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.
@KampaPlays
@KampaPlays Год назад
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.
@IonCasu-fw3ro
@IonCasu-fw3ro 4 месяца назад
Why at 4:50 the target type magically become "{x:Type Button}" from "Button"?
@KampaPlays
@KampaPlays 3 месяца назад
That is an excellent question. I'm honestly not sure at this point what I did there. Sorry for the confusion.
@swrcPATCH
@swrcPATCH 8 месяцев назад
How do I put the style template in a separate file and how do I use it then?
@KampaPlays
@KampaPlays 8 месяцев назад
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!
@swrcPATCH
@swrcPATCH 8 месяцев назад
thanks a lot@@KampaPlays
@dakloafitz6347
@dakloafitz6347 Год назад
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 :)
@KampaPlays
@KampaPlays Год назад
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.
@dakloafitz6347
@dakloafitz6347 Год назад
@@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 :)
Далее
C# WPF Tutorial #22 - What is MVVM?
6:05
Просмотров 13 тыс.
The Basics of Data Binding in WPF
20:53
Просмотров 38 тыс.
Is LEARNING WPF still WORTH it in 2023?
10:59
Просмотров 45 тыс.
Creating Reusable Controls - WPF TUTORIALS
17:10
Просмотров 30 тыс.
C# WPF Tutorial #20 - Reusable Style Resources
11:11
Просмотров 13 тыс.
WPF C# Professional Modern Flat UI Tutorial
36:44
Просмотров 805 тыс.
JPEG is Dying - And that's a bad thing
8:09
Просмотров 265 тыс.