Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / System / Windows / Controls / DataGridItemAttachedStorage.cs / 1305600 / DataGridItemAttachedStorage.cs
//---------------------------------------------------------------------------- // // Copyright (C) Microsoft Corporation. All rights reserved. // //--------------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Windows; namespace System.Windows.Controls { ////// Holds all of the information that we need to attach to row items so that we can restore rows when they're devirtualized. /// internal class DataGridItemAttachedStorage { public void SetValue(object item, DependencyProperty property, object value) { var map = EnsureItem(item); map[property] = value; } public bool TryGetValue(object item, DependencyProperty property, out object value) { value = null; Dictionarymap; EnsureItemStorageMap(); if (_itemStorageMap.TryGetValue(item, out map)) { return map.TryGetValue(property, out value); } return false; } public void ClearValue(object item, DependencyProperty property) { Dictionary map; EnsureItemStorageMap(); if (_itemStorageMap.TryGetValue(item, out map)) { map.Remove(property); } } public void ClearItem(object item) { EnsureItemStorageMap(); _itemStorageMap.Remove(item); } public void Clear() { _itemStorageMap = null; } private void EnsureItemStorageMap() { if (_itemStorageMap == null) { _itemStorageMap = new Dictionary
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- TimerEventSubscriptionCollection.cs
- DataGridViewTextBoxColumn.cs
- ScriptRef.cs
- ControlPropertyNameConverter.cs
- BrowserDefinition.cs
- TdsRecordBufferSetter.cs
- BoundColumn.cs
- ScrollBarRenderer.cs
- QueryExpr.cs
- GridViewRow.cs
- NetworkInformationPermission.cs
- AssemblyAssociatedContentFileAttribute.cs
- GlyphRunDrawing.cs
- FieldNameLookup.cs
- SamlSecurityTokenAuthenticator.cs
- DbException.cs
- StorageSetMapping.cs
- HostVisual.cs
- ByteAnimationUsingKeyFrames.cs
- ValidationSummary.cs
- HttpWebRequestElement.cs
- XmlSecureResolver.cs
- FragmentNavigationEventArgs.cs
- HitTestFilterBehavior.cs
- ExecutionContext.cs
- TextSelectionProcessor.cs
- CqlLexer.cs
- IconEditor.cs
- _FixedSizeReader.cs
- ReadOnlyCollectionBase.cs
- PlainXmlDeserializer.cs
- BitVector32.cs
- SQLBinaryStorage.cs
- ProfileSettingsCollection.cs
- XmlSchemaAny.cs
- ByteFacetDescriptionElement.cs
- EnterpriseServicesHelper.cs
- DesignerSerializerAttribute.cs
- TriggerAction.cs
- DataRowChangeEvent.cs
- Ops.cs
- LightweightCodeGenerator.cs
- DesignerActionService.cs
- TransformedBitmap.cs
- DataColumn.cs
- StrokeNodeEnumerator.cs
- TraceEventCache.cs
- OdbcConnectionStringbuilder.cs
- BasicViewGenerator.cs
- MailSettingsSection.cs
- SharedConnectionWorkflowTransactionService.cs
- ComponentCollection.cs
- UriTemplateVariablePathSegment.cs
- ListCardsInFileRequest.cs
- PictureBox.cs
- SrgsDocument.cs
- VsPropertyGrid.cs
- TypePropertyEditor.cs
- TypeUtil.cs
- MetadataHelper.cs
- GridViewRowCollection.cs
- TemplateBindingExpressionConverter.cs
- InheritedPropertyDescriptor.cs
- GroupBox.cs
- SimplePropertyEntry.cs
- DateTimeOffset.cs
- EntityWrapper.cs
- GuidTagList.cs
- ApplicationId.cs
- WMICapabilities.cs
- AppLevelCompilationSectionCache.cs
- ProxyAssemblyNotLoadedException.cs
- SystemResourceKey.cs
- CodeDirectionExpression.cs
- MappingItemCollection.cs
- QuerySettings.cs
- CommandValueSerializer.cs
- StandardBindingReliableSessionElement.cs
- DispatchWrapper.cs
- Column.cs
- Tablet.cs
- WindowAutomationPeer.cs
- RewritingSimplifier.cs
- SafeRegistryHandle.cs
- ImageField.cs
- BaseParaClient.cs
- QueryPageSettingsEventArgs.cs
- BlockExpression.cs
- TransactionScope.cs
- SequenceDesigner.cs
- TextParaClient.cs
- StrokeNode.cs
- DeviceOverridableAttribute.cs
- HitTestResult.cs
- WebServicesDescriptionAttribute.cs
- HttpCapabilitiesEvaluator.cs
- CommandBinding.cs
- AsymmetricCryptoHandle.cs
- BitmapInitialize.cs
- BitArray.cs