C# Class PoshCode.Controls.ThumbnailImage

======================================== .NET Framework 3.0 Custom Control ======================================== Follow steps 1a or 1b and then 2 to use this custom control in a XAML file. Step 1a) Using this custom control in a XAML file that exists in the current project. Add this XmlNamespace attribute to the root element of the markup file where it is to be used: xmlns:MyNamespace="clr-namespace:Thumbnailer" Step 1b) Using this custom control in a XAML file that exists in a different project. Add this XmlNamespace attribute to the root element of the markup file where it is to be used: xmlns:MyNamespace="clr-namespace:Thumbnailer;assembly=Thumbnailer" You will also need to add a project reference from the project where the XAML file lives to this project and Rebuild to avoid compilation errors: Right click on the target project in the Solution Explorer and "Add Reference"->"Projects"->[Browse to and select this project] Step 2) Go ahead and use your control in the XAML file. Note that Intellisense in the XML editor does not currently work on custom controls and its child elements.
Inheritance: System.Windows.Controls.Image, IDisposable
ファイルを表示 Open project: Jaykul/PoshConsole

Public Properties

Property Type Description
ClientAreaOnlyProperty System.Windows.DependencyProperty
WindowSourceProperty System.Windows.DependencyProperty

Public Methods

Method Description
Dispose ( ) : void
ThumbnailImage ( IntPtr source ) : System

Initializes a new instance of the ThumbnailImage class.

Protected Methods

Method Description
ArrangeOverride ( Size arrangeSize ) : Size

Positions elements and determines a size for the ThumbnailImage

Dispose ( bool disposing ) : void
MeasureOverride ( Size constraint ) : Size

Measures the size in layout required for child elements and determines a size for the Image.

Private Methods

Method Description
InitialiseThumbnail ( IntPtr source ) : void

Initialises the thumbnail image

OnClientAreaOnlyChanged ( DependencyObject depObj, System.Windows.DependencyPropertyChangedEventArgs args ) : void
OnWindowSourceChanged ( DependencyObject depObj, System.Windows.DependencyPropertyChangedEventArgs args ) : void
ReleaseThumbnail ( ) : void

Releases the thumbnail

ThumbnailImage ( ) : System

Initializes the ThumbnailImage class.

Thumbnail_LayoutUpdated ( object sender, EventArgs e ) : void

Handles the LayoutUpdated event of the Thumbnail image Actually, we really just ask Windows to paint us at our new size...

Thumbnail_Unloaded ( object sender, RoutedEventArgs e ) : void

Handles the Unloaded event of the Thumbnail control.

UpdateThumbnail ( ) : void

Updates the thumbnail

Method Details

ArrangeOverride() protected method

Positions elements and determines a size for the ThumbnailImage
protected ArrangeOverride ( Size arrangeSize ) : Size
arrangeSize System.Windows.Size The final area within the parent that this element should use to arrange itself and its children.
return System.Windows.Size

Dispose() public method

public Dispose ( ) : void
return void

Dispose() protected method

protected Dispose ( bool disposing ) : void
disposing bool
return void

MeasureOverride() protected method

Measures the size in layout required for child elements and determines a size for the Image.
protected MeasureOverride ( Size constraint ) : Size
constraint System.Windows.Size The available size that this element can give to child elements. /// Infinity can be specified as a value to indicate that the element will size to whatever content is available.
return System.Windows.Size

ThumbnailImage() public method

Initializes a new instance of the ThumbnailImage class.
public ThumbnailImage ( IntPtr source ) : System
source System.IntPtr
return System

Property Details

ClientAreaOnlyProperty public_oe static_oe property

public static DependencyProperty,System.Windows ClientAreaOnlyProperty
return System.Windows.DependencyProperty

WindowSourceProperty public_oe static_oe property

public static DependencyProperty,System.Windows WindowSourceProperty
return System.Windows.DependencyProperty