Beispiel #1
0
        protected void OnPropertyChanged(string name, System.ComponentModel.PropertyChangedEventArgs inner)
        {
            TunneledPropertyChangedEventArgs e = new TunneledPropertyChangedEventArgs(name, this, inner);

            OnPropertyChanged(e);

            //TunneledPropertyChangedEventArgs innerTunned = inner as TunneledPropertyChangedEventArgs;
            //if ( inner != null && innerTunned == null )
            //    innerTunned = new TunneledPropertyChangedEventArgs ( inner.PropertyName, null, null );

            if (!m_isDisableOnChange)
            {
                DoPropertyChanged(e);

                DoPropertiesChanged(this, new [] { new Pair <string, TunneledPropertyChangedEventArgs> (e.PropertyName, e) });
            }
            else if (m_isTrackChanges)
            {
                lock (m_propertiesListSync)
                    if (!m_propertiesChanged.Any(item => item.A == name && item.B == inner))
                    {
                        m_propertiesChanged.Add(new Pair <string, TunneledPropertyChangedEventArgs> (name, e));
                    }

                m_needsChangeFired = true;
            }
        }
Beispiel #2
0
     protected IEnumerable <Pair <object, string> > GetAllInnerPropertiesChanged( )
     {
         if (Inner != null)
         {
             TunneledPropertyChangedEventArgs oInner = Inner as TunneledPropertyChangedEventArgs;
             if (oInner != null)
             {
                 return(oInner.GetAllPropertiesChanged( ));
             }
             else
             {
                 return new Pair <object, string> [] { new Pair <object, string> (null, Inner.PropertyName) }
             };
         }
         return(EmptyList);
     }
 }
Beispiel #3
0
        protected void OnPropertyChanged(string name)
        {
            TunneledPropertyChangedEventArgs e = new TunneledPropertyChangedEventArgs(name, this, null);

            OnPropertyChanged(e);

            if (!m_isDisableOnChange)
            {
                DoPropertyChanged(e);

                DoPropertiesChanged(this, new [] { new Pair <string, TunneledPropertyChangedEventArgs> (e.PropertyName, e) });
            }
            else if (m_isTrackChanges)
            {
                lock (m_propertiesListSync)
                    if (!m_propertiesChanged.Any(item => item.A == name))
                    {
                        m_propertiesChanged.Add(new Pair <string, TunneledPropertyChangedEventArgs> (name, e));
                    }

                m_needsChangeFired = true;
            }
        }