Click here to Skip to main content
15,914,416 members
Home / Discussions / WPF
   

WPF

 
QuestionHypreLink in WPF User control. Pin
saku695-Feb-09 20:55
saku695-Feb-09 20:55 
AnswerRe: HypreLink in WPF User control. Pin
schiebel-t6-Feb-09 1:56
schiebel-t6-Feb-09 1:56 
GeneralRe: HypreLink in WPF User control. Pin
ABitSmart7-Feb-09 3:48
ABitSmart7-Feb-09 3:48 
AnswerRe: HypreLink in WPF User control. Pin
Leung Yat Chun8-Feb-09 0:26
Leung Yat Chun8-Feb-09 0:26 
QuestionHosting Workflow designer inside a ASP.net application Pin
Laddie5-Feb-09 19:00
Laddie5-Feb-09 19:00 
AnswerRe: Hosting Workflow designer inside a ASP.net application Pin
Pete O'Hanlon5-Feb-09 22:54
mvePete O'Hanlon5-Feb-09 22:54 
GeneralRe: Hosting Workflow designer inside a ASP.net application Pin
Laddie5-Feb-09 23:01
Laddie5-Feb-09 23:01 
QuestionWPF storyboard and animation Pin
koleraba5-Feb-09 8:50
koleraba5-Feb-09 8:50 
Hi
I am trying to create and start an animation in code instead of using xaml. When I use the Storyboard object(second example) nothing happens(There are no visible results of the animation), if I set animation's properties and start it without using the Storyboard object everything works normaly(first example). Below is the sample code which is put in the event handler for a button which is on the UserControl.

//This works normaly
btn_Click(object sender, RoutedEventArgs e)
{
LinearGradientBrush mask = new LinearGradientBrush();

GradientStop transparentStop = new GradientStop(Colors.Transparent, 0);
GradientStop visibleStop = new GradientStop(Colors.Black, 0);

mask.GradientStops.Add(transparentStop);
mask.GradientStops.Add(visibleStop);

this.OpacityMask = mask;

DoubleAnimation visibleStopAnimation = new DoubleAnimation(0, 1.2, TimeSpan.FromSeconds(1.2), FillBehavior.HoldEnd);
visibleStop.BeginAnimation(GradientStop.OffsetProperty, visibleStopAnimation);
}

//This doesn't work
btn_Click(object sender, RoutedEventArgs e)
{
LinearGradientBrush mask = new LinearGradientBrush();
GradientStop transparentStop = new GradientStop(Colors.Transparent, 0);
GradientStop visibleStop = new GradientStop(Colors.Black, 0);
mask.GradientStops.Add(transparentStop);
mask.GradientStops.Add(visibleStop);
this.OpacityMask = mask;

Storyboard story = new Storyboard();
story.Duration = TimeSpan.FromSeconds(1);
DoubleAnimation visibleStopAnimation = new DoubleAnimation(0, 1, TimeSpan.FromSeconds(1), FillBehavior.HoldEnd);
Storyboard.SetTarget(visibleStopAnimation, visibleStop);
Storyboard.SetTargetProperty(visibleStopAnimation, new PropertyPath("(Offset)"));
story.Children.Add(visibleStopAnimation);
story.Begin();
}

Does anybody has any idea? Any advice will be appreciated!
Uros
AnswerRe: WPF storyboard and animation [modified] Pin
sivaddrahcir6-Feb-09 12:17
sivaddrahcir6-Feb-09 12:17 
GeneralRe: WPF storyboard and animation Pin
koleraba7-Feb-09 2:06
koleraba7-Feb-09 2:06 
Questionlink a custom control to a dictionaryResources Pin
Rami Shareef5-Feb-09 2:10
Rami Shareef5-Feb-09 2:10 
AnswerRe: link a custom control to a dictionaryResources Pin
BlitzPackage5-Feb-09 8:30
BlitzPackage5-Feb-09 8:30 
QuestionWPF window in ICQ style Pin
prattel4-Feb-09 23:16
prattel4-Feb-09 23:16 
AnswerRe: WPF window in ICQ style Pin
Pete O'Hanlon5-Feb-09 0:09
mvePete O'Hanlon5-Feb-09 0:09 
GeneralRe: WPF window in ICQ style [modified] Pin
sivaddrahcir6-Feb-09 7:30
sivaddrahcir6-Feb-09 7:30 
QuestionPlease help me Pin
haticeaaaaaa4-Feb-09 20:39
haticeaaaaaa4-Feb-09 20:39 
AnswerDon't bump your post. Pin
Pete O'Hanlon4-Feb-09 23:39
mvePete O'Hanlon4-Feb-09 23:39 
GeneralRe: Don't bump your post. Pin
haticeaaaaaa5-Feb-09 2:45
haticeaaaaaa5-Feb-09 2:45 
GeneralRe: Don't bump your post. Pin
Pete O'Hanlon5-Feb-09 3:07
mvePete O'Hanlon5-Feb-09 3:07 
QuestionSending Email Pin
Ray Cassick4-Feb-09 15:29
Ray Cassick4-Feb-09 15:29 
AnswerRe: Sending Email Pin
Michael Sync8-Feb-09 6:36
Michael Sync8-Feb-09 6:36 
GeneralRe: Sending Email Pin
Ray Cassick8-Feb-09 13:08
Ray Cassick8-Feb-09 13:08 
GeneralRe: Sending Email Pin
Braulio Dez13-Mar-09 6:27
Braulio Dez13-Mar-09 6:27 
AnswerRe: Sending Email Pin
Kevin McFarlane8-Feb-09 7:24
Kevin McFarlane8-Feb-09 7:24 
QuestionBinding To One Object Or To A Property Pin
BlitzPackage4-Feb-09 15:14
BlitzPackage4-Feb-09 15:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.