Click here to Skip to main content
15,917,061 members
Home / Discussions / WPF
   

WPF

 
QuestionHow to know DataGrid sorting changed (any Event)? Pin
Frank W. Wu28-Jan-10 3:43
Frank W. Wu28-Jan-10 3:43 
AnswerRe: How to know DataGrid sorting changed (any Event)? Pin
Covean28-Jan-10 4:52
Covean28-Jan-10 4:52 
GeneralRe: How to know DataGrid sorting changed (any Event)? Pin
Frank W. Wu28-Jan-10 5:42
Frank W. Wu28-Jan-10 5:42 
GeneralRe: How to know DataGrid sorting changed (any Event)? Pin
Covean28-Jan-10 5:52
Covean28-Jan-10 5:52 
QuestionAnimation in code behind Pin
V.27-Jan-10 23:53
professionalV.27-Jan-10 23:53 
AnswerRe: Animation in code behind Pin
ProtoBytes28-Jan-10 3:28
ProtoBytes28-Jan-10 3:28 
GeneralRe: Animation in code behind Pin
V.28-Jan-10 3:56
professionalV.28-Jan-10 3:56 
GeneralRe: Animation in code behind Pin
V.28-Jan-10 23:58
professionalV.28-Jan-10 23:58 
FYI, I got it to work. Here's the code.
The result is that only the Rectangle will turn and change color when starting the animation. They both stop when stopping the animation.

    if(sb == null){

        sb = new Storyboard();

        da = new DoubleAnimation();
        da.From = 0;
        da.To = 360;
        da.Duration = new Duration(new TimeSpan(0, 0, 10));
        da.RepeatBehavior = RepeatBehavior.Forever;

        rectangle_animation.RenderTransform = new RotateTransform();
        rectangle_animation.RenderTransformOrigin = new Point(0.5, 0.5);


        ca = new ColorAnimation();
        ca.From = Colors.Red;
        ca.To = Colors.Blue;
        ca.Duration = new Duration(new TimeSpan(0, 0, 10));
        ca.RepeatBehavior = RepeatBehavior.Forever;
        ca.AutoReverse = true;

        if(rectangle_animation.Fill == null){
            rectangle_animation.Fill = new SolidColorBrush();
            //if you use following line to initiate, the Fill property is "frozen".
            //rectangle_animation.Fill = Brushes.Red;
        }

        this.RegisterName("rectangle_angle", rectangle_animation.RenderTransform);
        Storyboard.SetTargetName(da, "rectangle_angle");
        Storyboard.SetTargetProperty(da, new PropertyPath(RotateTransform.AngleProperty));


        this.RegisterName("rectangle_brush", (SolidColorBrush)rectangle_animation.Fill);
        Storyboard.SetTargetName(ca, "rectangle_brush");
        Storyboard.SetTargetProperty(ca, new PropertyPath(SolidColorBrush.ColorProperty));


        sb.Children.Add(da);
        sb.Children.Add(ca);

        sb.Begin(this, true);

    }
    else{
        sb.Resume(this);
    }
    btn_stop.Visibility = Visibility.Visible;
    btn_start.Visibility = Visibility.Hidden;

}

private void btn_stop_Click(object sender, RoutedEventArgs e)
{
    if(sb != null){
        sb.Pause(this);
    }
    btn_stop.Visibility = Visibility.Hidden;
    btn_start.Visibility = Visibility.Visible;
}


V.

Stop smoking so you can: Enjoy longer the money you save.
Moviereview Archive

GeneralRe: Animation in code behind Pin
ProtoBytes29-Jan-10 3:45
ProtoBytes29-Jan-10 3:45 
GeneralRe: Animation in code behind Pin
V.29-Jan-10 4:03
professionalV.29-Jan-10 4:03 
AnswerRe: Animation in code behind Pin
ProtoBytes29-Jan-10 4:08
ProtoBytes29-Jan-10 4:08 
GeneralRe: Animation in code behind Pin
V.29-Jan-10 4:12
professionalV.29-Jan-10 4:12 
QuestionInput date as UK format Pin
surfluds27-Jan-10 3:41
surfluds27-Jan-10 3:41 
AnswerRe: Input date as UK format Pin
Abhinav S27-Jan-10 5:30
Abhinav S27-Jan-10 5:30 
QuestionVS 2008 WPF Designer Bug? Pin
PMBT27-Jan-10 1:24
PMBT27-Jan-10 1:24 
QuestionDrag and drop between ListBox items and Grid cells in WPF? Pin
mittalpa26-Jan-10 13:59
mittalpa26-Jan-10 13:59 
AnswerRe: Drag and drop between ListBox items and Grid cells in WPF? Pin
ProtoBytes27-Jan-10 7:17
ProtoBytes27-Jan-10 7:17 
QuestionPlaying games over internet with WPF apps? Pin
mittalpa26-Jan-10 13:56
mittalpa26-Jan-10 13:56 
AnswerRe: Playing games over internet with WPF apps? Pin
Mark Salsbery27-Jan-10 5:28
Mark Salsbery27-Jan-10 5:28 
AnswerRe: Playing games over internet with WPF apps? Pin
nagisetty128-Jan-10 1:20
nagisetty128-Jan-10 1:20 
QuestionWays to identify which cell was clicked on WPF Grid? Pin
mittalpa26-Jan-10 13:54
mittalpa26-Jan-10 13:54 
AnswerRe: Ways to identify which cell was clicked on WPF Grid? Pin
Mark Salsbery27-Jan-10 5:22
Mark Salsbery27-Jan-10 5:22 
QuestionMVVM application ? Pin
Mohammad Dayyan25-Jan-10 21:38
Mohammad Dayyan25-Jan-10 21:38 
AnswerRe: MVVM application ? Pin
ProtoBytes29-Jan-10 4:04
ProtoBytes29-Jan-10 4:04 
QuestionHelp with deployement Pin
ToddHileHoffer25-Jan-10 8:04
ToddHileHoffer25-Jan-10 8:04 

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.