Beispiel #1
0
        protected virtual void OnPropertyChanged(string PropName, object Oldvalue, object NewValue)
        {
            if (Oldvalue == NewValue)
            {
                return;
            }

            Editored = true;

            if (PropName != "IsSelected" && PropName != "Visible")
            {
                if (!m_isUndoRedoing)
                {
                    //await Task.Run(() =>
                    //{
                    PropertyRedoUndoCommand cmm = null;

                    lock (m_EditCacheDic)
                    {
                        if (m_EditCacheDic.ContainsKey(PropName))
                        {
                            cmm          = m_EditCacheDic[PropName];
                            cmm.NewValue = NewValue;
                        }
                        else
                        {
                            cmm = new PropertyRedoUndoCommand(this, PropName, Oldvalue, NewValue);
                            m_EditCacheDic.Add(PropName, cmm);
                        }
                    }

                    //});
                }
                if (!(m_isEditting || m_isUndoRedoing))
                {
                    OnModified();
                }
            }


            RaisePropertyChanged(PropName);
        }
        protected virtual void OnPropertyChanged(string PropName, object Oldvalue, object NewValue)
        {
            if (Oldvalue == NewValue)
            {
                return;
            }

            if (PropName != "IsSelected" && PropName != "Visible")
            {
                if (!m_isUndoRedoing)
                {
                    //await Task.Run(() =>
                    //{
                    PropertyRedoUndoCommand cmm = null;

                    lock (m_EditCacheDic)
                    {
                        if (m_EditCacheDic.ContainsKey(PropName))
                        {
                            cmm = m_EditCacheDic[PropName];
                            cmm.NewValue = NewValue;
                        }
                        else
                        {
                            cmm = new PropertyRedoUndoCommand(this, PropName, Oldvalue, NewValue);
                            m_EditCacheDic.Add(PropName, cmm);
                        }
                    }

                    //});
                }
                if (!(m_isEditting || m_isUndoRedoing))
                {
                    OnModified();
                }
            }


            RaisePropertyChanged(PropName);
        }