public void SetLockedSectionContainerExpanded( bool isExpanded )
Public Sub SetLockedSectionContainerExpanded( _ ByVal isExpanded As Boolean _ )
Parameters
- isExpanded
- Toggle expanded.
public void SetLockedSectionContainerExpanded( bool isExpanded )
Public Sub SetLockedSectionContainerExpanded( _ ByVal isExpanded As Boolean _ )
| Exception | Description |
|---|---|
| ArcGIS.Core.CalledOnWrongThreadException | This method or property must be called within the lambda passed to QueuedTask.Run |
{
//Toggle containers and visibility in the TOC
await QueuedTask.Run(() =>
{
voxelLayer.SetExpanded(!voxelLayer.IsExpanded);
voxelLayer.SetVisibility(!voxelLayer.IsVisible);
voxelLayer.SetIsosurfaceContainerExpanded(!voxelLayer.IsIsosurfaceContainerExpanded);
voxelLayer.SetIsosurfaceContainerVisibility(!voxelLayer.IsIsosurfaceContainerVisible);
voxelLayer.SetSliceContainerExpanded(voxelLayer.IsSliceContainerExpanded);
voxelLayer.SetSliceContainerVisibility(!voxelLayer.IsSliceContainerVisible);
voxelLayer.SetSectionContainerExpanded(!voxelLayer.IsSectionContainerExpanded);
voxelLayer.SetSectionContainerVisibility(!voxelLayer.IsSectionContainerVisible);
voxelLayer.SetLockedSectionContainerExpanded(!voxelLayer.IsLockedSectionContainerExpanded);
voxelLayer.SetLockedSectionContainerVisibility(!voxelLayer.IsLockedSectionContainerVisible);
});
}
{
await QueuedTask.Run(() =>
{
if (voxelLayer.Visualization != VoxelVisualization.Surface)
{
voxelLayer.SetVisualization(VoxelVisualization.Surface);
}
voxelLayer.SetLockedSectionContainerExpanded(true);
voxelLayer.SetLockedSectionContainerVisibility(true);
var locked_sections = voxelLayer.GetLockedSections();
});
}
{
var mapView = MapView.Active;
await QueuedTask.Run(() =>
{
if (voxelLayer.Visualization != VoxelVisualization.Surface)
{
voxelLayer.SetVisualization(VoxelVisualization.Surface);
}
voxelLayer.SetSectionContainerExpanded(true);
voxelLayer.SetLockedSectionContainerExpanded(true);
voxelLayer.SetLockedSectionContainerVisibility(true);
//Use the SelectedVariableProfile to get the sections
//via its associated volume
var volume = voxelLayer.SelectedVariableProfile.Volume;
//get the selected section
var section = mapView.GetSelectedSections().FirstOrDefault();
if (section == null)
{
section = volume.GetSections().FirstOrDefault();
}
if (section == null)
{
return;
}
//Lock the section (Creates a locked section, deletes
//the section)
//if (voxelLayer.CanLockSection(section))
// voxelLayer.LockSection(section);
if (volume.CanLockSection(section))
{
volume.LockSection(section);
}
});
}
{
await QueuedTask.Run(() =>
{
if (voxelLayer.Visualization != VoxelVisualization.Surface)
{
voxelLayer.SetVisualization(VoxelVisualization.Surface);
}
voxelLayer.SetLockedSectionContainerExpanded(true);
voxelLayer.SetLockedSectionContainerVisibility(true);
var locked_sections = voxelLayer.GetLockedSections().Where(ls => !ls.IsVisible);
//Make them visible
foreach (var locked_section in locked_sections)
{
locked_section.IsVisible = true;
//apply change
voxelLayer.UpdateSection(locked_section);
}
});
}
{
var mapView = MapView.Active;
await QueuedTask.Run(() =>
{
if (voxelLayer.Visualization != VoxelVisualization.Surface)
{
voxelLayer.SetVisualization(VoxelVisualization.Surface);
}
voxelLayer.SetSectionContainerExpanded(true);
voxelLayer.SetSectionContainerVisibility(true);
voxelLayer.SetLockedSectionContainerExpanded(true);
//get the selected locked section
var locked_section = mapView.GetSelectedLockedSections().FirstOrDefault();
if (locked_section == null)
{
locked_section = voxelLayer.GetLockedSections().FirstOrDefault();
}
if (locked_section == null)
{
return;
}
//Unlock the locked section (Deletes the locked section, creates
//a section)
if (voxelLayer.CanUnlockSection(locked_section))
{
voxelLayer.UnlockSection(locked_section);
}
});
}
Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)