The $dsWindow variable can be used to access the ViewModel of a dialog or custom tabs.
Type
- Type in the context of Dialogs: System.Windows.Window
- Type in the context of Custom Tabs: System.Windows.Controls.UserControl
Accessing the ViewModel of a Dialog
The data ViewModel of a dialog can be accessed by the DataContext member of $dsWindow. Since the DataContext isn't initialized by the time the InitializeWindow functions is called, the event DataContextChanged can be used to retrieve the ViewModel.
function InitializeWindow { $dsWindow.add_DataContextChanged({ param($sender, $eventArgs) $viewModel = $dsWindow.DataContext }) }
ViewModel Types
MainViewModel
-
- No Collections available, since the view contains only a single document.
Valid for: Data Standard for Vault, Data Standard for AutoCAD
Available Collections:
CableAndHarnessViewModel
- HarnessAssemblies
- HarnessParts
Valid for: Data Standard for Inventor
Available Collections:
DesignAcceleratorViewModel
- DesignAcceleratorAssemblies
- DesignAcceleratorParts
Valid for: Data Standard for Inventor
Available Collections:
FrameGeneratorViewModel
- FrameDocuments
- FrameMemberDocuments
- SkeletonDocuments
Valid for: Data Standard for Inventor
Available Collections:
TubeAndPipeViewModel
- RunAssemblies
- RouteParts
- RunComponents
Valid for: Data Standard for Inventor
Available Collections:
Collections
All collections are implemented from the IDocumentInformation interface:
IDocumentInformation
public interface IDocumentInformation { IPathAndFileNameHandler Handler { get; } IPropertyCollection Properties { get; } _Document Document { get; } string Interest { get; } }