Ejemplo n.º 1
0
        /// <summary>
        /// Sets up property changed.
        /// </summary>
        /// <param name="nativeCell">Native cell.</param>
        protected void SetUpPropertyChanged(CellBaseView nativeCell)
        {
            var formsCell     = nativeCell.Cell as CellBase;
            var parentElement = formsCell.Parent as SettingsView;

            formsCell.PropertyChanged += nativeCell.CellPropertyChanged;

            if (parentElement != null)
            {
                parentElement.PropertyChanged += nativeCell.ParentPropertyChanged;
            }
        }
        void ClearPropertyChanged(CellBaseView nativeCell)
        {
            var formsCell     = nativeCell.Cell as CellBase;
            var parentElement = formsCell.Parent as SettingsView;

            formsCell.PropertyChanged -= nativeCell.CellPropertyChanged;
            if (parentElement != null)
            {
                parentElement.PropertyChanged -= nativeCell.ParentPropertyChanged;
                if (formsCell.Section != null)
                {
                    formsCell.Section.PropertyChanged -= nativeCell.SectionPropertyChanged;
                }
            }
        }
        /// <summary>
        /// Sets up property changed.
        /// </summary>
        /// <param name="nativeCell">Native cell.</param>
        protected void SetUpPropertyChanged(CellBaseView nativeCell)
        {
            var formsCell     = nativeCell.Cell as CellBase;
            var parentElement = formsCell.Parent as SettingsView;

            formsCell.PropertyChanged += nativeCell.CellPropertyChanged;

            if (parentElement != null)
            {
                parentElement.PropertyChanged += nativeCell.ParentPropertyChanged;
                var section = parentElement.Model.GetSection(SettingsModel.GetPath(formsCell).Item1);
                if (section != null)
                {
                    formsCell.Section = section;
                    formsCell.Section.PropertyChanged += nativeCell.SectionPropertyChanged;
                }
            }
        }