LEADTOOLS Annotations for WPF and Silverlight (Leadtools.Windows.Annotations assembly) Send comments on this topic. | Back to Introduction - All Topics | Help Version 17.0.3.31
Invalidate Method
See Also 
Leadtools.Windows.Annotations Namespace > AnnObject Class : Invalidate Method



Invalidates the whole area of this object and signals the container to redraw the control. Supported in Silverlight, Windows Phone 7

Syntax

Visual Basic (Declaration) 
Public Overridable Sub Invalidate() 
Visual Basic (Usage)Copy Code
Dim instance As AnnObject
 
instance.Invalidate()
C# 
public virtual void Invalidate()
C++/CLI 
public:
virtual void Invalidate(); 

Example

This example will check if any of the objects in a container is a line, if so, it will change the color to red and signal the container to redraw the the object.

Visual BasicCopy Code
Private Sub InvalidateExample(ByVal container As AnnContainer)
   For Each obj As AnnObject In container.Children
      If TypeOf (obj) Is AnnLineObject Then
         obj.Stroke = Colors.Red
         obj.Invalidate()
      End If
   Next
End Sub
C#Copy Code
private void InvalidateExample(AnnContainer container)
{
   foreach(AnnObject obj in container.Children)
   {
      if(obj is AnnLineObject)
      {
         obj.Stroke = Colors.Red;
         obj.Invalidate();
      }
   }
}
SilverlightCSharpCopy Code
private void InvalidateExample(AnnContainer container)
{
   foreach(AnnObject obj in container.Children)
   {
      if(obj is AnnLineObject)
      {
         obj.Stroke = Colors.Red;
         obj.Invalidate();
      }
   }
}
SilverlightVBCopy Code
Private Sub InvalidateExample(ByVal container As AnnContainer)
   For Each obj As AnnObject In container.Children
      If TypeOf obj Is AnnLineObject Then
         obj.Stroke = Colors.Red
         obj.Invalidate()
      End If
   Next obj
End Sub

Requirements

Target Platforms: Silverlight 3.0, Windows XP, Windows Server 2003 family, Windows Server 2008 family, Windows Vista, Windows 7, MAC OS/X (Intel Only)

See Also

Invalidate requires a Document/Medical product license and unlock key. For more information, refer to: Imaging Pro/Document/Medical Features and Unlocking Special LEAD Features.