Beispiel #1
0
        public override string ToString()
        {
            StringBuilder keyframeName = new StringBuilder();

            if (Target is BehaviourComponent)
            {
                BehaviourComponent behaviour = (Target as BehaviourComponent);
                keyframeName.Append(behaviour.Parent.ToString());
                keyframeName.Append(" : ");
                keyframeName.Append(behaviour.ToString());
            }
            else
            {
                keyframeName.Append(Target.ToString());
            }

            keyframeName.Append(" - ");
            keyframeName.Append(Property.Property.Name);

            return(keyframeName.ToString());
        }
 public static BehaviourViewModel GetViewModelProxy(BehaviourComponent behaviour)
 {
     try
     {
         Type vmType = null;
         //Check if we have a viewmodel for this behaviour
         if (behaviourVmMapping.TryGetValue(behaviour.GetType(), out vmType))
         {
             //Create a new instance of this ViewModel
             //the only constructor parameter is the source behaviour this
             //viewmodel is wrapping
             object             instance = Activator.CreateInstance(vmType, behaviour);
             BehaviourViewModel vm       = instance as BehaviourViewModel;
             return(vm);
         }
     }
     catch (Exception e)
     {
         DebugUtil.LogWithLocation($"Error Occured Getting ViewModel for {behaviour.ToString()}");
     }
     return(null);
 }