Пример #1
0
        /// <summary>
        /// Determines the interesting view properties.
        /// </summary>
        /// <returns>A list of names with view properties to subscribe to.</returns>
        private List <string> DetermineInterestingViewProperties()
        {
            var targetViewType = TargetViewType;

            var finalProperties = new List <string>();

            if ((_viewPropertySelector == null) || (_viewPropertySelector.MustSubscribeToAllViewProperties(targetViewType)))
            {
                var viewProperties = TargetView.GetProperties();
                finalProperties.AddRange(viewProperties);
            }
            else
            {
                var propertiesToSubscribe = new HashSet <string>(_viewPropertySelector.GetViewPropertiesToSubscribeTo(targetViewType));
                if (!propertiesToSubscribe.Contains("DataContext"))
                {
                    propertiesToSubscribe.Add("DataContext");
                }

                foreach (var propertyToSubscribe in propertiesToSubscribe)
                {
                    if (!finalProperties.Contains(propertyToSubscribe))
                    {
                        finalProperties.Add(propertyToSubscribe);
                    }
                }
            }

            return(finalProperties);
        }
Пример #2
0
        /// <summary>
        /// Determines the interesting view properties.
        /// </summary>
        /// <returns>A list of names with view properties to subscribe to.</returns>
        private List <string> DetermineInterestingViewProperties()
        {
            var targetViewType = TargetViewType;

            var finalProperties = new List <string>();

            if ((_viewPropertySelector is null) || (_viewPropertySelector.MustSubscribeToAllViewProperties(targetViewType)))
            {
                var viewProperties = TargetView.GetProperties();
                finalProperties.AddRange(viewProperties);
            }