Ejemplo n.º 1
0
        private static void AddNewValues(FrameworkElement frameworkElement, object newValue)
        {
            if (newValue == null)
            {
                return;
            }

            var newDictionaries = newValue.ToString().Split(';');

            foreach (var dictionaryName in newDictionaries)
            {
                var dictionary = GlobalResources.Get(dictionaryName.Trim());
                frameworkElement.Resources.MergedDictionaries.Add(dictionary);
            }
        }
Ejemplo n.º 2
0
        private static void RemoveOldValues(FrameworkElement frameworkElement, object oldValue)
        {
            if (oldValue == null)
            {
                return;
            }

            var oldDictionaries = oldValue.ToString().Split(';');

            foreach (var dictionaryName in oldDictionaries)
            {
                var dictionary = GlobalResources.Get(dictionaryName.Trim());
                frameworkElement.Resources.MergedDictionaries.Remove(dictionary);
            }
        }