Ejemplo n.º 1
0
        private void OnDataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
        {
            if (this.DataContext is CharacterDetails details)
            {
                details.ActorID.PropertyChanged += this.ActorIdChanged;

                this.ViewModel = new SimplePoseViewModel(details);
                this.ContentArea.DataContext = this.ViewModel;
            }
        }
Ejemplo n.º 2
0
        private void OnViewModelPropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
        {
            this.UpdateState();

            if (e.PropertyName == nameof(this.viewModel.FlipSides))
            {
                this.SetBone(SimplePoseViewModel.GetBoneName(this.BoneName, this.viewModel.FlipSides));
            }
            if (e.PropertyName == nameof(this.viewModel.Bones))
            {
                this.SetBone(this.BoneName);
            }
        }
Ejemplo n.º 3
0
        private void BindDataContext()
        {
            try
            {
                if (this.DataContext is SimplePoseViewModel viewModel)
                {
                    this.viewModel = viewModel;
                    this.viewModel.PropertyChanged += this.OnViewModelPropertyChanged;

                    this.SetBone(this.BoneName);
                }
                else
                {
                    this.IsEnabled = false;
                }
            }
            catch (Exception ex)
            {
                this.IsEnabled = false;
                this.ToolTip   = ex.Message;
                Console.WriteLine(ex.Message);
                this.BackgroundElipse.Stroke = Brushes.Red;
            }
        }