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
- TextSerializer.cs
- ToolBarOverflowPanel.cs
- IndentedWriter.cs
- ByteConverter.cs
- GridLength.cs
- PageThemeCodeDomTreeGenerator.cs
- ProfileGroupSettings.cs
- UniformGrid.cs
- MergePropertyDescriptor.cs
- StateDesigner.Helpers.cs
- TextServicesHost.cs
- DesignerOptionService.cs
- QueryCursorEventArgs.cs
- NameValueConfigurationElement.cs
- CancellationState.cs
- XpsSerializationException.cs
- VBCodeProvider.cs
- RtfToXamlLexer.cs
- XPathBinder.cs
- SynchronizationContext.cs
- PolyBezierSegment.cs
- MethodBuilder.cs
- AuthenticationModulesSection.cs
- DataServiceCollectionOfT.cs
- WebPartsPersonalizationAuthorization.cs
- ExpressionsCollectionConverter.cs
- FederatedMessageSecurityOverHttpElement.cs
- Win32PrintDialog.cs
- ContextQuery.cs
- MergeFailedEvent.cs
- ProxySimple.cs
- CalendarTable.cs
- EntitySetRetriever.cs
- SizeConverter.cs
- XmlAnyElementAttributes.cs
- KeyValueInternalCollection.cs
- DefaultObjectMappingItemCollection.cs
- SelectedDatesCollection.cs
- HttpListenerPrefixCollection.cs
- OpacityConverter.cs
- DataGridViewColumnConverter.cs
- SvcMapFileLoader.cs
- SqlParameter.cs
- EventMap.cs
- IISUnsafeMethods.cs
- StringBuilder.cs
- SettingsSection.cs
- URLAttribute.cs
- IdentityModelDictionary.cs
- CompilerTypeWithParams.cs
- BooleanExpr.cs
- DoubleCollectionValueSerializer.cs
- CommandManager.cs
- SqlCacheDependency.cs
- ClientSideQueueItem.cs
- EndpointConfigContainer.cs
- XPathSingletonIterator.cs
- EncoderExceptionFallback.cs
- Automation.cs
- DesignerSerializationManager.cs
- Padding.cs
- UpdatePanelTrigger.cs
- Button.cs
- WsdlInspector.cs
- MenuBase.cs
- InvalidOperationException.cs
- WpfXamlMember.cs
- UriWriter.cs
- HtmlInputText.cs
- FontSizeConverter.cs
- HtmlGenericControl.cs
- mactripleDES.cs
- GeneralTransform.cs
- ServiceRoute.cs
- ArrayList.cs
- SqlGatherConsumedAliases.cs
- FunctionDetailsReader.cs
- FindResponse.cs
- IndicCharClassifier.cs
- ObjectManager.cs
- CreateParams.cs
- DbConnectionPoolIdentity.cs
- NavigationHelper.cs
- BlockUIContainer.cs
- LoginUtil.cs
- DataViewListener.cs
- WorkflowViewManager.cs
- TabPage.cs
- UDPClient.cs
- SafeNativeMethods.cs
- RootNamespaceAttribute.cs
- MessageSecurityTokenVersion.cs
- StorageSetMapping.cs
- Calendar.cs
- RectKeyFrameCollection.cs
- DataKeyCollection.cs
- ActiveDocumentEvent.cs
- XmlConvert.cs
- SafeHandles.cs
- NativeWindow.cs