Пример #1
0
        private void SetBone(string name)
        {
            if (this.bone != null)
            {
                if (boneViews.ContainsKey(this.bone))
                {
                    boneViews[this.bone].Remove(this);
                }
            }

            this.bone    = viewModel.GetBone(name);
            this.ToolTip = this.bone.Tooltip;

            if (!boneViews.ContainsKey(this.bone))
            {
                boneViews.Add(this.bone, new List <SimplePoseBoneView>());
            }

            boneViews[this.bone].Add(this);

            this.ToolTip   = this.bone.Tooltip;
            this.IsEnabled = true;

            // Wait for all bone views to load, then draw the skeleton
            Application.Current.Dispatcher.InvokeAsync(async() =>
            {
                await Task.Delay(1);
                this.DrawSkeleton();
                this.UpdateState();
            });
        }
Пример #2
0
 public static bool HasView(SimplePoseViewModel.Bone bone)
 {
     return(boneViews.ContainsKey(bone));
 }