Changing glow speed in default WPF Button - wpf

The default WPF button we have in Visual Studio: when mouse hover on it, the button background will glow from grey to blue. The speed is too slow. How to speed up the glowing effect in XAML?
Is there something like below?:
<Style TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
<Setter Property="GlowSpeed" Value="0.01" />
</Style>
Of course, this property doesn't exist. What property is that suppose to be? Is that some sort of Animation?

This animation is embedded in the default Template of the button, you would need to change the default template which can be found on MSDN (Default WPF Themes link).

Related

WPF button text scrolling on mouse over

is it possible for buttons that have longer Content(text) than the max button width to kinda scroll the remaining text from right to left on mouse over? something like an electronic banner is the best I could explain it.
as of now this is the only thing that reflects my button style xaml.
<Page.Resources>
<Style x:Key="Str" TargetType="{x:Type Button}">
<Setter Property="Width" Value="90"/>
</Style>
</Page.Resources>
Yes. That's usually called marquee.
You can template a wpf control to do just about anything.
Put a canvas in there and a textblock. Animate the canvas.Left of the textblock.
There's a marquee implementation here:
https://social.technet.microsoft.com/wiki/contents/articles/31416.wpf-mvvm-friendly-user-notification.aspx?Redirected=true#Marquee
You would, obviously, want to start the animation using a datatrigger and ismouseover true.

MahApps Dialog overriding Button style?

I'm using the MahApps metro toolkit, and have the following inside my Apps.xaml file:
<Application.Resources>
<ResourceDictionary>
...
<Style TargetType="{x:Type Button}" />
...
</ResourceDictionary>
</Application.Resources>
Which nicely overrides the MahApps metro style for Button back to 'default'.
However, I've written a custom dialog (called DialogEditGroup - which derives from CustomDialog), but weirdly the <Button /> style has reverted back to using some form of styling from the MahApps metro toolkit.
The only way I've been able to reset it again, is by adding the following lower down in my Apps.xaml ResourceDictionary:
<Style TargetType="{x:Type controls:DialogEditGroup}">
<Style.Resources>
<Style TargetType="{x:Type Button}" />
</Style.Resources>
</Style>
I really don't want to have to add this in for every custom dialog I write, and I'm sure the above 'fix' isn't the correct way of solving the problem. Can anyone suggest a proper way of addressing this issue?
`
(Top of image is 'mahapps', bottom is 'default / generic')

How to change ShowMessageAsync flow direction to "Right to Left"?

Is there any way to change Mahapps messagebox window (ShowMessageAsync)'s flow direction to Right to left ?
You can set the FlowDirection for the whole MetroWindow and all childrens.
FlowDirection="RightToLeft"
If you only want to set this to MessageDialog then you can change the style e.g. in your App.xaml like this
<Style TargetType="{x:Type Dialog:MessageDialog}"
BasedOn="{StaticResource {x:Type Dialog:BaseMetroDialog}}">
<Setter Property="FlowDirection" Value="RightToLeft" />
</Style>
So all message dialogs will get this style.
Hope this helps!
Overwriting the style should do it,
see: How to change MahApps.Metro dialog content template width?
The answer has a nice little tutorial.

Change Background for all MetroWindow (MahApp)

I've just started using MahApps with WPF. I would like to change background color of all MetroWindow. This post indicates how to do it for one instance of a MetroWindow, but is there a way to override the default background color for this control type?
I would expect to be able to change it by customizing a Mahapps theme. I created a custom theme (copied from BaseDark.xaml), changed all SolidColorBrush values, applied the theme in the OnStartup event using "ThemeManager.ChangeAppStyle" but the MetroWindow background didn't change.
This code (put in the App.xaml) doesn't work either:
<Style BasedOn="{StaticResource {x:Type Controls:MetroWindow}}" TargetType="{x:Type Controls:MetroWindow}">
<Setter Property="Background" Value="LightGray" />
</Style>
In addition to MetroWindow, I would also like to override the background color of the System.Windows.Controls.UserControl type.
I found the Color in the Mahapps theme that change the MetroWindow background color:
<Color x:Key="WhiteColor">#FF373F44</Color>

WP7 Disabled Button Style

I am trying to do change the color of a disabled button's border/text.
Code:
<Style x:Key="TopTabChooserButtonDisabled" TargetType="Button">
<Setter Property="Foreground" Value="Orange" />
</Style>
But it doesn't affect the button at all in Silverlight. Does anybody know what will make it change? THanks.
You can do this fairly easily by retemplating the control in blend.
Rclick the control, edit template, edit a copy. You then have access to all the states and constituent objects that make up the control in each of those states to change properties of each as needed.

Resources