This is a very nasty artifact that I notice in WPF, and I was curious what I could do wrong, because I am doing what seems like simple code in WPF XAML:
<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Class="ExampleShapes.MainWindow" x:Name="Window" Title="MainWindow" Width="400" Height="400"> <Grid x:Name="LayoutRoot"> <Button Margin="50,50,50,50" Content="I pulse when clicked Why?"> <Button.Background> <LinearGradientBrush EndPoint="0,1" StartPoint="0,0"> <GradientStop Color="#FF0C0B0B" Offset="1"/> <GradientStop Color="#FFBF5656"/> </LinearGradientBrush> </Button.Background> </Button> </Grid>
It seems that there are some default values ββthat are in .NET that I do not know about the MouseOver and Click events that I DO NOT WANT. I do not mind that when the mouse hangs, it changes the color of the gradient to the default value, but when I delete it, it changes back. However, even before applying the C # base code for the 'CLICK' event (not in the example), it assumes a "pulsating" transition behavior between my given gradient and the default value. This is true for plain color. What gives?
For more information, I am developing on a 64-bit box of Windows 7 with Visual Studio 2010 and Expression Blend 3, using .NET 4.0 for VS2010, unsure of EB3, as this is an older copy, and they both do it. Is there an easy way to change the default behavior or do I need to configure a new user template for a button?
Any help is greatly appreciated thanks!
source share