Quantcast
Channel: Resizing a shape not working
Viewing all articles
Browse latest Browse all 3

Resizing a shape not working

$
0
0

Hi folks,

 

I wrote some code against the components sample to resize a shape when an click event from a custom decorator is intercepted. The code attempts to resize the control by changing the Size property of the shape within a transaction. Problem is, nothing happens, despite refreshes forced by invalidating both the shape and diagram. Does anyone know what I'm doing wrong, or know how this is supposed to be done?

 

For reference, here's the code that does the resizing:

Transaction in OnClick()

using (Transaction transaction = systemShape.Store.TransactionManager.BeginTransaction("Collapse/Expand"))

{

  systemShape.ToggleSystemVisibility();

  systemShape.ToggleCollapsed();

  systemShape.Diagram.Invalidate();

}

 

Here's the ToggleCollapsed function:

ToggleCollapsed function

///

/// Switches the shape between the expanded and collapsed state.

/// Dimensions for the respective states are maintained.

///

publicvoid ToggleCollapsed()

{

   if (this.collapsed)

  {

    this.expandedSize = this.Size;

    this.Size = this.collapsedSize;

  }

  else

  {

    this.collapsedSize = this.Size;

    this.Size = this.expandedSize;

  }

}

 

Thanks,

Frederick


Viewing all articles
Browse latest Browse all 3

Latest Images

Trending Articles





Latest Images