CaptionFormatted Событие (ThumbnailImageItemCaption)
 
            Происходит при форматировании текста подписи.
            
            
Вот C#/VB.NET код, который демонстрирует, как настроить заголовок миниатюры:
    
	
	    
	    
''' <summary>
''' Sets the custom thumbnail caption.
''' </summary>
''' <param name="thumbnailViewer">The thumbnail viewer.</param>
Public Shared Sub SetCustomThumbnailCaption(thumbnailViewer As Vintasoft.Imaging.Wpf.UI.WpfThumbnailViewer)
    AddHandler thumbnailViewer.ThumbnailCaption.CaptionFormatted, AddressOf ThumbnailCaption_CaptionFormatted
    thumbnailViewer.ThumbnailCaption.IsVisible = True
End Sub
''' <summary>
''' Handles the CaptionFormatted event of the ThumbnailCaption.
''' </summary>
''' <param name="sender">The source of the event.</param>
''' <param name="e">The <see cref="Vintasoft.Imaging.Wpf.UI.ThumbnailImageItemCaptionFormattedEventArgs"/> instance containing the event data.</param>
Private Shared Sub ThumbnailCaption_CaptionFormatted(sender As Object, e As Vintasoft.Imaging.Wpf.UI.ThumbnailImageItemCaptionFormattedEventArgs)
    Dim image As Vintasoft.Imaging.VintasoftImage = e.Thumbnail.Source
    Dim imageIndex As Integer = e.ThumbnailViewer.Images.IndexOf(image)
    If e.ThumbnailViewer.SelectedThumbnails.Contains(e.Thumbnail) Then
        e.Caption = "Selected"
    Else
        e.Caption = String.Format("{0}, page {1}", System.IO.Path.GetFileName(image.SourceInfo.Filename), image.SourceInfo.PageIndex + 1)
    End If
End Sub
	     
	 
 
    
	
	    
	    
/// <summary>
/// Sets the custom thumbnail caption.
/// </summary>
/// <param name="thumbnailViewer">The thumbnail viewer.</param>
public static void SetCustomThumbnailCaption(Vintasoft.Imaging.Wpf.UI.WpfThumbnailViewer thumbnailViewer)
{
    thumbnailViewer.ThumbnailCaption.CaptionFormatted += ThumbnailCaption_CaptionFormatted;
    thumbnailViewer.ThumbnailCaption.IsVisible = true;
}
/// <summary>
/// Handles the CaptionFormatted event of the ThumbnailCaption.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="Vintasoft.Imaging.Wpf.UI.ThumbnailImageItemCaptionFormattedEventArgs"/> instance containing the event data.</param>
private static void ThumbnailCaption_CaptionFormatted(object sender, Vintasoft.Imaging.Wpf.UI.ThumbnailImageItemCaptionFormattedEventArgs e)
{
    Vintasoft.Imaging.VintasoftImage image = e.Thumbnail.Source;
    int imageIndex = e.ThumbnailViewer.Images.IndexOf(image);
    if (e.ThumbnailViewer.SelectedThumbnails.Contains(e.Thumbnail))
    {
        e.Caption = "Selected";
    }
    else
    {
        e.Caption = string.Format("{0}, page {1}", System.IO.Path.GetFileName(image.SourceInfo.Filename), image.SourceInfo.PageIndex + 1);
    }
}
	     
	 
 
 
Целевые платформы: .NET 9; .NET 8; .NET 7; .NET 6; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5