Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx40 / Tools / System.Activities.Presentation / System / Activities / Presentation / CachedResourceDictionaryExtension.cs / 1305376 / CachedResourceDictionaryExtension.cs
//---------------------------------------------------------------- // Copyright (c) Microsoft Corporation. All rights reserved. //--------------------------------------------------------------- namespace System.Activities.Presentation { using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows; using System.Windows.Markup; [MarkupExtensionReturnType(typeof(ResourceDictionary))] public class CachedResourceDictionaryExtension : MarkupExtension { static DictionaryCache = new Dictionary (); public Uri Source { get; set; } public override object ProvideValue(IServiceProvider serviceProvider) { ResourceDictionary resourceDictionary = null; // disable caching till the wpf mergedictionaries in theme dictionary bug is fixed. if (!Cache.TryGetValue(this.Source, out resourceDictionary)) { resourceDictionary = new ResourceDictionary(); resourceDictionary.Source = this.Source; Cache.Add(this.Source, resourceDictionary); } return resourceDictionary; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //---------------------------------------------------------------- // Copyright (c) Microsoft Corporation. All rights reserved. //--------------------------------------------------------------- namespace System.Activities.Presentation { using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows; using System.Windows.Markup; [MarkupExtensionReturnType(typeof(ResourceDictionary))] public class CachedResourceDictionaryExtension : MarkupExtension { static Dictionary Cache = new Dictionary (); public Uri Source { get; set; } public override object ProvideValue(IServiceProvider serviceProvider) { ResourceDictionary resourceDictionary = null; // disable caching till the wpf mergedictionaries in theme dictionary bug is fixed. if (!Cache.TryGetValue(this.Source, out resourceDictionary)) { resourceDictionary = new ResourceDictionary(); resourceDictionary.Source = this.Source; Cache.Add(this.Source, resourceDictionary); } return resourceDictionary; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- MatchAllMessageFilter.cs
- XamlPointCollectionSerializer.cs
- WindowsHyperlink.cs
- TemplateColumn.cs
- ImagingCache.cs
- FontDriver.cs
- AsyncPostBackTrigger.cs
- EntityDataSourceEntityTypeFilterConverter.cs
- VoiceObjectToken.cs
- Relationship.cs
- AdapterDictionary.cs
- TextUtf8RawTextWriter.cs
- PlatformCulture.cs
- NullRuntimeConfig.cs
- Imaging.cs
- XmlSchemaIdentityConstraint.cs
- RepeatButton.cs
- KeyEvent.cs
- TcpTransportManager.cs
- WebBrowserPermission.cs
- HijriCalendar.cs
- AutomationPattern.cs
- WindowsRichEditRange.cs
- HierarchicalDataSourceControl.cs
- UnwrappedTypesXmlSerializerManager.cs
- NullExtension.cs
- CalendarAutomationPeer.cs
- TableParagraph.cs
- PrintEvent.cs
- InternalConfigSettingsFactory.cs
- DiagnosticTrace.cs
- EndpointDiscoveryElement.cs
- TemplatedAdorner.cs
- DataRowChangeEvent.cs
- Argument.cs
- DesignSurfaceEvent.cs
- GenerateHelper.cs
- ConfigurationValue.cs
- StreamUpdate.cs
- VisualBrush.cs
- MatcherBuilder.cs
- XmlNotation.cs
- Cursor.cs
- CodeBinaryOperatorExpression.cs
- SimpleType.cs
- AuthenticationService.cs
- XmlLanguageConverter.cs
- ClientTarget.cs
- DigitShape.cs
- SessionStateContainer.cs
- TraceInternal.cs
- FixedSOMContainer.cs
- SchemaImporterExtension.cs
- CodeRemoveEventStatement.cs
- FlowStep.cs
- CanonicalFontFamilyReference.cs
- BindStream.cs
- IndexerNameAttribute.cs
- ObjectDataSourceDisposingEventArgs.cs
- UnsafeNativeMethods.cs
- GenericsInstances.cs
- Int64AnimationBase.cs
- XmlDataSourceNodeDescriptor.cs
- SerializerWriterEventHandlers.cs
- WinFormsComponentEditor.cs
- StringFormat.cs
- ArrayConverter.cs
- ArithmeticException.cs
- DesignTableCollection.cs
- DSASignatureFormatter.cs
- DataGridViewCellPaintingEventArgs.cs
- ArgIterator.cs
- TableLayoutSettingsTypeConverter.cs
- XmlLanguage.cs
- WebFaultException.cs
- PropertyCollection.cs
- XMLSchema.cs
- CompilerScopeManager.cs
- UncommonField.cs
- MachineKeySection.cs
- _ConnectionGroup.cs
- MembershipPasswordException.cs
- BaseTreeIterator.cs
- ReachSerializer.cs
- WindowsGraphicsWrapper.cs
- DefaultProxySection.cs
- TrackingRecord.cs
- TextModifierScope.cs
- VisualTransition.cs
- WebConfigurationFileMap.cs
- FilteredDataSetHelper.cs
- ActivityXRefConverter.cs
- ThreadExceptionDialog.cs
- GeneralTransform3DGroup.cs
- RMPublishingDialog.cs
- Parsers.cs
- ColumnCollection.cs
- NetworkStream.cs
- COM2FontConverter.cs
- UnSafeCharBuffer.cs