C# WPF Tutorial #21 - Styles and ControlTemplates

preview_player
Показать описание
Take full control of the look and feel by overriding a control's ControlTemplate! Learn to create a ControlTemplate from scratch, how to get and modify a control's default template, common pitfalls for dealing with these elements, and additional helpful resources.

Microsoft Control Styles and Templates resource:

Happy Coding!

Chapters
0:00 Setup
0:20 Why a ControlTemplate?
1:44 Avoiding Issues (Adding Triggers)
3:12 Creating a ControlTemplate
3:53 TemplateBinding
4:55 ContentPresenter
5:35 Triggers Work!
5:53 Warning!!
7:15 Starting from a Default Template
8:28 Modifying a Default Template
9:33 Microsoft Style Template Examples
Рекомендации по теме
Комментарии
Автор

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!

WIckedOmenOfThunder
Автор

As always, your video is awesome! I'm again amazed by your proficiency on C# WPF. Thank you very much for making this series 😊😊

wookyumkim
Автор

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

kuzelk
Автор

Thank you for providing the videos.
It is useful to me as a WPF beginner.

kojhkimo
Автор

thank you so much, learned a lot and never knew you could just take the default style like that!

sem_the_man
Автор

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.

milentiusgaming
Автор

thank you... love all these tips... just brilliant.

fooballers
Автор

Thank you very much for this awesome Series! <3

KRYVVV
Автор

It's very useful video! Thank you for your work!❤

rulexplay
Автор

very simple and usefull describe for a complicated stuff :) thanks

kovcorporation
Автор

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.

dcwwekmods
Автор

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?

jhlfergus
Автор

Why at 4:50 the target type magically become "{x:Type Button}" from "Button"?

IonCasu-fwro
Автор

Hey, thanks for the great tutorials! I hate having to ask for help, but when I try "Convert to New Resource" for the button style, that option is grayed out. I'm using VS 2017 pro edition. Do you know if that isn't available in the version I'm using or if there's something else that would make it unavailable? Thanks.

thomasg
Автор

IT WORKS ON new version. You dont have to REDEFINE content template

ErcanMutlu-rx
Автор

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.

vitalijgrabovan
Автор

Hi, is there a way I can contact you? I am really going crazy to change the mouseover property of a combobox. Let me know thanks a lot, your tutorials are really helpful

marcellodichiera
Автор

Excellent video, but how does one remember this wide range of WPF material when working on a big project?

scramjet
Автор

Sorry may i ask this:
I had set :
<Style x:Key="button9" TargetType="{x:Type Button}">,
why when I changed :
<SolidColorBrush Color="#0052C1" />,
it wouldn't make other button also change it to blue but only the button that i had set style="{ StaticResource button9}"?
Isn''t the SolidColorBrush also a Global style?

yumecapybara
Автор

How would you bind some Property to a Trigger Value?

Love your Videos!

tum