C# WPF Tutorial #21 - Styles and ControlTemplates

  Рет қаралды 19,640

Kampa Plays

Kampa Plays

Күн бұрын

Пікірлер: 67
@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!
@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!
@kuzelk6571
@kuzelk6571 8 ай бұрын
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 7 ай бұрын
Thanks, glad to help!!!
@kovcorporation
@kovcorporation 5 күн бұрын
very simple and usefull describe for a complicated stuff :) thanks
@kojhkimo
@kojhkimo Жыл бұрын
Thank you for providing the videos. It is useful to me as a WPF beginner.
@KampaPlays
@KampaPlays Жыл бұрын
Very glad it is helpful!
@sem_the_man
@sem_the_man 4 ай бұрын
thank you so much, learned a lot and never knew you could just take the default style like that!
@dannyhunn6025
@dannyhunn6025 Жыл бұрын
Keep up the amazing work
@KampaPlays
@KampaPlays Жыл бұрын
Thanks so much!!
@fooballers7883
@fooballers7883 Жыл бұрын
thank you... love all these tips... just brilliant.
@KampaPlays
@KampaPlays Жыл бұрын
Thanks!!!
@jhlfergus
@jhlfergus 29 күн бұрын
I have a custom app that I am creating and I am using custom UI textures so it doesn’t look like the standard app at all. In that app I am using treeview and I want to change the look of the scroll bar to match the rest of the app. How can I do that?
@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!
@ErcanMutlu-r4x
@ErcanMutlu-r4x 2 ай бұрын
IT WORKS ON new version. You dont have to REDEFINE content template
@KRYVVV
@KRYVVV 10 ай бұрын
Thank you very much for this awesome Series!
@KampaPlays
@KampaPlays 10 ай бұрын
Glad to help!!
@rulexplay5935
@rulexplay5935 9 ай бұрын
It's very useful video! Thank you for your work!❤
@KampaPlays
@KampaPlays 9 ай бұрын
Thank you!!!
@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 Жыл бұрын
Worked for me as well, thanks!
@jeny.biju.
@jeny.biju. 2 ай бұрын
This helped me too! Thanks.
@thomasaminer
@thomasaminer 2 ай бұрын
Thank you, a highly useful video!
@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!!
@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: kzbin.info/www/bejne/fGinmoWkfZuMp9E 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.
@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!
@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!
@bogdanlazar3278
@bogdanlazar3278 6 ай бұрын
Thank you :) This is nice :D
@KampaPlays
@KampaPlays 6 ай бұрын
Thank you !!
@朱亚君-m9b
@朱亚君-m9b Жыл бұрын
Wonderful
@KampaPlays
@KampaPlays Жыл бұрын
Thank you!
@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!
@tum6300
@tum6300 11 ай бұрын
How would you bind some Property to a Trigger Value? Love your Videos!
@KampaPlays
@KampaPlays 11 ай бұрын
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/
@arascivileng
@arascivileng Жыл бұрын
awesome💓
@KampaPlays
@KampaPlays Жыл бұрын
Thank you!!
@ArturBerkut
@ArturBerkut 11 ай бұрын
thanks a lot
@KampaPlays
@KampaPlays 11 ай бұрын
Happy to help!
@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 :)
@n1mi-
@n1mi- 11 ай бұрын
thx, man
@KampaPlays
@KampaPlays 11 ай бұрын
welcome! glad to help.
@IonCasu-fw3ro
@IonCasu-fw3ro 6 ай бұрын
Why at 4:50 the target type magically become "{x:Type Button}" from "Button"?
@KampaPlays
@KampaPlays 6 ай бұрын
That is an excellent question. I'm honestly not sure at this point what I did there. Sorry for the confusion.
@swrcPATCH
@swrcPATCH 10 ай бұрын
How do I put the style template in a separate file and how do I use it then?
@KampaPlays
@KampaPlays 10 ай бұрын
The previous video #20 (kzbin.info/www/bejne/fGinmoWkfZuMp9E) shows how to make the style reusable both explicitly and application wide. Hope this helps!
@swrcPATCH
@swrcPATCH 10 ай бұрын
thanks a lot@@KampaPlays
@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.
@lantisdylan
@lantisdylan Жыл бұрын
Sir hopefully you build project have database.
@KampaPlays
@KampaPlays Жыл бұрын
I will add database integration to the to-do list! Thanks!
@testg4andmmm129
@testg4andmmm129 Ай бұрын
12:15 xamllll heelllllllll ,,,,,,, definitely different file ...with proper name......
C# WPF Tutorial #22 - What is MVVM?
6:05
Kampa Plays
Рет қаралды 15 М.
How to Program in C# - BASICS (E01)
11:48
Brackeys
Рет қаралды 1,5 МЛН
Smart Sigma Kid #funny #sigma
00:14
CRAZY GREAPA
Рет қаралды 54 МЛН
Sigma baby, you've conquered soap! 😲😮‍💨 LeoNata family #shorts
00:37
Friends make memories together part 2  | Trà Đặng #short #bestfriend #bff #tiktok
00:18
Сюрприз для Златы на день рождения
00:10
Victoria Portfolio
Рет қаралды 2,4 МЛН
Templates and Behavior - WPF CUSTOM CONTROLS #1
15:45
SingletonSean
Рет қаралды 45 М.
Is LEARNING WPF still WORTH it in 2023?
10:59
tutorialsEU
Рет қаралды 54 М.
Creating Reusable Controls - WPF TUTORIALS
17:10
SingletonSean
Рет қаралды 31 М.
WPF C# MVVM Sample Application
13:16
MpCodes
Рет қаралды 19 М.
Brutally honest advice for new .NET Web Developers
7:19
Ed Andersen
Рет қаралды 224 М.
The Basics of Data Binding in WPF
20:53
Tactic Devs
Рет қаралды 45 М.
[C# WPF] Styles and Templates
7:30
BashkaMen Programming
Рет қаралды 23 М.
Triggers in WPF
6:33
High-Tech
Рет қаралды 1,9 М.
WPF Data Template 2019
12:05
Edwin Cloud
Рет қаралды 7 М.
Smart Sigma Kid #funny #sigma
00:14
CRAZY GREAPA
Рет қаралды 54 МЛН