[]
        
(Showing Draft Content)

C1.WPF.Tile.C1Tile

C1Tile Class

The C1Tile is an animated headered content control which mimics Windows 8 live tiles behavior.

Inheritance
C1Tile
Namespace: C1.WPF.Tile
Assembly: C1.WPF.Tile.4.6.2.dll
Syntax
[TemplatePart(Name = "LayoutRoot", Type = typeof(FrameworkElement))]
[TemplatePart(Name = "contentGrid", Type = typeof(FrameworkElement))]
[TemplatePart(Name = "ContentChangeAnimation", Type = typeof(Storyboard))]
[TemplatePart(Name = "ContentPresenter", Type = typeof(ContentPresenter))]
[TemplatePart(Name = "BackContentPresenter", Type = typeof(ContentPresenter))]
public class C1Tile : C1TileBase
Remarks

ContentChange storyboards must be defined in the root element resources. To define multiple ContentChange storyboards, set storyboard Key value to any string starting with C1Tile.ContentChangeAnimationName. If control template defines multiple storyboards, the C1Tile control will run corresponding storyboards randomly.

Constructors

Name Description
C1Tile()

Initializes the new instance of the C1Tile control.

Fields

Name Description
BackContentProperty

Identifies the BackContent dependency property.

BackContentTemplateProperty

Identifies the BackContentTemplate dependency property.

ContentSourceProperty

Identifies the ContentSource dependency property.

_contentChangeAnimations

Keeps the list of storyboards found in the ControlTemplate.

_root

The root element of the control template visual tree.

Properties

Name Description
BackContent

Gets or sets the object representing the old content of the C1Tile control.

BackContentTemplate

Gets or sets the DataTemplate which should be used as an alternate to the one defined by the ContentTemplate property. The default value is null.

ContentSource

Gets or sets an object source used to generate the content of the C1Tile control.

Methods

Name Description
AnimateTileContent()

If current C1Tile object is not frozen, runs random storyboard from the set of storyboards defined in the C1Tile control template which keys are started with "ContentChangeAnimation".

C1Tile_SizeChanged(object, SizeChangedEventArgs)

The default implementation sets the C1Tile.Clip property so that to clip it on bounds.

OnApplyTemplate()
OnContentChanged(object, object)

Called when the Content property changes. This implementation performs next actions:

  • places old content into the BackContentPresenter element,
  • updates ContentPresenter element with new content,
  • updates ContentTemplate if BackContentTemplate or ContentTemplateSelector property is set,
  • runs tile update animation.
OnContentTemplateChanged(DataTemplate, DataTemplate)
OnContentTemplateSelectorChanged(DataTemplateSelector, DataTemplateSelector)
UpdateTile()

Performs tile update according to the ContentSource property value and the set of defined ContentChangeAnimations.