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
- PauseStoryboard.cs
- CodeDelegateInvokeExpression.cs
- HttpDictionary.cs
- TextBox.cs
- Margins.cs
- SerializerDescriptor.cs
- DesignerVerb.cs
- MouseButton.cs
- PointCollectionValueSerializer.cs
- UserNameSecurityTokenAuthenticator.cs
- EventHandlingScope.cs
- RemotingServices.cs
- ELinqQueryState.cs
- DefaultHttpHandler.cs
- TailPinnedEventArgs.cs
- PropertyDescriptorCollection.cs
- LostFocusEventManager.cs
- Effect.cs
- EnumConverter.cs
- Size3D.cs
- BamlTreeUpdater.cs
- InlineObject.cs
- ColumnMapCopier.cs
- TransformerTypeCollection.cs
- ObjectQuery_EntitySqlExtensions.cs
- EndCreateSecurityTokenRequest.cs
- ThousandthOfEmRealPoints.cs
- Screen.cs
- StateBag.cs
- EventPropertyMap.cs
- ImageFormatConverter.cs
- Base64WriteStateInfo.cs
- ShowExpandedMultiValueConverter.cs
- CollectionChangedEventManager.cs
- RowUpdatedEventArgs.cs
- CodeTryCatchFinallyStatement.cs
- Native.cs
- CommentAction.cs
- FormatConvertedBitmap.cs
- Material.cs
- GridViewRow.cs
- DataIdProcessor.cs
- MimeMultiPart.cs
- StorageMappingFragment.cs
- DecoderExceptionFallback.cs
- SafeRightsManagementQueryHandle.cs
- SpAudioStreamWrapper.cs
- WebPartCatalogCloseVerb.cs
- WindowsRichEditRange.cs
- DataGridViewRowContextMenuStripNeededEventArgs.cs
- OletxTransactionManager.cs
- BypassElement.cs
- MembershipSection.cs
- ProtocolsSection.cs
- ConfigXmlElement.cs
- ThousandthOfEmRealPoints.cs
- SelectionEditingBehavior.cs
- ImageFormat.cs
- HttpCacheVaryByContentEncodings.cs
- RSAOAEPKeyExchangeFormatter.cs
- QueryNode.cs
- CommandEventArgs.cs
- JpegBitmapDecoder.cs
- HttpRequest.cs
- WindowsRegion.cs
- SrgsToken.cs
- NumericUpDown.cs
- WebConfigurationFileMap.cs
- Command.cs
- SqlDeflator.cs
- TransactedBatchingBehavior.cs
- SessionStateContainer.cs
- DataColumn.cs
- PropertyChangedEventManager.cs
- WindowClosedEventArgs.cs
- WaitHandle.cs
- AlphabetConverter.cs
- DesignerSerializerAttribute.cs
- EntityContainerEntitySet.cs
- ConfigXmlText.cs
- CodeSnippetExpression.cs
- DynamicValidatorEventArgs.cs
- ToolStripPanel.cs
- BaseInfoTable.cs
- InvalidEnumArgumentException.cs
- PropVariant.cs
- DataGridViewTextBoxColumn.cs
- NewArray.cs
- CompositeFontParser.cs
- CalendarData.cs
- BooleanExpr.cs
- ValidatedControlConverter.cs
- FormViewUpdateEventArgs.cs
- BindingNavigator.cs
- EntitySetDataBindingList.cs
- ServiceDocument.cs
- StyleHelper.cs
- FtpRequestCacheValidator.cs
- _ShellExpression.cs
- RubberbandSelector.cs