public static ElementAnimationsViewModel FromSave(ElementAnimationsSave save, Gum.DataTypes.ElementSave element)
        {
            ElementAnimationsViewModel toReturn = new ElementAnimationsViewModel();

            foreach (var animation in save.Animations)
            {
                var vm = AnimationViewModel.FromSave(animation, element);
                toReturn.Animations.Add(vm);
            }

            return(toReturn);
        }
Exemplo n.º 2
0
        public static ElementAnimationsViewModel FromSave(ElementAnimationsSave save, Gum.DataTypes.ElementSave element)
        {
            ElementAnimationsViewModel toReturn = new ElementAnimationsViewModel();

            foreach(var animation in save.Animations)
            {
                var vm = AnimationViewModel.FromSave(animation, element);
                toReturn.Animations.Add(vm);
            }

            return toReturn;
        }
Exemplo n.º 3
0
        private void RefreshViewModel()
        {
            ElementSave currentlyReferencedElement = null;
            if(mCurrentViewModel != null)
            {
                currentlyReferencedElement = mCurrentViewModel.Element;
            }

            if (currentlyReferencedElement != SelectedState.Self.SelectedElement)
            {
                mCurrentViewModel = AnimationCollectionViewModelManager.Self.CurrentAnimationCollectionViewModel;

                if (mCurrentViewModel != null)
                {
                    mCurrentViewModel.PropertyChanged += HandlePropertyChanged;
                    mCurrentViewModel.AnyChange += HandleDataChange;
                }

            }
            if (mMainWindow != null)
            {
                mMainWindow.DataContext = mCurrentViewModel;
            }
        }