Leadtools.Web Send comments on this topic. | Back to Introduction - All Topics | Help Version 16.5.9.25
PropertyChanged Event
See Also  Example
Leadtools.Web.Controls Namespace > WebImageViewer Class : PropertyChanged Event



Notifies clients that a property value has changed.

Syntax

Visual Basic (Declaration) 
Public Event PropertyChanged() As PropertyChangedEventHandler
Visual Basic (Usage)Copy Code
Dim instance As WebImageViewer
Dim handler As PropertyChangedEventHandler
 
AddHandler instance.PropertyChanged, handler
C# 
public event PropertyChangedEventHandler PropertyChanged()
C++/CLI 
public:
event PropertyChangedEventHandler PropertyChanged();

Example

This example handles the PropertyChanged event.

Visual BasicCopy Code
Public Sub WebImageViewer_PropertyChanged(ByVal mainWebImageViewer As WebImageViewer)
   AddHandler mainWebImageViewer.PropertyChanged, New System.ComponentModel.PropertyChangedEventHandler(AddressOf mainWebImageViewer_PropertyChanged)
   ''
   '' update some properties values
   ''
   AddHandler mainWebImageViewer.PropertyChanged, New System.ComponentModel.PropertyChangedEventHandler(AddressOf mainWebImageViewer_PropertyChanged)
End Sub
Sub mainWebImageViewer_PropertyChanged(ByVal sender As Object, ByVal e As System.ComponentModel.PropertyChangedEventArgs)
   If (e.PropertyName = "ScaleFactor") Then
      '' ScaleFactor property changed.
   ElseIf (e.PropertyName = "SizeMode") Then
      '' SizeMode property changed.

      ''
      ''etc.
      ''
   End If
End Sub
C#Copy Code
public void WebImageViewer_PropertyChanged(WebImageViewer mainWebImageViewer) 

   mainWebImageViewer.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(mainWebImageViewer_PropertyChanged); 
   // 
   // update some properties values 
   // 
   mainWebImageViewer.PropertyChanged -= new System.ComponentModel.PropertyChangedEventHandler(mainWebImageViewer_PropertyChanged); 

void mainWebImageViewer_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) 

   if(e.PropertyName == "ScaleFactor") 
   { 
      // ScaleFactor property changed. 
   } 
   else if(e.PropertyName == "SizeMode") 
   { 
      // SizeMode property changed. 
   } 
   // 
   //etc. 
   // 
}

Remarks

The PropertyChanged event can indicate all properties on the object have changed by using either a null reference (Nothing in Visual Basic) or String.Empty as the property name in the PropertyChangedEventArgs.

Requirements

Target Platforms: Microsoft .NET Framework 2.0, Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also