Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Core / CSharp / System / Windows / Media3D / ModelUIElement3D.cs / 1305600 / ModelUIElement3D.cs
//---------------------------------------------------------------------------- // //// Copyright (c) Microsoft Corporation. All rights reserved. // // // Description: // // History: // 4/12/2007: kurtb - Created // //--------------------------------------------------------------------------- using MS.Internal; using MS.Internal.Media; using MS.Internal.Media3D; using System; using System.Diagnostics; using System.Collections.Specialized; using System.ComponentModel; using System.Windows.Automation.Peers; using System.Windows.Media.Composition; using System.Windows.Markup; using SR=MS.Internal.PresentationCore.SR; using SRID=MS.Internal.PresentationCore.SRID; namespace System.Windows.Media.Media3D { ////// ModelUIElement3D is a UIElement3D which draws the given Model3D. /// ModelUIElement3D is usable from Xaml. /// [ContentProperty("Model")] public sealed class ModelUIElement3D : UIElement3D { //----------------------------------------------------- // // Constructors // //----------------------------------------------------- #region Constructors ////// Default ctor /// public ModelUIElement3D() { } #endregion Constructors ////// DependencyProperty which backs the ModelUIElement3D.Content property. /// public static readonly DependencyProperty ModelProperty = DependencyProperty.Register( "Model", /* propertyType = */ typeof(Model3D), /* ownerType = */ typeof(ModelUIElement3D), new PropertyMetadata(ModelPropertyChanged), (ValidateValueCallback) delegate { return MediaContext.CurrentMediaContext.WriteAccessEnabled; }); private static void ModelPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { ModelUIElement3D owner = ((ModelUIElement3D) d); // if it's not a subproperty change, then we need to change the protected Model property of Visual3D if (!e.IsASubPropertyChange) { owner.Visual3DModel = (Model3D)e.NewValue; } } ////// The Model3D to render /// public Model3D Model { get { return (Model3D) GetValue(ModelProperty); } set { SetValue(ModelProperty, value); } } ////// Called by the Automation infrastructure when AutomationPeer /// is requested for this element. /// protected override AutomationPeer OnCreateAutomationPeer() { return new UIElement3DAutomationPeer(this); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //---------------------------------------------------------------------------- // //// Copyright (c) Microsoft Corporation. All rights reserved. // // // Description: // // History: // 4/12/2007: kurtb - Created // //--------------------------------------------------------------------------- using MS.Internal; using MS.Internal.Media; using MS.Internal.Media3D; using System; using System.Diagnostics; using System.Collections.Specialized; using System.ComponentModel; using System.Windows.Automation.Peers; using System.Windows.Media.Composition; using System.Windows.Markup; using SR=MS.Internal.PresentationCore.SR; using SRID=MS.Internal.PresentationCore.SRID; namespace System.Windows.Media.Media3D { ////// ModelUIElement3D is a UIElement3D which draws the given Model3D. /// ModelUIElement3D is usable from Xaml. /// [ContentProperty("Model")] public sealed class ModelUIElement3D : UIElement3D { //----------------------------------------------------- // // Constructors // //----------------------------------------------------- #region Constructors ////// Default ctor /// public ModelUIElement3D() { } #endregion Constructors ////// DependencyProperty which backs the ModelUIElement3D.Content property. /// public static readonly DependencyProperty ModelProperty = DependencyProperty.Register( "Model", /* propertyType = */ typeof(Model3D), /* ownerType = */ typeof(ModelUIElement3D), new PropertyMetadata(ModelPropertyChanged), (ValidateValueCallback) delegate { return MediaContext.CurrentMediaContext.WriteAccessEnabled; }); private static void ModelPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { ModelUIElement3D owner = ((ModelUIElement3D) d); // if it's not a subproperty change, then we need to change the protected Model property of Visual3D if (!e.IsASubPropertyChange) { owner.Visual3DModel = (Model3D)e.NewValue; } } ////// The Model3D to render /// public Model3D Model { get { return (Model3D) GetValue(ModelProperty); } set { SetValue(ModelProperty, value); } } ////// Called by the Automation infrastructure when AutomationPeer /// is requested for this element. /// protected override AutomationPeer OnCreateAutomationPeer() { return new UIElement3DAutomationPeer(this); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- RubberbandSelector.cs
- SchemaObjectWriter.cs
- ServiceModelSecurityTokenTypes.cs
- BitmapEffectCollection.cs
- AuthenticatedStream.cs
- SecurityContext.cs
- InkCanvasSelectionAdorner.cs
- PackWebResponse.cs
- NameValueSectionHandler.cs
- Signature.cs
- MediaScriptCommandRoutedEventArgs.cs
- SqlDataReader.cs
- ServiceInfo.cs
- DataKey.cs
- LassoSelectionBehavior.cs
- Control.cs
- DataControlImageButton.cs
- Visual3D.cs
- DebugView.cs
- TypeElement.cs
- OutputCacheModule.cs
- PathGradientBrush.cs
- ImageCodecInfoPrivate.cs
- FunctionUpdateCommand.cs
- CFStream.cs
- RegistryPermission.cs
- HighlightComponent.cs
- Baml2006ReaderContext.cs
- SpecialNameAttribute.cs
- PointAnimationClockResource.cs
- CommandHelpers.cs
- SoapInteropTypes.cs
- Timer.cs
- MethodImplAttribute.cs
- XPathExpr.cs
- TypeConverterMarkupExtension.cs
- ArgumentFixer.cs
- CodeMemberEvent.cs
- CompilationLock.cs
- GenericArgumentsUpdater.cs
- BaseParagraph.cs
- FormParameter.cs
- WebDescriptionAttribute.cs
- IndexerNameAttribute.cs
- CollaborationHelperFunctions.cs
- Vector3DKeyFrameCollection.cs
- GuidelineSet.cs
- PolicyLevel.cs
- PrimitiveXmlSerializers.cs
- ProgramNode.cs
- X509IssuerSerialKeyIdentifierClause.cs
- ColumnResizeAdorner.cs
- PropertyToken.cs
- EntryIndex.cs
- XmlObjectSerializerWriteContext.cs
- QilCloneVisitor.cs
- XmlDocumentFragment.cs
- DataSourceControlBuilder.cs
- AttributedMetaModel.cs
- EventManager.cs
- ProcessMessagesAsyncResult.cs
- WindowsPen.cs
- WindowsRegion.cs
- UniformGrid.cs
- PickBranchDesigner.xaml.cs
- ToolStripScrollButton.cs
- ArcSegment.cs
- FastPropertyAccessor.cs
- SQLDateTimeStorage.cs
- Lasso.cs
- UInt16Storage.cs
- LinqExpressionNormalizer.cs
- ModelItemImpl.cs
- NotConverter.cs
- TypefaceMetricsCache.cs
- ColumnBinding.cs
- XmlRawWriter.cs
- XmlWriterDelegator.cs
- InsufficientMemoryException.cs
- Matrix3D.cs
- Expressions.cs
- Canvas.cs
- RefType.cs
- DataGridRowEventArgs.cs
- Stroke2.cs
- activationcontext.cs
- GridViewSortEventArgs.cs
- BoundColumn.cs
- InvokePattern.cs
- OdbcEnvironmentHandle.cs
- CurrentChangedEventManager.cs
- AbandonedMutexException.cs
- SafeBuffer.cs
- DataFormats.cs
- GridViewEditEventArgs.cs
- RoutedPropertyChangedEventArgs.cs
- WindowsSysHeader.cs
- ping.cs
- FaultContractAttribute.cs
- FilteredAttributeCollection.cs