Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hallo,
a am searching for an event on the api which tells me when a user locks/unlock a view.
What i found out so far is that the kDefaultCommand is executed when clicking the btn.
....
application.CommandManager.UserInputEvents.OnStartCommand += OnStartCommand;
....
private void OnStartCommand(CommandIDEnum commandid)
{
logger.Debug($"OnStartCommand {commandid}");
}
So does any one know how to achieve this ?
My current solution would be :
private void OnStartCommand(CommandIDEnum commandid)
{
logger.Debug($"OnStartCommand {commandid}");
if (app.ActiveDocument is PartDocument part)
{
foreach (DesignViewRepresentation designViewRepresentation in part.ComponentDefinition.RepresentationsManager.DesignViewRepresentations)
{
if (viewLockedStatus.ContainsKey(designViewRepresentation.Name))
{
if (viewLockedStatus[designViewRepresentation.Name] != designViewRepresentation.Locked)
{
viewLockedStatus[designViewRepresentation.Name] = designViewRepresentation.Locked;
Messenger.Default.Send(new ViewLockStatusChangedMessage(designViewRepresentation.Name));
}
}
else
{
viewLockedStatus.Add(designViewRepresentation.Name, designViewRepresentation.Locked);
}
}
}
}
Thanks in advance
Christian
Solved! Go to Solution.