// Token: 0x060043F6 RID: 17398 RVA: 0x00136244 File Offset: 0x00134444
        private static void OnContentChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            ContentPresenter contentPresenter = (ContentPresenter)d;

            if (!contentPresenter._templateIsCurrent)
            {
                return;
            }
            bool flag;

            if (e.NewValue == BindingExpressionBase.DisconnectedItem)
            {
                flag = false;
            }
            else if (contentPresenter.ContentTemplate != null)
            {
                flag = false;
            }
            else if (contentPresenter.ContentTemplateSelector != null)
            {
                flag = true;
            }
            else if (contentPresenter.Template == ContentPresenter.UIElementContentTemplate)
            {
                flag = true;
                contentPresenter.Template = null;
            }
            else if (contentPresenter.Template == ContentPresenter.DefaultContentTemplate)
            {
                flag = true;
            }
            else
            {
                Type   type;
                object obj  = ContentPresenter.DataTypeForItem(e.OldValue, contentPresenter, out type);
                object obj2 = ContentPresenter.DataTypeForItem(e.NewValue, contentPresenter, out type);
                flag = (obj != obj2);
                if (!flag && contentPresenter.RecognizesAccessKey && typeof(string) == obj2 && contentPresenter.IsUsingDefaultStringTemplate)
                {
                    string text  = (string)e.OldValue;
                    string text2 = (string)e.NewValue;
                    bool   flag2 = text.IndexOf(AccessText.AccessKeyMarker) > -1;
                    bool   flag3 = text2.IndexOf(AccessText.AccessKeyMarker) > -1;
                    if (flag2 != flag3)
                    {
                        flag = true;
                    }
                }
            }
            if (flag)
            {
                contentPresenter._templateIsCurrent = false;
            }
            if (contentPresenter._templateIsCurrent && contentPresenter.Template != ContentPresenter.UIElementContentTemplate)
            {
                contentPresenter.DataContext = e.NewValue;
            }
        }