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

WPF

 
GeneralRe: taking the control Pin
Hema Bairavan31-May-09 23:27
Hema Bairavan31-May-09 23:27 
QuestionPlz help in couple of think in ListView Pin
wasimsharp31-May-09 19:13
wasimsharp31-May-09 19:13 
AnswerRe: Plz help in couple of think in ListView Pin
ABitSmart31-May-09 20:38
ABitSmart31-May-09 20:38 
Questionhow to animate the button in sequencial mode ? Pin
Feras Mazen Taleb31-May-09 1:53
Feras Mazen Taleb31-May-09 1:53 
AnswerRe: how to animate the button in sequencial mode ? Pin
ABitSmart31-May-09 2:37
ABitSmart31-May-09 2:37 
GeneralRe: how to animate the button in sequencial mode ? Pin
Feras Mazen Taleb31-May-09 7:29
Feras Mazen Taleb31-May-09 7:29 
GeneralRe: how to animate the button in sequencial mode ? Pin
Feras Mazen Taleb1-Jun-09 23:59
Feras Mazen Taleb1-Jun-09 23:59 
GeneralRe: how to animate the button in sequencial mode ? Pin
Feras Mazen Taleb2-Jun-09 2:03
Feras Mazen Taleb2-Jun-09 2:03 
this is the last thing I Achieved :
I added the animation to the buttons programmatically

this is the code behind file :
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Media.Animation;

namespace practiceOnAnimationClasses
{
    /// <summary>
    /// Interaction logic for Window1.xaml
    /// </summary>
    public partial class Window1 : Window
    {
        public Window1()
        {
            InitializeComponent();
        }

        DoubleAnimationUsingPath Animation1 = new DoubleAnimationUsingPath();

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            List<Button> buttons = new List<Button>(5);
            buttons.Add(new Button() { Width = 120d, Height = 75d, Content = "Advertisement 1" });
            buttons.Add(new Button() { Width = 120d, Height = 75d, Content = "Advertisement 2" });
            buttons.Add(new Button() { Width = 120d, Height = 75d, Content = "Advertisement 3" });
            buttons.Add(new Button() { Width = 120d, Height = 75d, Content = "Advertisement 4" });
            buttons.Add(new Button() { Width = 120d, Height = 75d, Content = "Advertisement 5" });

            // Storyboard AnimationRectanglePath = (Storyboard)this.Resources["StoryboardPath"];

            int count = 0;
            foreach (var item in buttons)
            {
                MainCanvas.Children.Add(item);
                DoubleAnimation myDoubleAnimation = new DoubleAnimation();
                myDoubleAnimation.From = 75 + (count * item.Width);
                myDoubleAnimation.To = 800;
                myDoubleAnimation.Duration = new Duration(TimeSpan.FromSeconds(15));
                myDoubleAnimation.AutoReverse = false;
                myDoubleAnimation.RepeatBehavior = RepeatBehavior.Forever;

                // Apply the animation to the button's Width property.
                item.BeginAnimation(Canvas.LeftProperty, myDoubleAnimation);
                count++;
            }
        }
    }
}


Xaml File it only contains the mainCanvas that I will Add
Buttons to It

the movement is very creasy and wrong How Can I make the movement
like photo gallery
<Window x:Class="practiceOnAnimationClasses.Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Window1" Height="300" Width="563" Loaded="Window_Loaded">
    <Window.Resources>
        <!--<Storyboard x:Key="StoryboardPath">
            <DoubleAnimationUsingPath BeginTime="00:00:00" Duration="00:00:02" Storyboard.TargetName="button" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Source="X">
                <DoubleAnimationUsingPath.PathGeometry>
                    <PathGeometry Figures="M-3,2 L363,2 L363,83 L-3,83 z"/>
                </DoubleAnimationUsingPath.PathGeometry>
            </DoubleAnimationUsingPath>
            <DoubleAnimationUsingPath BeginTime="00:00:00" Duration="00:00:02" Storyboard.TargetName="button" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)" Source="Y">
                <DoubleAnimationUsingPath.PathGeometry>
                    <PathGeometry Figures="M-3,2 L363,2 L363,83 L-3,83 z"/>
                </DoubleAnimationUsingPath.PathGeometry>
            </DoubleAnimationUsingPath>
        </Storyboard>-->
    </Window.Resources>
    
    <Canvas Name="MainCanvas"></Canvas>
</Window>


You have To Search About The Truth Of Your Life
Why Are you Here In Life ?

AnswerRe: how to animate the button in sequencial mode ? Pin
Pete O'Hanlon2-Jun-09 2:11
mvePete O'Hanlon2-Jun-09 2:11 
GeneralRe: how to animate the button in sequencial mode ? Pin
Feras Mazen Taleb2-Jun-09 2:28
Feras Mazen Taleb2-Jun-09 2:28 
AnswerRe: how to animate the button in sequencial mode ? Pin
Feras Mazen Taleb2-Jun-09 21:04
Feras Mazen Taleb2-Jun-09 21:04 
GeneralRe: how to animate the button in sequencial mode ? Pin
Feras Mazen Taleb7-Jun-09 3:54
Feras Mazen Taleb7-Jun-09 3:54 
QuestionImage on Button Pin
Member 232448330-May-09 9:11
Member 232448330-May-09 9:11 
AnswerRe: Image on Button Pin
ABitSmart30-May-09 16:51
ABitSmart30-May-09 16:51 
AnswerRe: Image on Button Pin
Mark Salsbery31-May-09 8:14
Mark Salsbery31-May-09 8:14 
QuestionProblem executing BitmapDecoder.Save() in worker thread [modified] Pin
fjparisIII30-May-09 8:50
fjparisIII30-May-09 8:50 
AnswerRe: Problem executing BitmapDecoder.Save() in worker thread (solved through egregious kludge) Pin
fjparisIII30-May-09 12:38
fjparisIII30-May-09 12:38 
AnswerRe: Problem executing BitmapDecoder.Save() in worker thread [modified] Pin
Mark Salsbery31-May-09 8:30
Mark Salsbery31-May-09 8:30 
GeneralRe: Problem executing BitmapDecoder.Save() in worker thread Pin
fjparisIII31-May-09 11:42
fjparisIII31-May-09 11:42 
GeneralRe: Problem executing BitmapDecoder.Save() in worker thread Pin
Mark Salsbery31-May-09 12:26
Mark Salsbery31-May-09 12:26 
GeneralRe: Problem executing BitmapDecoder.Save() in worker thread Pin
fjparisIII31-May-09 13:50
fjparisIII31-May-09 13:50 
GeneralRe: Problem executing BitmapDecoder.Save() in worker thread Pin
fjparisIII31-May-09 18:46
fjparisIII31-May-09 18:46 
GeneralRe: Problem executing BitmapDecoder.Save() in worker thread Pin
Mark Salsbery31-May-09 20:18
Mark Salsbery31-May-09 20:18 
GeneralRe: Problem executing BitmapDecoder.Save() in worker thread Pin
fjparisIII1-Jun-09 5:42
fjparisIII1-Jun-09 5:42 
GeneralRe: Problem executing BitmapDecoder.Save() in worker thread Pin
Mark Salsbery1-Jun-09 6:47
Mark Salsbery1-Jun-09 6:47 

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.