locked
Changing states inside of a template RRS feed

  • Question

  • I am trying to edit a media player template.  I have added two new states.  I would like to GoToState when someone mousesover the playerFrame.   I put the template copy in a separate ResourceDictionary file.   Although I am going to try putting the template copy in the same file and see if I can do codebehind, I would like to know if there is a way to keep it separate and change to the states I created.

    The way it is now... If I try to put a behavior (or trigger) in the template, I get a run error

    Webpage error details

    Message: Unhandled Error in Silverlight Application Target ChildBorder does not define any VisualStateGroups.    at Microsoft.Expression.Interactivity.Core.GoToStateAction.OnTargetChanged(FrameworkElement oldTarget, FrameworkElement newTarget)
       at System.Windows.Interactivity.TargetedTriggerAction`1.OnTargetChangedImpl(Object oldTarget, Object newTarget)
       at System.Windows.Interactivity.TargetedTriggerAction.OnTargetChanged(Object sender, NameResolvedEventArgs e)
       at System.Windows.Interactivity.NameResolver.OnObjectChanged(DependencyObject oldTarget, DependencyObject newTarget)
       at System.Windows.Interactivity.NameResolver.UpdateObjectFromName(DependencyObject oldObject)
       at System.Windows.Interactivity.NameResolver.OnNameScopeReferenceLoaded(Object sender, RoutedEventArgs e)
       at MS.Internal.CoreInvokeHandler.InvokeEventHandler(Int32 typeIndex, Delegate handlerDelegate, Object sender, Object args)
       at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, String eventName)
    Line: 1
    Char: 1
    Code: 0
    URI: http://localhost:53087/Silverlight.js

    If I click on playerFrame events to add code behind MouseEnter, I see "The document Item has no code-behind file.  Add a code-behind file and a class definition before adding event handlers.

    Tuesday, May 25, 2010 4:25 AM