DoubleAnimation im code DoubleAnimation im code
Ergebnis 1 bis 2 von 2
  1. 22.11.2012, 09:12
    #1
    hi leutz,

    ich versuch grad eine DoubleAnimation zu coden ... klappt leider nur nich so ganz :/

    es wird bei
    Code:
    sb.Begin();
    immer folgende exception geworfen:

    In System.InvalidOperationException ist eine Ausnahme vom Typ "System.Windows.ni.dll" aufgetreten, doch wurde diese im Benutzercode nicht verarbeitet.
    und hier mal der komplette code:

    Code:
    if (Controller.GetController().CheckResult(Convert.ToInt32(resultBlock.Text)))
                    resultInfoRect.Fill = new SolidColorBrush(Colors.Green);
                else
                    resultInfoRect.Fill = new SolidColorBrush(Colors.Red);
    
                DoubleAnimation da = new DoubleAnimation();
                da.AutoReverse = true;
                da.Duration = new Duration(new TimeSpan(0, 0, 0, 0, 500));
                da.From = 0;
                da.To = 1;
    
                Storyboard sb = new Storyboard();
                sb.Children.Add(da);
                Storyboard.SetTargetName(da, resultInfoRect.Name);
                Storyboard.SetTargetProperty(da, new PropertyPath(Rectangle.OpacityProperty));
    
                sb.Begin();

    eigentlich hab ich mich dabei an die msdn gehalten ...
    weiss einer wo das problem is?
    0
     

  2. 25.11.2012, 11:55
    #2
    niemand eine idee?

    edit: ich habe noch etwas herrausgefunden!
    er schreibt noch

    {System.InvalidOperationException: Cannot resolve TargetName resultInfoRect. at MS.Internal.XcpImports.CheckHResult(UInt32 hr) at MS.Internal.XcpImports.Storyboard_Begin(Storyboard storyboard) at System.Windows.Media.Animation.Storyboard.Begin() at MentalMathInstructor.CalculatePage.buttonE_Click(Object sender, RoutedEventArgs e)}
    wieso "Cannot resolve TargetName resultInfoRect" ?? das is auf jedenfall der richtige name ... so heisst auch mein Rectangle :/

    ---------- Hinzugefügt um 12:55 ---------- Vorheriger Beitrag war um 11:20 ----------

    Ok ich habs hinbekommen!

    ich hab das Rectangle nun im Code selbst erstellt und nich wie vorher in xaml (bin mir aber nich sicher ob das auch nötig is)
    und dann fehlte noch [csharp]LayoutRoot.Resources.Add("unique_id", sb);[/csharp]
    in LayoutRoot befindet sich das zu animierende Rectangle
    1
     

Ähnliche Themen

  1. qr-code kalenderfunktion
    Von lowtune2000 im Forum Windows Phone 7 Apps
    Antworten: 5
    Letzter Beitrag: 14.08.2013, 09:37
  2. Code vergessen
    Von kunne im Forum Apple iPhone 4/S
    Antworten: 13
    Letzter Beitrag: 27.10.2011, 22:01
  3. QR-Code
    Von srt6 im Forum Samsung Galaxy Tab
    Antworten: 2
    Letzter Beitrag: 05.02.2011, 14:00
  4. GSM Code
    Von xdobiwan im Forum Touch HD Communication
    Antworten: 0
    Letzter Beitrag: 14.06.2010, 13:28
  5. Code MEMO
    Von Türk82 im Forum HTC Touch Diamond 2
    Antworten: 9
    Letzter Beitrag: 01.07.2009, 07:43

Besucher haben diese Seite mit folgenden Suchbegriffen gefunden:

storyboard.begin ni.dll

in system.invalidoperationexception ist eine ausnahme vom typ system.windows.ni.dll

System.InvalidOperationException at MS.Internal.XcpImports.CheckHResult(UInt32 hr) at MS.Internal.XcpImports.Storyboard_Begin(Storyboard storyboard) at System.Windows.Media.Animation.Storyboard.Begin()

windows phone System.InvalidOperationException System.Windows.ni.dll

Stichworte