Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / 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
- FlowDocumentPageViewerAutomationPeer.cs
- Misc.cs
- HtmlInputCheckBox.cs
- Matrix3DValueSerializer.cs
- EasingKeyFrames.cs
- NestPullup.cs
- LineMetrics.cs
- InplaceBitmapMetadataWriter.cs
- EpmAttributeNameBuilder.cs
- cryptoapiTransform.cs
- DelegateSerializationHolder.cs
- String.cs
- RuleSetDialog.cs
- EventTask.cs
- ImageMapEventArgs.cs
- TextLineResult.cs
- MembershipSection.cs
- TemplateControlBuildProvider.cs
- FillErrorEventArgs.cs
- DBDataPermission.cs
- Rotation3D.cs
- ToolStripSplitButton.cs
- IPAddress.cs
- XamlReader.cs
- ParallelRangeManager.cs
- QueryCursorEventArgs.cs
- XmlCompatibilityReader.cs
- QilGenerator.cs
- MultiBindingExpression.cs
- AbsoluteQuery.cs
- FormatterServices.cs
- SeverityFilter.cs
- MobileListItem.cs
- RtfControls.cs
- AspNetSynchronizationContext.cs
- SqlBooleanizer.cs
- PermissionSet.cs
- JsonFormatGeneratorStatics.cs
- CacheManager.cs
- DbProviderFactoriesConfigurationHandler.cs
- METAHEADER.cs
- WebRequest.cs
- HttpApplicationStateBase.cs
- DeflateStreamAsyncResult.cs
- CompModSwitches.cs
- VersionPair.cs
- TypeTypeConverter.cs
- arclist.cs
- CroppedBitmap.cs
- SqlFileStream.cs
- InlinedLocationReference.cs
- CompressStream.cs
- PackagePart.cs
- Oid.cs
- FlowThrottle.cs
- WindowsListViewSubItem.cs
- ThreadPool.cs
- XmlTextWriter.cs
- MaterialGroup.cs
- RuntimeTransactionHandle.cs
- RoleManagerSection.cs
- RuntimeHandles.cs
- ProfileSettingsCollection.cs
- SettingsPropertyIsReadOnlyException.cs
- Setter.cs
- BuildProvidersCompiler.cs
- HtmlFormAdapter.cs
- NotConverter.cs
- SystemInformation.cs
- Vector3DKeyFrameCollection.cs
- DataGridViewAdvancedBorderStyle.cs
- EntityDataSourceDataSelectionPanel.cs
- TileBrush.cs
- SAPIEngineTypes.cs
- PassportAuthenticationModule.cs
- FrameworkElementFactory.cs
- ContentDisposition.cs
- ComponentResourceKeyConverter.cs
- InternalConfigHost.cs
- XamlSerializerUtil.cs
- ZipFileInfo.cs
- DispatcherExceptionFilterEventArgs.cs
- CodeParameterDeclarationExpression.cs
- FilteredAttributeCollection.cs
- Shape.cs
- ToolBarOverflowPanel.cs
- Ray3DHitTestResult.cs
- DetailsViewInsertedEventArgs.cs
- StylusButton.cs
- LocalizedNameDescriptionPair.cs
- translator.cs
- PerfCounterSection.cs
- SystemResourceHost.cs
- AsymmetricSignatureFormatter.cs
- ResXResourceReader.cs
- GroupItem.cs
- ListViewHitTestInfo.cs
- BitmapDownload.cs
- WebPartDisplayModeEventArgs.cs
- IsolatedStorage.cs