HomeОбразованиеRelated VideosMore From: DotNetSkoool

Triggers in WPF

138 ratings | 19480 views
Hi My fellow learners, since you have learnt about Styles it is time to look into WPF triggers. Triggers are used with styles to give your UI a rich and dynamic look and feel. Leave a comment for your doubts and please do subscribe to my channel. Share this channel and keep learing.
Html code for embedding videos on your blog
Text Comments (24)
Mehmet Turan (6 months ago)
thanks
Shubh Agrawal (7 months ago)
Awesome Video
Arunavo Ray (1 year ago)
I have a png image i want to make a button out of it... how do i do it
sorriaejogue (1 year ago)
awesome
shilpi mittal (1 year ago)
Thank you for the nice videos... I have a question here: when I tried to change the background of button inside trigger setter, its not reflecting but all other setters worked fine like foreground, fontWeight etc... Is their any specific reason?
Good Videos. Thank You!
Pulkit (2 years ago)
Thank you Sir for this video! I am facing an issue while implementing Triggers. Below is my xaml code: **************************Start of Code****************************** <Grid> <Button Name="btn" Content="Hover over me to change my color!" Height="50"> <Button.Style> <Style TargetType="Button"> <Setter Property="Foreground" Value="YellowGreen"/> <Style.Triggers> <Trigger Property="IsMouseOver" Value="True"> <Setter Property="FontWeight" Value="ExtraBold"/> <Setter Property="Foreground" Value="Red"/> <Setter Property="Background" Value="Brown"/> </Trigger> </Style.Triggers> </Style> </Button.Style> </Button> </Grid> **************************End of Code****************************** When I hove mouse over the button, every style property is working except the Background property. The Background color of the button is not changing to Brown (color in the code above) and is changing to Aqua color irrespective of the Background color set. Could you please let me know the reason behind this?
MOHD AMIR (2 years ago)
good work
saria houloubi (2 years ago)
Great videos bro keep it on!!
DotNetSkoool (2 years ago)
Thanks a lot.. Glad you liked it
Lalit Saw (2 years ago)
Hey man..u have helped to gain confidence to learn WPF :) I was scared of it for past 2 years :( It would be nice if you post videos of other topics like WCF, Design patterns and others.. kudos to your tutorial
Trzbne (5 months ago)
Dear, do you still plan to prepare WCF and Design patterns? Your videos helped me a lot, and I would like to learn more.
DotNetSkoool (2 years ago)
I am glad that this has helped you. WCF, Design patterns is planned and will surely do that.. Thanks for feedback
Aleksandar Đurović (2 years ago)
Nice video again. One question: Why we need to type Button.Style and then inside that tag Style again? I now that VS don't allow to type Style tag directly inside Button tag, but I don't now why? :)
DotNetSkoool (2 years ago)
Button.Style marks the region in which you will define your style, just imagine it as a simple xml file you will get an idea. Style tag inside Button.Style defines your actual style. But it is recommended to use styles as resources. For demo I used Button.Style tag..
Bharath Kumar (2 years ago)
I am really enjoying your videos.Thank you.i have a doubt how can we use triggers like resource instead of applying trigger directly to a button how can we made that at window resource and by using a key how can we apply to the buttons
Bharath Kumar (2 years ago)
yeah,it is solved
DotNetSkoool (2 years ago)
Yr doubt is solved Bharat?
Bharath Kumar (2 years ago)
I did that thank you
Anil Kumar (2 years ago)
Your Videos are great! If you speak a bit more smoothly n slightly fast and change the background color and forecolor of slides to some other your subscribers may increase:Just an observation! :)
mrudula sirpotdar (1 year ago)
great information..thank you !
DotNetSkoool (2 years ago)
Will try to do so in my next lecture. Thanks for feedback
St S (2 years ago)
Your videos are really great! But sometimes I find it difficult to read the codes especially on tablet. It will be really helpful if you can increase the font size in Visual Studio.
DotNetSkoool (2 years ago)
Point taken my friend.. Thanks for feedback

Would you like to comment?

Join YouTube for a free account, or sign in if you are already a member.