WPF Animation execute twice

Hi All,
I faced an issue regarding the Animation execute twice, please check the code:
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<ListView x:Name="lstHandled" Grid.Column="0" Visibility="Visible">
<ListViewItem>Jimmy</ListViewItem>
<ListViewItem>Jimmy</ListViewItem>
<ListViewItem>Jimmy</ListViewItem>
<ListViewItem>Jimmy</ListViewItem>
<ListViewItem>Jimmy</ListViewItem>
<ListViewItem>Jimmy</ListViewItem>
<ListViewItem>Jimmy</ListViewItem>
<ListViewItem>Jimmy</ListViewItem>
<ListView.Triggers>
<EventTrigger RoutedEvent="ListView.MouseEnter">
<BeginStoryboard>
<Storyboard>
<ThicknessAnimation
Storyboard.TargetName="spAll"
Storyboard.TargetProperty="(StackPanel.Margin)"
From="-100,0,0,0" To="0,0,0,0"
AutoReverse="False"
Duration="0:0:1"/>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</ListView.Triggers>
</ListView>
<StackPanel x:Name="spAll" Grid.Column="0" Width="100" Margin="-100,0,0,0" Orientation="Horizontal">
<ListView x:Name="Handled">
<ListViewItem>Hello</ListViewItem>
<ListViewItem>Hello</ListViewItem>
<ListViewItem>Hello</ListViewItem>
<ListViewItem>Hello</ListViewItem>
<ListViewItem>Hello</ListViewItem>
<ListViewItem>Hello</ListViewItem>
<ListViewItem>Hello</ListViewItem>
<ListViewItem>Hello</ListViewItem>
</ListView>
<ListView x:Name="UnHandled">
<ListViewItem>World</ListViewItem>
<ListViewItem>World</ListViewItem>
<ListViewItem>World</ListViewItem>
<ListViewItem>World</ListViewItem>
<ListViewItem>World</ListViewItem>
<ListViewItem>World</ListViewItem>
<ListViewItem>World</ListViewItem>
<ListViewItem>World</ListViewItem>
</ListView>
<StackPanel.Triggers>
<EventTrigger RoutedEvent="StackPanel.MouseLeave">
<BeginStoryboard>
<Storyboard>
<ThicknessAnimation
Storyboard.TargetName="spAll"
Storyboard.TargetProperty="(StackPanel.Margin)"
From="0,0,0,0" To="-100,0,0,0"
AutoReverse="False"
Duration="0:0:1"/>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</StackPanel.Triggers>
</StackPanel>
</Grid>
Here is the screenshot:
When the mouse leave the "spAll" StackPanel. It fired the Mouse Enter event for the ListView. How to avoid this issue? 
Thanks a lot!
The future belongs to those who believe in the beauty of their dreams.

You put your other two listviews in the same column of the grid.
Since they're defined later, they will be above the first listview... and cause your problem.
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<ListView x:Name="lstHandled" Grid.Column="0" Visibility="Visible">
<ListViewItem>Jimmy</ListViewItem>
<ListViewItem>Jimmy</ListViewItem>
<ListViewItem>Jimmy</ListViewItem>
<ListViewItem>Jimmy</ListViewItem>
<ListViewItem>Jimmy</ListViewItem>
<ListViewItem>Jimmy</ListViewItem>
<ListViewItem>Jimmy</ListViewItem>
<ListViewItem>Jimmy</ListViewItem>
<ListView.Triggers>
<EventTrigger RoutedEvent="ListView.MouseEnter">
<BeginStoryboard>
<Storyboard>
<DoubleAnimation
Storyboard.TargetName="spAll"
Storyboard.TargetProperty="(StackPanel.Width)"
From="0" To="120"
AutoReverse="False"
Duration="0:0:1"/>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
<EventTrigger RoutedEvent="ListView.MouseLeave">
<BeginStoryboard>
<Storyboard>
<DoubleAnimation
Storyboard.TargetName="spAll"
Storyboard.TargetProperty="(StackPanel.Width)"
From="120" To="0"
AutoReverse="False"
Duration="0:0:1"/>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</ListView.Triggers>
</ListView>
<StackPanel x:Name="spAll" Grid.Column="1" Width="0" Orientation="Horizontal">
<ListView x:Name="Handled">
<ListViewItem>Hello</ListViewItem>
<ListViewItem>Hello</ListViewItem>
<ListViewItem>Hello</ListViewItem>
<ListViewItem>Hello</ListViewItem>
<ListViewItem>Hello</ListViewItem>
<ListViewItem>Hello</ListViewItem>
<ListViewItem>Hello</ListViewItem>
<ListViewItem>Hello</ListViewItem>
</ListView>
<ListView x:Name="UnHandled" Grid.Column="2">
<ListViewItem>World</ListViewItem>
<ListViewItem>World</ListViewItem>
<ListViewItem>World</ListViewItem>
<ListViewItem>World</ListViewItem>
<ListViewItem>World</ListViewItem>
<ListViewItem>World</ListViewItem>
<ListViewItem>World</ListViewItem>
<ListViewItem>World</ListViewItem>
</ListView>
</StackPanel>
</Grid>
The above puts your listviews in different columns, although I'm not 100% sure that's what you wanted to happen.
You would also have to animate the first listview if you want that to disappear.
There's a potential problem there since as you do that your mouse will leave it.
I guess you're probably just kind of playing around learning stuff here though.
 PS
I based this on your first, now deleted, thread.
Hope that helps.
Technet articles: Uneventful MVVM;
All my Technet Articles

Similar Messages

  • After Update Trigger executes twice when single row is uptd thro proc

    We have the below trigger in our db. When a single record is updated using a procedure the trigger is executed twice and it inserts two records in other table.
    But when i issue an update statement using any sql client tool it is executing only once and inserts only one record in other table.
    Can any one please help me to find the reason?
    Trigger:*
    create or replace TRIGGER CX_HEADER_ESCL_T1 AFTER UPDATE OF STATUS ON CX_HEADER
    FOR EACH ROW
    DECLARE
    "b1-CTRIYJ" boolean := FALSE;
    BEGIN
    IF UPDATING('STATUS') AND(:NEW.status = 'SUCCESS') THEN
    "b1-CTRIYJ" := TRUE;
    END IF;
    IF "b1-CTRIYJ" = TRUE THEN
    INSERT
    INTO siebel.s_escl_req(req_id, created, bt_row_id, rule_id, tbl_name, created_by, group_id)
    VALUES('11111111', CURRENT_DATE, :NEW.row_id, '1-CTRIYJ', 'CX_HEADER', :NEW.last_upd_by, '1-2CU3');
    "b1-CTRIYJ" := FALSE;
    END IF;
    END;
    Procedure:
    CREATE OR REPLACE
    PROCEDURE CLOSE_BATCH
    (ChildRecordCount IN NUMBER, HeaderId IN VARCHAR2, CompletionStatus OUT VARCHAR2) AS
    CafeChildCount NUMBER;
    BEGIN
    select count(*) into CafeChildCount from SIEBEL.CX_CHILD where HEADER_ID=HeaderId;
    IF ChildRecordCount = CafeChildCount THEN
    update SIEBEL.CX_HEADER set STATUS ='SUCCESS', MODIFICATION_NUM = MODIFICATION_NUM+1 where HEADER_ID=HeaderId;
    CompletionStatus := 'SUCCESS';
    ELSE
    update SIEBEL.CX_CHILD set STATUS='FAILED' where HEADER_ID=HeaderId;
    update SIEBEL.CX_HEADER set STATUS='FAILED' where HEADER_ID=HeaderId;
    CompletionStatus := 'FAILED';
    END IF;
    commit;
    /*CompletionStatus := 'SUCCESS';*/
    EXCEPTION
    WHEN OTHERS THEN
    CompletionStatus := SQLCODE;
    rollback;
    END;

    Your problem seems not be related to the trigger restart issue I have already mentioned because you are using a AFTER UPDATE trigger and not a BEFORE UPDATE trigger:
    >
    BEFORE Triggers Fired Multiple Times
    If an UPDATE or DELETE statement detects a conflict with a concurrent UPDATE, then Oracle Database performs a transparent ROLLBACK to SAVEPOINT and restarts the update. This can occur many times before the statement completes successfully. Each time the statement is restarted, the BEFORE statement trigger is fired again. The rollback to savepoint does not undo changes to any package variables referenced in the trigger. Your package should include a counter variable to detect this situation.
    >
    If you are sure that you update a single row and that your trigger fires twice and if you can easiily reproduce the issue, I recommend that you contact Oracle Support and create a Service Request for your issue that could be an Oracle bug.

  • Why the code in a user exit is executed twice?

    Hi all,
    I've got a development in a user exit EXIT_SAPMP56T_001.
    This user exit allows us to control the travel expenses.
    When you go to the TX: PR05 you can see a list with travels to add expenses. Here you can select one item on the list and press the edit button to add new expenses.
    We want to control this and we use this user exit for that purpose.
    When the user selects a row and presses the edit button, the user exit is triggered. We can check the values of the table and see which row is selected. But this exit is executed twice. The first time the table doesn't have any changes on it, the second time it has marked the selected row.
    Why is this happening? Why is this exit executed twice? And how can I control that the table is properlly updated?
    Thank you.

    Hi,
    I think this user exist in getting triggered both in the PAI and PBO of that screen.
    For avoiding this use the flag.
    If flag is initial then only your code needs to trigger.
    if flag is initial.
    flag = 'X'.
    then your code.
    endif.
    So when it again comes into the PBO it will check the flag and the same code will not be triggered for the second time.
    With Regards,
    Sumodh.P

  • Why is the last script executed twice?

    Here is my problem. I have two files, file1.sql and file2.sql that are called in a third file test.sql. The output from test.sql show that file2.sql was called twice
    --file1.sql
    select 'file1' as str from dual;
    --file2.sql
    select 'file2' as str from dual;
    --test.sql
    @file1.sql
    @file2.sql
    The output shows:
    STR
    file1
    STR
    file2
    STR
    file2
    Why is the last file execute twice. If I change the order of files in test.sql, then file1 is displayed twice

    I found my problem. In test.sql I had '/' in the last line
    --test.sql
    @file1.sql
    @file2.sql
    /

  • When I schedule a Job, the job is executed twice.

    Post Author: sachinddalal
    CA Forum: Data Integration
    Hello,
    I am using Data Integrator Ver 11.0.2.22. I have scheduled the job through Admin Console. When the job is executed it seems that the job is executed twice.
    On the Status tab onDI Administrator, it shows that both the jobs started at same time. The end time of bot the job is different.
    Any one have any idea how this happens?
    Also any way to ensure that the job are not executed twice.
    Thanks,
    Regards
    Sachin Dalal

    Post Author: bhofmans
    CA Forum: Data Integration
    If you get this issue for a scheduled job only, I might be that the schedule is created twice in the OS scheduler. You could check the windows task scheduler (or cron on UNIX) to check for duplicate schedules.
    If you see this issue also for jobs you execute manually (via webadmin or Designer), you can have this kind of problems if the same jobserver is registered multiple times in a repository. You can check the AL_MACHINE_INFO in your repository. It should have one line for each jobserver and one line for each administrator the repo is connected too. I suspect you have some duplicates there (you can just remove them - this table gets populated when adding a repo in the web admin and when adding a repo to a jobserver in the server manager).

  • Revenue recognition has been executed twice

    HI all
    G/L Balance is not correct as below.
    It looks that some of revenue recognition has been executed twice. There are both items that revenue recognition has been executed twice and items that revenue recognition has been executed once within the same sales order.  I have no idea whether there is any pattern exists or not.  This issue needs to be solved by today .
    what could be the reason, can any one help me on this.
    Thanks in advance,
    Raju

    Hi Raju,
    Can u explain us in detail,
    It can be the reason like if the revenue recog is replicating through some nightly job, there r different cases it may ran twice(relication has done twice).
    Best regards
    Bhupathi.

  • Init() method is executing twice

    Hi,
    I have a servlet & implemented the init() method. But, the init() method is executing twice.
    Also, the destroy() method is executing twice.
    Any input guys.
    Thanks

    JAXMServlet most certainly IS an HttpServlet - the javadocs that I see say it extends HttpServlet. It won't be very useful in a SOAP implementation if it's not.
    I thought the SingleThreadModel interface. Why? I thought that was a bad practice that was discouraged. What writable data members does this "test" servlet have that require such careful treatment? If your servlet implements doGet and doPost methods, with only local variables, it'll be thread-safe enough.
    I follow the Sun Java coding standards, even for dash-off classes. "test" should be capitalized. Is there no more descriptive name you can think of?
    I'm not aware of a problem with Tomcat, and I haven't checked the bug list. But I'd put my money on your code being the problem here. Do you call super.init() in your servlet's init() method? Maybe you're seeing the superclass init() being called?
    %

  • ActionPerformed-method executed twice...

    Please help!
    My program behaves strangely; the actionPerformed method on a button is executed twice. The first execution completes the method as it should and makes changes to the model as it should. Then there comes the second execution triggered BY THE SAME BUTTON AT THE SAME TIME as the first execution. How is this possible? And how to fix things? There are no external triggers to the button.
    Here is the example code showing the method actionPerformed and the output that it prints.
    * Method to run when an answer is selected
    public void actionPerformed(ActionEvent arg0) {
    // Printout info on the action
    System.out.println("EKO actionPerformed-method at beginning. Game level " + mymodel.getLevel());
    System.out.println("EKO action command: " + arg0.getActionCommand());
    System.out.println("EKO action was: " + arg0.ACTION_PERFORMED);
    System.out.println("EKO action time: " + arg0.getWhen());
    // Disable buttons
    enableButtons(false);
    // Call method setVastattu to notify the observers that an answer
    // has already been selected (e.g. probressBar needs to be stopped)
    mymodel.setAnswered();
    if (arg0.getActionCommand()==mymodel.getKysymys()[1])
    System.out.println("EKO answer was correct. Game level " + mymodel.getLevel());
    // Call a method to set new choice texts on the buttons and to set the game level one higher
    mymodel.levelUp();
    System.out.println("EKO after levelUp-method. Game level " + mymodel.getLevel());
    else {
    JOptionPane.showMessageDialog(this, "Wrong answer!");
    mymodel.setWrongAnswer();
    EKO actionPerformed-method at beginning. Game level 1
    EKO action command: Kuurupiilo
    EKO action was: 1001
    EKO action time: 1133534802433
    EKO answer was correct. Game level 1
    EKO levelUp method is setting game level to level 2
    EKO after levelUp-method. Game level 2
    EKO actionPerformed-method at beginning. Game level 2
    EKO action command: Punahilkka
    EKO action was: 1001
    EKO action time: 1133534805567
    EKO answer was correct. Game level 2
    EKO levelUp method is setting game level to level 3
    EKO after levelUp-method. Game level 3
    EKO actionPerformed-method at beginning. Game level 3 <= WHY AGAIN???
    EKO action command: Punahilkka <= SAME ACTION HAS ALREADY BEEN HANDLED
    EKO action was: 1001 <= SAME ACTION HAS ALREADY BEEN HANDLED
    EKO action time: 1133534805567 <= EVEN THE ACTION TIME IS THE SAME...

    WOW!
    Exactly! I indeed had the actionlistener added twice. I did not even know that it is possible to have several overlapping actionlisteners! Now my code works fine. Thank you very, very much!
    Elisa

  • Servlet being executed twice

              Hi all,
              I'm running WLS5.1, SP8 on W2K. I've written a servlet that instantiates and persists an entity bean. The servlet is registered in web.xml and mapped appropriately. If I run the servlet through the browser, everything works as expected.
              I've written a test case that opens a HttpURLConnection to the servlet, and instead of posting the data from a form (like through the browser), I appended the parameters to the querystring. When the test case executes, the servlet is executed twice, creating two identical rows in the database. So my test case fails expecting the entity to be unique.
              I see two servlet inits happening:
              <WebAppServletContext-vivaceApp> RequestProcessor: init
              and
              <ServletContext-General> classes: init
              Any ideas why this request is submitted twice?
              -EC
              

    What you might want to do instead of sending email directly from the trigger, is create a job which sends the email. This way you make the sending of the email part of your transaction. When you issue a commit, the job gets submitted and the email is sent. When you rollback, the job is removed and no email is sent.

  • Safari 3.2.1 on Leopard single call to cause Oracle report execute twice

    We have a web application that uses javascripts window.open(url) to call an Oracle rdf report and displays report result in pdf format. For unknown reason, the Oracle report got executed twice when only called once from Safari. It only happens in Safari 3.2.1 on Leopard, not in Safari on Tiger. Can you please shed some lights on how Safari works in this matter? Thank you very much, Steve

    Hi Steve,
    It's going to be impossible for anyone to debug with such limited information
    You're more likely to get some JavaScript experts chipping in if you can post some good examples of the code to demonstrate the problematic parts.
    Have you tried running the same code in Firefox with the Firebug extension to confirm the logic is functioning correctly? It's possible that Firebug might indicate where things are going wrong but for whatever reason the bug isn't exposed in Firefox.

  • What if GRANTS statement are executed twice?

    What happens if GRANTS statments are executed twice?
    Will there be any error thrown at the time of second execution?
    And will we need to revert twice in case we need to remove the GRANTS?
    Does it matter which user can give GRANTS if the user has the ccess to pass on the GRANTS for a particular object?
    thanks,
    tik

    To add to what Sybrand said, as long as the username that runs the grant script has the necessary privilege then who issues the grants does not matter. However you cannot directly grant privileges for another users object to yourself even if you can grant them to another user so if the username who ran the script was intended to receive some of the grants then you definitely need to rerun the script.
    Rerunning the script as the intended user would not hurt anything. Only one revoke would be necessary to remove any granted privilege and it can be issued by any user with the privilege necessary to perform the revoke such as the object owner or a DBA.
    HTH -- Mark D Powlel --

  • Action executing twice while loading tiles

    hi
    I am arun
    I am using tiles-def.xml to load my layout
    actuaaly merequest going in following way
    jsp-->action--->actionforward-->sucess(layoutpage)
    jsp is executing only once
    but when the requet reaches action
    action is executing twice
    can anyone help me onthis

    Hi Udaykumar,
    Where did u removed the symbol (#).. In ur JSP (or) in tiles-def.xml (or) in action..?
    regards,
    Satheesh.J

  • Code executing twice???

    Hello,
    My Java Swing/AWT application uses back-end PostgreSQL database. The code seems to execute twice (I see it from printout statements). Does anybody have an idea why that happens?
    TIA.

    A very wild guess:
    you could have GUI components changing the model and the model changing the gui.
    If not richly spread with if tests on real changes, you could get something twice.
    Also some GUI components give two almost same messages: selection i.e.
    Furthermore while updating your app should not be able to trigger a next update. That could arise by wrong synchronizing:
    if (cond) {
        synchronize (obj) {
            // update
    ...

  • JSP executing twice

    I am calling one JSP from another, via a Javascript function, as I am using the onclick event of an image button. I am using the following code in the calling JSP:
    <INPUT onclick="nextcitation(this.document)" accesskey="N" type="IMAGE" src="images/nextCitation1.gif">
    and the javascript function is as follows:
    function nextcitation(d)
    d.myform.action = "nccaNextCitation.jsp"
    d.myform.submit();
    return false;
    The called jsp, "nccaNextCitation.jsp" sometimes executes once, like it should, and other times it executes twice, using a second newly spawned thread. This causes a real problem, as I am using this JSP to call a servlet which feeds keystrokes in a screen scraping application to a legacy mainframe app.
    It's the inconsistency part to this that's driving me crazy. If it always happened on the first time the button was clicked or the 2nd time, it would be much easier to debug. As it is, it some time happens right away, and other times will be ok until the 5th or 6th time.
    I've searched the forums and google, and have found a few references where this happens, but none of the suggestions (mainly adding "return false") have worked.
    Is there some browser setting or something in the response header I should be looking for?
    I'm using IE 6.0 and WSAD 4.0.3 as my development tool/server.
    Thanks!

    An image input control is really a submit control. Double-submission can happen if you have an onClick handler on a submit button and have that method also do a form.submit(). You can recreate this problem using the following code (irrelevant sections are left out):
    function submitTheForm() {
        document.form.submit();
    <form>
    <input type="submit" name="submitthisform" value="Click Me" onClick="submitTheForm()">
    </form>In the above case, the form itself is submitted in response to the submit button being clicked, but also in response to the form.submit() call.
    Instead of using an image control, why not just use an HREF around an image instead? For example:
    <img src="images/nextCitation1.gif" border="0">
    Michael

  • Methods of Workitem execute twice

    hello experts,
    in my workitem (activity  methods Tab), before work item execution there is a method to  display image, after the work item execution there is a method to close window.
    after our systerm imported new support packages,the methods execute twice. i can not find the reason and solution.
    i guess there is an inconsistent in systerm's time zone management, which is causing the time to execute display image and window close methods before workitem creation time.
    please give me your suggestions?
    Thanks in advance!

    What's worse is that it seems now your messages have started posting thrice
    Just a small note to remind you that version can be important, especially in this case where you have a problem related to packages. So you should include version information (release, support package level) in your description of the problem.
    Sorry I can't be of more help with respect to the problem itself.

Maybe you are looking for

  • After upgrading to Mountain Lion, I can't delete/move emails using Mail app

    I upgraded to Mountain Lion from Snow Leopard and having problems with my Mail application. The long and short of it is that I cannot delete or move emails from my Inbox.  When I select an email in the preview panel and delete it, it disappears, but

  • Pass parameter from Portlet to Form?

    Hi Frineds I created a plsql portlet in which i am displaying a combo box with the list of client id's I created a Form from locally built Provider which got a client ID as one of the column. My question is. If the user selects client id from combobo

  • Drag and drop image into 2d Picture

    Hi All, I'm trying to implement a bit of "MS paint" magic for a customer's dialog. I want to be able to drag and drop into a 2d picture control. Ideally, I'd like to be able to move this around and resize it once it's there, but let's start with the

  • Javax.naming.NameNotFoundException in Jdeveloper 10g

    HI, I just migrate my source code from Jdeveloper 9 to Jdeveloper 10g. Since then, all my codes do not work properly. I cut and pasted from old version data-source.xml to 10g data-source.xml. However, when I run the project, I got javax.naming.NameNo

  • IPhone 3 GS gives unknown error -1 after reboot

    Mij iPhone 3 GS can not restored in iTunes. i tried it several times but every time de error (-1) occurs. (-1) seems to beeen hardwareproblem. Is their any experience whit this error?