Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / System / ComponentModel / DesignerProperties.cs / 1305600 / DesignerProperties.cs
//---------------------------------------------------------------------------- // //// Copyright (C) Microsoft Corporation. All rights reserved. // // // // Description: // Provides attached properties used to communicate with a designer. // See spec at: http://team/sites/Cider/Cross%20Team/Design%20Mode%20Property.doc // // History: // 7/07/2006: [....], Created // //--------------------------------------------------------------------------- namespace System.ComponentModel { using System; using System.Windows; using MS.Internal.KnownBoxes; ////// The DesignerProperties class provides attached properties that can be used to /// query the state of a control when it is running in a designer. Designer tools /// will set values for properties on objects that are running in the designer. /// public static class DesignerProperties { //----------------------------------------------------- // // Public Fields // //----------------------------------------------------- ////// Identifies the DesignerProperties.IsInDesignMode dependency property. /// This field is read only. /// public static readonly DependencyProperty IsInDesignModeProperty = DependencyProperty.RegisterAttached( "IsInDesignMode", typeof(bool), typeof(DesignerProperties), new FrameworkPropertyMetadata(BooleanBoxes.FalseBox, FrameworkPropertyMetadataOptions.Inherits | FrameworkPropertyMetadataOptions.OverridesInheritanceBehavior)); //------------------------------------------------------ // // Public Methods // //----------------------------------------------------- ////// Returns the attached property IsInDesignMode value for the given dependency object. /// /// This property will return true if the given element is running in the context of a /// designer. Component developers may use this property to perform different logic /// in the context of a designer than they would when running in an application. For /// example, expensive validation or connecting to an external resource like a server /// may not make sense while an application is being developed. /// /// Designers may change the value of this property to move a control from design /// mode to run mode and back. Components that make changes to their state based /// on the value of this property should override the virtual OnPropertyChanged method /// and update their state if the IsInDesignMode property value changes. /// [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public static bool GetIsInDesignMode(DependencyObject element) { if (element == null) throw new ArgumentNullException("element"); return (bool)element.GetValue(IsInDesignModeProperty); } ////// Sets the value of the IsInDesignMode attached property for the given dependency object. /// public static void SetIsInDesignMode(DependencyObject element, bool value) { if (element == null) throw new ArgumentNullException("element"); element.SetValue(IsInDesignModeProperty, value); } } } // 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: // Provides attached properties used to communicate with a designer. // See spec at: http://team/sites/Cider/Cross%20Team/Design%20Mode%20Property.doc // // History: // 7/07/2006: [....], Created // //--------------------------------------------------------------------------- namespace System.ComponentModel { using System; using System.Windows; using MS.Internal.KnownBoxes; ////// The DesignerProperties class provides attached properties that can be used to /// query the state of a control when it is running in a designer. Designer tools /// will set values for properties on objects that are running in the designer. /// public static class DesignerProperties { //----------------------------------------------------- // // Public Fields // //----------------------------------------------------- ////// Identifies the DesignerProperties.IsInDesignMode dependency property. /// This field is read only. /// public static readonly DependencyProperty IsInDesignModeProperty = DependencyProperty.RegisterAttached( "IsInDesignMode", typeof(bool), typeof(DesignerProperties), new FrameworkPropertyMetadata(BooleanBoxes.FalseBox, FrameworkPropertyMetadataOptions.Inherits | FrameworkPropertyMetadataOptions.OverridesInheritanceBehavior)); //------------------------------------------------------ // // Public Methods // //----------------------------------------------------- ////// Returns the attached property IsInDesignMode value for the given dependency object. /// /// This property will return true if the given element is running in the context of a /// designer. Component developers may use this property to perform different logic /// in the context of a designer than they would when running in an application. For /// example, expensive validation or connecting to an external resource like a server /// may not make sense while an application is being developed. /// /// Designers may change the value of this property to move a control from design /// mode to run mode and back. Components that make changes to their state based /// on the value of this property should override the virtual OnPropertyChanged method /// and update their state if the IsInDesignMode property value changes. /// [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public static bool GetIsInDesignMode(DependencyObject element) { if (element == null) throw new ArgumentNullException("element"); return (bool)element.GetValue(IsInDesignModeProperty); } ////// Sets the value of the IsInDesignMode attached property for the given dependency object. /// public static void SetIsInDesignMode(DependencyObject element, bool value) { if (element == null) throw new ArgumentNullException("element"); element.SetValue(IsInDesignModeProperty, value); } } } // 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
- SoapTypeAttribute.cs
- WebPartConnectionsConnectVerb.cs
- SecurityRuntime.cs
- ChildDocumentBlock.cs
- WinEventWrap.cs
- ApplicationDirectoryMembershipCondition.cs
- ExpressionConverter.cs
- KerberosTicketHashIdentifierClause.cs
- CompareValidator.cs
- FragmentQuery.cs
- DataGridViewComboBoxColumn.cs
- DiscreteKeyFrames.cs
- SoapAttributeAttribute.cs
- OracleConnection.cs
- AdapterDictionary.cs
- TableItemPattern.cs
- FileLevelControlBuilderAttribute.cs
- SafeSystemMetrics.cs
- ChildChangedEventArgs.cs
- SettingsSavedEventArgs.cs
- TdsParameterSetter.cs
- TreeNodeBindingCollection.cs
- SemanticResolver.cs
- RuntimeConfigLKG.cs
- EqualityComparer.cs
- TCEAdapterGenerator.cs
- CapiSymmetricAlgorithm.cs
- StringFunctions.cs
- XD.cs
- ToolBarTray.cs
- PhonemeEventArgs.cs
- WebHttpDispatchOperationSelectorData.cs
- GenericWebPart.cs
- ToolboxItemFilterAttribute.cs
- SQLInt64Storage.cs
- PipeStream.cs
- Nullable.cs
- HttpRuntime.cs
- datacache.cs
- CheckBoxList.cs
- QilTypeChecker.cs
- Rectangle.cs
- BinaryCommonClasses.cs
- SpellerInterop.cs
- ObjectHelper.cs
- XmlDataSourceView.cs
- HttpListener.cs
- InputScopeManager.cs
- HTMLTextWriter.cs
- OleDbConnectionInternal.cs
- SourceItem.cs
- UIElementParagraph.cs
- RealProxy.cs
- StringCollectionEditor.cs
- RemotingConfigParser.cs
- EventLogPermission.cs
- URIFormatException.cs
- Socket.cs
- PointCollectionConverter.cs
- PagerStyle.cs
- CustomWebEventKey.cs
- Compiler.cs
- BindingBase.cs
- Point3DCollection.cs
- NextPreviousPagerField.cs
- StyleSelector.cs
- PageScaling.cs
- ThemeDirectoryCompiler.cs
- InfoCardTraceRecord.cs
- ImageListStreamer.cs
- ModifierKeysValueSerializer.cs
- AuthorizationContext.cs
- ToolStripProfessionalLowResolutionRenderer.cs
- HtmlShim.cs
- OdbcConnectionString.cs
- ExpressionQuoter.cs
- ZipIOExtraField.cs
- HttpPostedFileBase.cs
- FrameworkReadOnlyPropertyMetadata.cs
- ObfuscationAttribute.cs
- DataGridViewCellCancelEventArgs.cs
- VectorAnimationUsingKeyFrames.cs
- PersonalizationState.cs
- HttpPostedFile.cs
- DecimalConverter.cs
- SQLGuid.cs
- ListViewPagedDataSource.cs
- GuidConverter.cs
- Decoder.cs
- ToolboxItemSnapLineBehavior.cs
- FileSystemWatcher.cs
- TreeNode.cs
- HttpApplication.cs
- VisualTreeHelper.cs
- LogManagementAsyncResult.cs
- StrokeCollectionConverter.cs
- EnumMember.cs
- NegotiationTokenAuthenticatorState.cs
- App.cs
- _CacheStreams.cs