Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / wpf / src / Core / CSharp / System / Windows / Media3D / ModelUIElement3D.cs / 1 / 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
- XPathScanner.cs
- NetCodeGroup.cs
- Token.cs
- connectionpool.cs
- FilteredAttributeCollection.cs
- TemplateColumn.cs
- MatrixTransform.cs
- ClientWindowsAuthenticationMembershipProvider.cs
- AvTrace.cs
- TimeSpanConverter.cs
- EndOfStreamException.cs
- NavigationProgressEventArgs.cs
- Function.cs
- ServiceCredentials.cs
- DisposableCollectionWrapper.cs
- HashStream.cs
- SimpleBitVector32.cs
- XamlDesignerSerializationManager.cs
- EntryPointNotFoundException.cs
- SparseMemoryStream.cs
- ResourceType.cs
- GradientStop.cs
- ColorTranslator.cs
- EqualityComparer.cs
- DataKey.cs
- AVElementHelper.cs
- ProvideValueServiceProvider.cs
- XmlNodeChangedEventManager.cs
- RequestContext.cs
- XmlDocumentFieldSchema.cs
- Opcode.cs
- MemberAccessException.cs
- UIElement.cs
- DiscriminatorMap.cs
- EtwTrace.cs
- TaiwanLunisolarCalendar.cs
- ModelItemExtensions.cs
- OperationContext.cs
- XmlCDATASection.cs
- SlipBehavior.cs
- SourceSwitch.cs
- UnsafeNativeMethods.cs
- DataGridViewRowPrePaintEventArgs.cs
- DesignerSerializationOptionsAttribute.cs
- NavigationCommands.cs
- WorkflowServiceHostFactory.cs
- ServerValidateEventArgs.cs
- PrintPageEvent.cs
- wmiprovider.cs
- HeaderedContentControl.cs
- BulletedListDesigner.cs
- EntityAdapter.cs
- SamlNameIdentifierClaimResource.cs
- SamlEvidence.cs
- ExpressionConverter.cs
- OracleRowUpdatedEventArgs.cs
- SapiRecoInterop.cs
- CustomValidator.cs
- OdbcDataAdapter.cs
- FillBehavior.cs
- UserControl.cs
- Char.cs
- HtmlShim.cs
- SynchronizingStream.cs
- TaskExtensions.cs
- _HeaderInfo.cs
- UnknownWrapper.cs
- DataFormat.cs
- ResourceExpression.cs
- RemotingAttributes.cs
- SamlSerializer.cs
- WindowCollection.cs
- PersonalizationProviderHelper.cs
- StrongNamePublicKeyBlob.cs
- IndentedWriter.cs
- ListControlConvertEventArgs.cs
- HtmlTextArea.cs
- TableCellAutomationPeer.cs
- DataServiceConfiguration.cs
- SystemColors.cs
- SmiMetaDataProperty.cs
- SchemaNamespaceManager.cs
- HtmlTextArea.cs
- DataObjectEventArgs.cs
- NativeMethods.cs
- TypeDescriptorContext.cs
- SimpleRecyclingCache.cs
- UidManager.cs
- COM2ICategorizePropertiesHandler.cs
- IconEditor.cs
- CodeDOMUtility.cs
- LogPolicy.cs
- ForwardPositionQuery.cs
- GenericEnumerator.cs
- ClientApiGenerator.cs
- SelectionProviderWrapper.cs
- SqlCharStream.cs
- coordinator.cs
- SchemaImporterExtensionsSection.cs
- CookieParameter.cs