The text of this article is not in this database — only its details are. Read it on the old site: XAML RadialGradientBrush Element
1 Comment
Join the conversation! Your thoughts help the community grow.
Sign in to leave a comment.
The text of this article is not in this database — only its details are. Read it on the old site: XAML RadialGradientBrush Element
Join the conversation! Your thoughts help the community grow.
Sign in to leave a comment.
sourav kumarPosted Mar 11, 2010, 3:19 PM
Hi, I follow your articles. Can you help me to build a gradient button. I am new in wpf. I have written a code for that. But does not work. Here is the code. <Window x:Class="wpfMedia.Window3" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window3" Height="375.518" Width="477.73" Loaded="Window_Loaded"> <Window.Resources> <ControlTemplate x:Key="PetesButton" TargetType="{x:Type Button}"> <Grid > <Border BorderThickness="1,1,1,1" CornerRadius="10,10,10,10" Height="51.106" VerticalAlignment="Top" Margin="0,38.885,0,0"> <Border.BorderBrush> <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1" > <GradientStop Color="Black" Offset="0"/> <GradientStop Color="Green" Offset="1"/> </LinearGradientBrush> </Border.BorderBrush> <Border.Background> <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1" > <GradientStop Color="Green" Offset="0"/> <GradientStop Color="Black" Offset="1"/> </LinearGradientBrush> </Border.Background> </Border> <ContentPresenter x:Name="Contents" HorizontalAlignment="Center" VerticalAlignment="Center" Width="Auto" Margin="3,3,3,3"/> </Grid> </ControlTemplate> </Window.Resources> <Grid> <Button Height="23" Margin="187.759,115.544,193.314,0" Name="button1" VerticalAlignment="Top" Template="{DynamicResource PetesButton}">Button</Button> </Grid> </Window> <!--Session data-->