Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / System / Windows / Controls / StyleSelector.cs / 1305600 / StyleSelector.cs
//----------------------------------------------------------------------------
//
//
// Copyright (C) Microsoft Corporation. All rights reserved.
//
//
// Description: StyleSelector allows the app writer to provide custom style selection logic.
//
// Specs: http://avalon/connecteddata/M5%20General%20Docs/Data%20Styling.mht
//
//---------------------------------------------------------------------------
using System.Windows.Shapes;
using System.Windows.Media;
using System.Windows.Data;
using System.ComponentModel;
using System;
namespace System.Windows.Controls
{
///
///
/// StyleSelector allows the app writer to provide custom style selection logic.
/// For example, with a class Bug as the Content,
/// use a particular style for Pri1 bugs and a different style for Pri2 bugs.
///
///
/// An application writer can override the SelectStyle method in a derived
/// selector class and assign an instance of this class to the StyleSelector property on
/// class.
///
///
public class StyleSelector
{
///
/// Override this method to return an app specific .
///
/// The data content
/// The element to which the style will be applied
/// an app-specific style to apply, or null.
public virtual Style SelectStyle(object item, DependencyObject container)
{
return null;
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
//----------------------------------------------------------------------------
//
//
// Copyright (C) Microsoft Corporation. All rights reserved.
//
//
// Description: StyleSelector allows the app writer to provide custom style selection logic.
//
// Specs: http://avalon/connecteddata/M5%20General%20Docs/Data%20Styling.mht
//
//---------------------------------------------------------------------------
using System.Windows.Shapes;
using System.Windows.Media;
using System.Windows.Data;
using System.ComponentModel;
using System;
namespace System.Windows.Controls
{
///
///
/// StyleSelector allows the app writer to provide custom style selection logic.
/// For example, with a class Bug as the Content,
/// use a particular style for Pri1 bugs and a different style for Pri2 bugs.
///
///
/// An application writer can override the SelectStyle method in a derived
/// selector class and assign an instance of this class to the StyleSelector property on
/// class.
///
///
public class StyleSelector
{
///
/// Override this method to return an app specific .
///
/// The data content
/// The element to which the style will be applied
/// an app-specific style to apply, or null.
public virtual Style SelectStyle(object item, DependencyObject container)
{
return null;
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- HttpListenerException.cs
- FixedSchema.cs
- EntityDataSourceDesigner.cs
- TimeSpanSecondsOrInfiniteConverter.cs
- ModifyActivitiesPropertyDescriptor.cs
- PieceNameHelper.cs
- FailedToStartupUIException.cs
- VoiceObjectToken.cs
- Int64Animation.cs
- DynamicPropertyHolder.cs
- FixUp.cs
- ThrowHelper.cs
- FixedTextPointer.cs
- DataReaderContainer.cs
- ManagementExtension.cs
- DataGridViewComboBoxEditingControl.cs
- LogLogRecordEnumerator.cs
- IPAddressCollection.cs
- DbConnectionPoolGroupProviderInfo.cs
- FileLevelControlBuilderAttribute.cs
- DetailsViewRowCollection.cs
- PerformanceCountersElement.cs
- DelegatingTypeDescriptionProvider.cs
- DesignerAutoFormatStyle.cs
- XsdDuration.cs
- DataSourceCache.cs
- Wrapper.cs
- SQLRoleProvider.cs
- XmlConverter.cs
- ResizingMessageFilter.cs
- ScrollBarRenderer.cs
- SmiRequestExecutor.cs
- SettingsPropertyWrongTypeException.cs
- ResourceProperty.cs
- DesignerActionItemCollection.cs
- Pen.cs
- Helpers.cs
- WebControlToolBoxItem.cs
- AncillaryOps.cs
- XsdBuilder.cs
- DateTimeStorage.cs
- Comparer.cs
- TransformConverter.cs
- DoubleIndependentAnimationStorage.cs
- WindowsMenu.cs
- SettingsBase.cs
- SpellerStatusTable.cs
- RetrieveVirtualItemEventArgs.cs
- StrongNamePublicKeyBlob.cs
- CalendarBlackoutDatesCollection.cs
- PathSegmentCollection.cs
- CodeExporter.cs
- OpacityConverter.cs
- ElementUtil.cs
- ConfigurationElement.cs
- NativeMethods.cs
- HMACSHA384.cs
- DigitalSignature.cs
- StringAnimationUsingKeyFrames.cs
- EventHandlersStore.cs
- HashSet.cs
- CacheMode.cs
- DataSysAttribute.cs
- InvariantComparer.cs
- Attributes.cs
- WindowsTreeView.cs
- PropertyStore.cs
- ZipIOLocalFileBlock.cs
- WebServicesInteroperability.cs
- HtmlLink.cs
- ComboBox.cs
- InfoCardSymmetricAlgorithm.cs
- EventLogSession.cs
- RectAnimationBase.cs
- DataGridViewColumnStateChangedEventArgs.cs
- Path.cs
- GridViewHeaderRowPresenterAutomationPeer.cs
- Mouse.cs
- CommandPlan.cs
- BitmapImage.cs
- DateTimeUtil.cs
- TypeInfo.cs
- Base64Encoder.cs
- FixedHighlight.cs
- Margins.cs
- ApplicationContext.cs
- XPathExpr.cs
- InputScopeConverter.cs
- Int32.cs
- counter.cs
- PartialTrustVisibleAssemblyCollection.cs
- ViewPort3D.cs
- BitSet.cs
- cache.cs
- SerializationHelper.cs
- TabRenderer.cs
- KnownTypeDataContractResolver.cs
- SqlDataSourceFilteringEventArgs.cs
- SymLanguageType.cs
- ItemCheckedEvent.cs