Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / System / Windows / Controls / UserControl.cs / 1305600 / UserControl.cs
//---------------------------------------------------------------------------- // // Copyright (C) Microsoft Corporation. All rights reserved. // //--------------------------------------------------------------------------- using System; using System.ComponentModel; using System.Windows; using System.Windows.Automation.Peers; using System.Windows.Input; using System.Windows.Media; using System.Windows.Markup; using System.Diagnostics; using MS.Internal.KnownBoxes; namespace System.Windows.Controls { ////// UserControl Class /// public class UserControl : ContentControl { #region Constructors static UserControl() { DefaultStyleKeyProperty.OverrideMetadata(typeof(UserControl), new FrameworkPropertyMetadata(typeof(UserControl))); _dType = DependencyObjectType.FromSystemTypeInternal(typeof(UserControl)); FocusableProperty.OverrideMetadata(typeof(UserControl), new FrameworkPropertyMetadata(BooleanBoxes.FalseBox)); KeyboardNavigation.IsTabStopProperty.OverrideMetadata(typeof(UserControl), new FrameworkPropertyMetadata(BooleanBoxes.FalseBox)); HorizontalContentAlignmentProperty.OverrideMetadata(typeof(UserControl), new FrameworkPropertyMetadata(HorizontalAlignment.Stretch)); VerticalContentAlignmentProperty.OverrideMetadata(typeof(UserControl), new FrameworkPropertyMetadata(VerticalAlignment.Stretch)); } ////// Default constructor /// public UserControl() { } #endregion Constructors // Set the EventArgs' source to be this UserControl internal override void AdjustBranchSource(RoutedEventArgs e) { e.Source=this; } ////// Creates AutomationPeer ( protected override AutomationPeer OnCreateAutomationPeer() { return new UserControlAutomationPeer(this); } ///) /// /// Gets the element that should be used as the StateGroupRoot for VisualStateMangager.GoToState calls /// internal override FrameworkElement StateGroupsRoot { get { return Content as FrameworkElement; } } #region DTypeThemeStyleKey // Returns the DependencyObjectType for the registered ThemeStyleKey's default // value. Controls will override this method to return approriate types. internal override DependencyObjectType DTypeThemeStyleKey { get { return _dType; } } private static DependencyObjectType _dType; #endregion DTypeThemeStyleKey } } // 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. // //--------------------------------------------------------------------------- using System; using System.ComponentModel; using System.Windows; using System.Windows.Automation.Peers; using System.Windows.Input; using System.Windows.Media; using System.Windows.Markup; using System.Diagnostics; using MS.Internal.KnownBoxes; namespace System.Windows.Controls { ////// UserControl Class /// public class UserControl : ContentControl { #region Constructors static UserControl() { DefaultStyleKeyProperty.OverrideMetadata(typeof(UserControl), new FrameworkPropertyMetadata(typeof(UserControl))); _dType = DependencyObjectType.FromSystemTypeInternal(typeof(UserControl)); FocusableProperty.OverrideMetadata(typeof(UserControl), new FrameworkPropertyMetadata(BooleanBoxes.FalseBox)); KeyboardNavigation.IsTabStopProperty.OverrideMetadata(typeof(UserControl), new FrameworkPropertyMetadata(BooleanBoxes.FalseBox)); HorizontalContentAlignmentProperty.OverrideMetadata(typeof(UserControl), new FrameworkPropertyMetadata(HorizontalAlignment.Stretch)); VerticalContentAlignmentProperty.OverrideMetadata(typeof(UserControl), new FrameworkPropertyMetadata(VerticalAlignment.Stretch)); } ////// Default constructor /// public UserControl() { } #endregion Constructors // Set the EventArgs' source to be this UserControl internal override void AdjustBranchSource(RoutedEventArgs e) { e.Source=this; } ////// Creates AutomationPeer ( protected override AutomationPeer OnCreateAutomationPeer() { return new UserControlAutomationPeer(this); } ///) /// /// Gets the element that should be used as the StateGroupRoot for VisualStateMangager.GoToState calls /// internal override FrameworkElement StateGroupsRoot { get { return Content as FrameworkElement; } } #region DTypeThemeStyleKey // Returns the DependencyObjectType for the registered ThemeStyleKey's default // value. Controls will override this method to return approriate types. internal override DependencyObjectType DTypeThemeStyleKey { get { return _dType; } } private static DependencyObjectType _dType; #endregion DTypeThemeStyleKey } } // 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
- MediaContext.cs
- HttpCapabilitiesEvaluator.cs
- ExpressionEditorAttribute.cs
- UrlMappingCollection.cs
- ElementsClipboardData.cs
- InfiniteIntConverter.cs
- basemetadatamappingvisitor.cs
- webbrowsersite.cs
- ExtendedProtectionPolicyElement.cs
- ValidateNames.cs
- ResourceAssociationTypeEnd.cs
- SQLInt32Storage.cs
- DataGridViewCellConverter.cs
- StringUtil.cs
- DoWorkEventArgs.cs
- UnrecognizedPolicyAssertionElement.cs
- Fault.cs
- UnsafeNativeMethods.cs
- RadioButtonRenderer.cs
- MultipleViewPattern.cs
- ApplicationTrust.cs
- SimpleHandlerBuildProvider.cs
- SqlXml.cs
- StyleReferenceConverter.cs
- CuspData.cs
- StructuralObject.cs
- SQLInt32.cs
- PaperSize.cs
- DataControlExtensions.cs
- StaticDataManager.cs
- XmlBinaryReaderSession.cs
- RSAPKCS1SignatureDeformatter.cs
- OneOfConst.cs
- SiteMapProvider.cs
- Baml2006ReaderContext.cs
- DataListItemCollection.cs
- Scene3D.cs
- TypedColumnHandler.cs
- RSAPKCS1SignatureFormatter.cs
- NavigatorOutput.cs
- DBDataPermissionAttribute.cs
- WebServiceEnumData.cs
- XmlChoiceIdentifierAttribute.cs
- BuildManager.cs
- UIElementParagraph.cs
- UriSectionReader.cs
- BindingElementExtensionElement.cs
- ScriptingProfileServiceSection.cs
- CodeStatement.cs
- Formatter.cs
- DataGridViewEditingControlShowingEventArgs.cs
- RawContentTypeMapper.cs
- Instrumentation.cs
- ManagedWndProcTracker.cs
- EventMemberCodeDomSerializer.cs
- Site.cs
- DocumentPaginator.cs
- PerformanceCounterLib.cs
- BinaryObjectReader.cs
- XmlSchemaExternal.cs
- DataControlImageButton.cs
- x509utils.cs
- CompilerResults.cs
- CodeIdentifiers.cs
- SAPIEngineTypes.cs
- UnsafeNetInfoNativeMethods.cs
- ConfigDefinitionUpdates.cs
- SlotInfo.cs
- TypeContext.cs
- HttpApplicationFactory.cs
- StoreAnnotationsMap.cs
- PageThemeParser.cs
- RuntimeConfigurationRecord.cs
- FormsAuthenticationEventArgs.cs
- StringDictionaryCodeDomSerializer.cs
- SemaphoreSecurity.cs
- XhtmlBasicPanelAdapter.cs
- InfoCardKeyedHashAlgorithm.cs
- TreeNodeCollection.cs
- Empty.cs
- TextRangeEdit.cs
- EmptyQuery.cs
- DataGridViewRowsRemovedEventArgs.cs
- PassportIdentity.cs
- HttpWriter.cs
- FlowThrottle.cs
- PropertyToken.cs
- ListManagerBindingsCollection.cs
- HighContrastHelper.cs
- DataGridViewRowsAddedEventArgs.cs
- TypeUtil.cs
- EventItfInfo.cs
- WSDualHttpBindingCollectionElement.cs
- BinaryExpressionHelper.cs
- IisTraceWebEventProvider.cs
- SystemParameters.cs
- RuntimeArgumentHandle.cs
- CqlGenerator.cs
- XmlAggregates.cs
- DependencyObjectType.cs