private void MainAnimationChanged(AssetPlayerItem oldAnimation, AssetPlayerItem mainAnimation) { if (oldAnimation != null) { oldAnimation.Asset.Player.OnFrameChanged -= Player_OnFrameChanged; } SelectedAnimationFrameCount = mainAnimation.MaxFrames; mainAnimation.Asset.Player.OnFrameChanged += Player_OnFrameChanged; }
public void RegisterAsset(AssetViewModel asset) { _assetList.Add(asset); PlayerItems.Add(new AssetPlayerItem(asset)); asset.Player.LoopAnimation = false; if (SelectedMainAnimation == null) { SelectedMainAnimation = PlayerItems.First(); } OnEnableChanged(IsEnabled); }