Code:
/ 4.0 / 4.0 / 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
- DebugViewWriter.cs
- Light.cs
- GroupBoxAutomationPeer.cs
- TimeSpanValidator.cs
- LogicalChannel.cs
- RequiredAttributeAttribute.cs
- ObjectComplexPropertyMapping.cs
- COM2EnumConverter.cs
- UriWriter.cs
- HwndProxyElementProvider.cs
- WhitespaceRuleReader.cs
- AddInPipelineAttributes.cs
- TreePrinter.cs
- RequiredFieldValidator.cs
- SecurityContextSecurityToken.cs
- X509ThumbprintKeyIdentifierClause.cs
- AVElementHelper.cs
- SafeNativeMethods.cs
- HttpRequestBase.cs
- XmlSerializerVersionAttribute.cs
- VisualBasicSettings.cs
- AnnotationObservableCollection.cs
- WebSysDescriptionAttribute.cs
- StyleCollectionEditor.cs
- BasePattern.cs
- ArgumentDesigner.xaml.cs
- PlaceHolder.cs
- Stack.cs
- XmlTextAttribute.cs
- DataPagerFieldCommandEventArgs.cs
- SecurityTokenTypes.cs
- SharedDp.cs
- MetadataUtilsSmi.cs
- SiteMapNodeItemEventArgs.cs
- Run.cs
- ParallelDesigner.xaml.cs
- HMACSHA512.cs
- CngKey.cs
- CatalogPartCollection.cs
- PathFigure.cs
- SettingsPropertyValueCollection.cs
- SchemaTableOptionalColumn.cs
- DateTimeConverter.cs
- CaseInsensitiveOrdinalStringComparer.cs
- FileStream.cs
- glyphs.cs
- QilTargetType.cs
- InsufficientMemoryException.cs
- AudioFormatConverter.cs
- AstNode.cs
- MappedMetaModel.cs
- ReaderWriterLockSlim.cs
- PropertyConverter.cs
- IResourceProvider.cs
- DynamicResourceExtensionConverter.cs
- UnaryOperationBinder.cs
- HandleValueEditor.cs
- ObjectStateEntryDbDataRecord.cs
- EntityContainerRelationshipSet.cs
- ProcessHostServerConfig.cs
- CriticalHandle.cs
- HttpDictionary.cs
- MimeTypeMapper.cs
- SqlProfileProvider.cs
- DependencyPropertyKind.cs
- CheckBox.cs
- XamlClipboardData.cs
- HtmlTableRowCollection.cs
- TcpSocketManager.cs
- OutputCacheSettingsSection.cs
- DynamicRendererThreadManager.cs
- SwitchLevelAttribute.cs
- _RequestCacheProtocol.cs
- EventLogTraceListener.cs
- ScriptServiceAttribute.cs
- DataGridViewLinkCell.cs
- List.cs
- TypedColumnHandler.cs
- ReadingWritingEntityEventArgs.cs
- FileLogRecordEnumerator.cs
- PrefixQName.cs
- ExecutionContext.cs
- OutputCacheProviderCollection.cs
- BufferModesCollection.cs
- TTSEvent.cs
- FilterUserControlBase.cs
- XmlSignatureProperties.cs
- DataGridViewColumnConverter.cs
- HttpResponse.cs
- MessageFormatterConverter.cs
- VisualTarget.cs
- SafePEFileHandle.cs
- AsyncInvokeOperation.cs
- JoinElimination.cs
- ToolStripAdornerWindowService.cs
- ChangeDirector.cs
- Tile.cs
- ModuleConfigurationInfo.cs
- JsonFormatReaderGenerator.cs
- MSAAEventDispatcher.cs