/// <summary> /// Moves to the next style. /// </summary> /// <returns>A value indicating whether there are any more suitable /// styles.</returns> public bool MoveNext() { if (ShouldRetrieveFromParentEnumerator && ParentEnumerator != null) { bool isMore = ParentEnumerator.MoveNext(); if (isMore) { this.CurrentStyle = ParentEnumerator.Current; } return(isMore); } index = GetIndexOfNextSuitableStyle(index ?? 0); if (index == null) { CurrentStyle = null; Dispose(); return(false); } CurrentStyle = StyleDispenser.Styles[index.Value]; OnStyleDispensed(new StyleDispensedEventArgs(index.Value, CurrentStyle)); return(true); }
/// <summary> /// Moves to the next ResourceDictionary. /// </summary> /// <returns> /// A value indicating whether there are any more suitable /// ResourceDictionary. /// </returns> public bool MoveNext() { if (ShouldRetrieveFromParentEnumerator && ParentEnumerator != null) { bool isMore = ParentEnumerator.MoveNext(); if (isMore) { CurrentResourceDictionary = ParentEnumerator.Current; } return(isMore); } index = GetIndexOfNextSuitableResourceDictionary(index ?? 0); if (index == null) { CurrentResourceDictionary = null; Dispose(); return(false); } CurrentResourceDictionary = ResourceDictionaryDispenser.ResourceDictionaries[index.Value]; OnStyleDispensed(new ResourceDictionaryDispensedEventArgs(index.Value, CurrentResourceDictionary)); return(true); }