US 1889327: Updated H2 and column headers. (#1326)

* Updated H2 and column headers.

* Metadata update.

* Minor edits.

* Apply suggestions from code review

Co-authored-by: Andy (Steve) De George <[email protected]>
This commit is contained in:
Pooja Poojari
2022-03-07 21:22:00 +00:00
committed by GitHub
co-authored by Andy De George
parent 6d665a13bd
commit 692293bda8
20 changed files with 107 additions and 58 deletions
@@ -1,6 +1,8 @@
---
title: "How to: Play Media using a VideoDrawing"
description: Learn how to play Media using a VideoDrawing.
ms.date: "03/30/2017"
ms.custom: devdivchpfy22
helpviewer_keywords:
- "playback of media [WPF]"
- "classes [WPF], MediaPlayer"
@@ -12,14 +14,14 @@ To play an audio or video file, you use a <xref:System.Windows.Media.VideoDrawin
> [!NOTE]
> When distributing media with your application, you cannot use a media file as a project resource, like you would an image. In your project file, you must instead set the media type to `Content` and set `CopyToOutputDirectory` to `PreserveNewest` or `Always`.
## Example
## Use a VideoDrawing and a MediaPlayer
The following example uses a <xref:System.Windows.Media.VideoDrawing> and a <xref:System.Windows.Media.MediaPlayer> to play a video file once.
[!code-csharp[DrawingMiscSnippets_snip#VideoDrawingExampleInline](~/samples/snippets/csharp/VS_Snippets_Wpf/DrawingMiscSnippets_snip/CSharp/VideoDrawingExample.cs#videodrawingexampleinline)]
To gain additional timing control over the media, use a <xref:System.Windows.Media.MediaTimeline> with the <xref:System.Windows.Media.MediaPlayer> and <xref:System.Windows.Media.VideoDrawing> objects. The <xref:System.Windows.Media.MediaTimeline> enables you to specify whether the video should repeat.
## Example
## Use a MediaTimeline
The following example uses a <xref:System.Windows.Media.MediaTimeline> with the <xref:System.Windows.Media.MediaPlayer> and <xref:System.Windows.Media.VideoDrawing> objects to play a video repeatedly.
[!code-csharp[DrawingMiscSnippets_snip#RepeatingVideoDrawingExampleInline](~/samples/snippets/csharp/VS_Snippets_Wpf/DrawingMiscSnippets_snip/CSharp/VideoDrawingExample.cs#repeatingvideodrawingexampleinline)]
@@ -1,6 +1,8 @@
---
title: "How to: Receive Notification When a Clock's State Changes"
description: Learn how to receive notification when a Clock's state changes.
ms.date: "03/30/2017"
ms.custom: devdivchpfy22
dev_langs:
- "csharp"
- "vb"
@@ -26,16 +28,26 @@ A clock's <xref:System.Windows.Media.Animation.Clock.CurrentStateInvalidated> ev
The following table shows the times at which *Animation1*'s <xref:System.Windows.Media.Animation.Timeline.CurrentStateInvalidated> event fires:
||||||||
|-|-|-|-|-|-|-|
|Time (Seconds)|1|10|19|21|30|39|
|State|Active|Active|Stopped|Active|Active|Stopped|
| Time (Seconds) | State |
|----------------|-------|
|1|Active|
|10|Active|
|19|Stopped|
|21|Active|
|30|Active|
|39|Stopped|
The following table shows the times at which *Animation2*'s <xref:System.Windows.Media.Animation.Timeline.CurrentStateInvalidated> event fires:
||||||||||
|-|-|-|-|-|-|-|-|-|
|Time (Seconds)|1|9|11|19|21|29|31|39|
|State|Active|Filling|Active|Stopped|Active|Filling|Active|Stopped|
| Time (Seconds) | State |
|----------------|-------|
|1|Active|
|9|Filling|
|11|Active|
|19|Stopped|
|21|Active|
|29|Filling|
|31|Active|
|39|Stopped|
Notice that *Animation1*'s <xref:System.Windows.Media.Animation.Timeline.CurrentStateInvalidated> event fires at 10 seconds, even though its state remains <xref:System.Windows.Media.Animation.ClockState.Active>. That's because its state changed at 10 seconds, but it changed from <xref:System.Windows.Media.Animation.ClockState.Active> to <xref:System.Windows.Media.Animation.ClockState.Filling> and then back to <xref:System.Windows.Media.Animation.ClockState.Active> in the same tick.
@@ -1,6 +1,8 @@
---
title: "How to: Seek a Storyboard Synchronously"
description: Learn how to seek a Storyboard synchronously.
ms.date: "03/30/2017"
ms.custom: devdivchpfy22
dev_langs:
- "csharp"
- "vb"
@@ -12,12 +14,12 @@ ms.assetid: 03e06271-a946-4810-88ea-3fb4cfa9e0f1
# How to: Seek a Storyboard Synchronously
The following example shows how to use the <xref:System.Windows.Media.Animation.Storyboard.SeekAlignedToLastTick%2A> method of a <xref:System.Windows.Media.Animation.Storyboard> to seek to any position in a storyboard animation synchronously.
## Example
## XAML markup
The following is the XAML markup for the sample.
[!code-xaml[SeekStoryboard_snip#SeekStoryboardSynchronouslyExampleWholePage](~/samples/snippets/csharp/VS_Snippets_Wpf/SeekStoryboard_snip/CSharp/SeekStoryboardSynchronouslyExample.xaml#seekstoryboardsynchronouslyexamplewholepage)]
## Example
## Code
The following is the code used with the XAML code above.
[!code-csharp[SeekStoryboard_snip#SeekStoryboardSynchronouslyCodeBehindExampleWholePage](~/samples/snippets/csharp/VS_Snippets_Wpf/SeekStoryboard_snip/CSharp/SeekStoryboardSynchronouslyExample.xaml.cs#seekstoryboardsynchronouslycodebehindexamplewholepage)]
@@ -1,6 +1,8 @@
---
title: "How to: Seek a Storyboard"
description: Learn how to seek a Storyboard.
ms.date: "03/30/2017"
ms.custom: devdivchpfy22
dev_langs:
- "csharp"
- "vb"
@@ -12,12 +14,12 @@ ms.assetid: 887bb39a-0c2a-4ae8-956d-1d9f6f8ebbfc
# How to: Seek a Storyboard
The following example shows how to use the <xref:System.Windows.Media.Animation.Storyboard.Seek%2A> method of a <xref:System.Windows.Media.Animation.Storyboard> to jump to any position in a storyboard animation.
## Example
## Sample XAML markup
Below is the XAML markup for the sample.
[!code-xaml[SeekStoryboard_snip#SeekStoryboardExampleWholePage](~/samples/snippets/csharp/VS_Snippets_Wpf/SeekStoryboard_snip/CSharp/SeekStoryboardExample.xaml#seekstoryboardexamplewholepage)]
## Example
## Code
Below is the code used with the XAML code above.
[!code-csharp[SeekStoryboard_snip#SeekStoryboardCodeBehindExampleWholePage](~/samples/snippets/csharp/VS_Snippets_Wpf/SeekStoryboard_snip/CSharp/SeekStoryboardExample.xaml.cs#seekstoryboardcodebehindexamplewholepage)]
@@ -1,6 +1,8 @@
---
title: "How to: Set a Property After Animating It with a Storyboard"
description: Learn how to set a Property after animating it with a Storyboard.
ms.date: "03/30/2017"
ms.custom: devdivchpfy22
dev_langs:
- "csharp"
- "vb"
@@ -11,12 +13,12 @@ ms.assetid: 79466556-4dbf-40bd-9c1e-a77613b07077
# How to: Set a Property After Animating It with a Storyboard
In some cases, it might appear that you can't change the value of a property after it has been animated.
## Example
## Animate the color of a SolidColorBrush
In the following example, a <xref:System.Windows.Media.Animation.Storyboard> is used to animate the color of a <xref:System.Windows.Media.SolidColorBrush>. The storyboard is triggered when the button is clicked. The <xref:System.Windows.Media.Animation.Timeline.Completed> event is handled so that the program is notified when the <xref:System.Windows.Media.Animation.ColorAnimation> completes.
[!code-xaml[timingbehaviors_snip#GraphicsMMButton1Declaration](~/samples/snippets/csharp/VS_Snippets_Wpf/timingbehaviors_snip/CSharp/AnimateThenSetPropertyExample.xaml#graphicsmmbutton1declaration)]
## Example
## Change the brush color
After the <xref:System.Windows.Media.Animation.ColorAnimation> completes, the program attempts to change the brush's color to blue.
[!code-csharp[timingbehaviors_snip#GraphicsMMButton1Handler](~/samples/snippets/csharp/VS_Snippets_Wpf/timingbehaviors_snip/CSharp/AnimateThenSetPropertyExample.xaml.cs#graphicsmmbutton1handler)]
@@ -1,6 +1,8 @@
---
title: "How to: Set the Horizontal and Vertical Alignment of a TileBrush"
description: Learn how to set the Horizontal and Vertical alignment of a TileBrush.
ms.date: "03/30/2017"
ms.custom: devdivchpfy22
dev_langs:
- "csharp"
- "vb"
@@ -20,7 +22,7 @@ This example shows how to control the horizontal and vertical alignment of conte
- The <xref:System.Windows.Media.TileBrush.Stretch%2A> property is <xref:System.Windows.Media.Stretch.None> and the <xref:System.Windows.Media.TileBrush.Viewbox%2A> and <xref:System.Windows.Media.TileBrush.Viewport%2A> are different sizes.
## Example
## Align TileBrush to upper-left corner
The following example aligns the content of a <xref:System.Windows.Media.DrawingBrush>, which is a type of <xref:System.Windows.Media.TileBrush>, to the upper-left corner of its tile. To align the content, the example sets the <xref:System.Windows.Media.TileBrush.AlignmentX%2A> property of the <xref:System.Windows.Media.DrawingBrush> to <xref:System.Windows.Media.AlignmentX.Left> and the <xref:System.Windows.Media.TileBrush.AlignmentY%2A> property to <xref:System.Windows.Media.AlignmentY.Top>. This example produces the following output.
![A TileBrush with top&#45;left alignment](./media/graphicsmm-tilebrushalignmentexampletopleft.png "graphicsmm_TileBrushAlignmentExampleTopLeft")
@@ -30,7 +32,7 @@ TileBrush with content aligned to the upper-left corner
[!code-vb[brushoverviewexamples_snip#TileBrushTopLeftAlignmentInline](~/samples/snippets/visualbasic/VS_Snippets_Wpf/BrushOverviewExamples_snip/visualbasic/tilebrushalignmentexample.vb#tilebrushtopleftalignmentinline)]
[!code-xaml[brushoverviewexamples_snip#TileBrushTopLeftAlignmentInline](~/samples/snippets/xaml/VS_Snippets_Wpf/BrushOverviewExamples_snip/XAML/TileBrushAlignmentExample.xaml#tilebrushtopleftalignmentinline)]
## Example
## Align DrawingBrush to lower-right corner
The next example aligns the content of a <xref:System.Windows.Media.DrawingBrush> to the lower-right corner of its tile by setting the <xref:System.Windows.Media.TileBrush.AlignmentX%2A> property to <xref:System.Windows.Media.AlignmentX.Right> and the <xref:System.Windows.Media.TileBrush.AlignmentY%2A> property to <xref:System.Windows.Media.AlignmentY.Bottom>. The example produces the following output.
![A TileBrush with bottom&#45;right alignment](./media/graphicsmm-tilebrushalignmentexamplebottomright.png "graphicsmm_TileBrushAlignmentExampleBottomRight")
@@ -40,7 +42,7 @@ TileBrush with content aligned to the lower-right corner
[!code-vb[brushoverviewexamples_snip#TileBrushBottomRightAlignmentInline](~/samples/snippets/visualbasic/VS_Snippets_Wpf/BrushOverviewExamples_snip/visualbasic/tilebrushalignmentexample.vb#tilebrushbottomrightalignmentinline)]
[!code-xaml[brushoverviewexamples_snip#TileBrushBottomRightAlignmentInline](~/samples/snippets/xaml/VS_Snippets_Wpf/BrushOverviewExamples_snip/XAML/TileBrushAlignmentExample.xaml#tilebrushbottomrightalignmentinline)]
## Example
## Align DrawingBrush to upper-left corner
The next example aligns the content of a <xref:System.Windows.Media.DrawingBrush> to the upper-left corner of its tile by setting the <xref:System.Windows.Media.TileBrush.AlignmentX%2A> property to <xref:System.Windows.Media.AlignmentX.Left> and the <xref:System.Windows.Media.TileBrush.AlignmentY%2A> property to <xref:System.Windows.Media.AlignmentY.Top>. It also sets the <xref:System.Windows.Media.TileBrush.Viewport%2A> and <xref:System.Windows.Media.TileBrush.TileMode%2A> of the <xref:System.Windows.Media.DrawingBrush> to produce a tile pattern. The example produces the following output.
![A tiled TileBrush with top&#45;left alignment](./media/graphicsmm-tilebrushalignmentexampletoplefttiled.png "graphicsmm_TileBrushAlignmentExampleTopLeftTiled")
@@ -52,7 +54,7 @@ Tile pattern with content aligned to upper-left in base tile
[!code-vb[brushoverviewexamples_snip#TileBrushTopLeftAlignmentTiledInline](~/samples/snippets/visualbasic/VS_Snippets_Wpf/BrushOverviewExamples_snip/visualbasic/tilebrushalignmentexample.vb#tilebrushtopleftalignmenttiledinline)]
[!code-xaml[brushoverviewexamples_snip#TileBrushTopLeftAlignmentTiledInline](~/samples/snippets/xaml/VS_Snippets_Wpf/BrushOverviewExamples_snip/XAML/TileBrushAlignmentExample.xaml#tilebrushtopleftalignmenttiledinline)]
## Example
## Align tiled DrawingBrush to lower-right corner
The final example aligns the content of a tiled <xref:System.Windows.Media.DrawingBrush> to the lower-right of its base tile by setting the <xref:System.Windows.Media.TileBrush.AlignmentX%2A> property to <xref:System.Windows.Media.AlignmentX.Right> and the <xref:System.Windows.Media.TileBrush.AlignmentY%2A> property to <xref:System.Windows.Media.AlignmentY.Bottom>. The example produces the following output.
![A tiled TileBrush with bottom&#45;right alignment](./media/graphicsmm-tilebrushalignmentexamplebottomrighttiled.png "graphicsmm_TileBrushAlignmentExampleBottomRightTiled")
@@ -2,6 +2,7 @@
title: "Storyboards Overview"
description: Organize and apply animations in storyboards. Use property-targeting syntax and combine timelines in Windows Presentation Foundation (WPF).
ms.date: "03/30/2017"
ms.custom: devdivchpfy22
dev_langs:
- "csharp"
- "vb"
@@ -147,8 +148,8 @@ The following sections describe indirect property targeting syntax in more detai
To target a property of a freezable in [!INCLUDE[TLA2#tla_xaml](../../../includes/tla2sharptla-xaml-md.md)], use the following syntax.
| |
|-|
| Property syntax |
|-----------------|
|*ElementPropertyName* `.` *FreezablePropertyName*|
Where
@@ -165,8 +166,8 @@ Sometimes you need to target a freezable contained in a collection or array.
To target a freezable contained in a collection, you use the following path syntax.
| |
|-|
| Path syntax |
|-------------|
|*ElementPropertyName* `.Children[` *CollectionIndex* `].` *FreezablePropertyName*|
Where *CollectionIndex* is the index of the object in its array or collection.
@@ -193,8 +194,8 @@ The following is an example of a dependency property chain that targets the <xre
You also need to specify a <xref:System.Windows.PropertyPath.Path%2A>. A <xref:System.Windows.PropertyPath.Path%2A> is a <xref:System.String> that tells the <xref:System.Windows.PropertyPath.Path%2A> how to interpret its <xref:System.Windows.PropertyPath.PathParameters%2A>. It uses the following syntax.
| |
|-|
| Property path syntax |
|----------------------|
|`(` *OwnerPropertyArrayIndex* `).(` *FreezablePropertyArrayIndex* `)`|
Where
@@ -217,8 +218,8 @@ Sometimes you need to target a freezable contained in a collection or array. For
To target a <xref:System.Windows.Freezable> contained in a collection, you use the following path syntax.
| |
|-|
| Path syntax |
|-------------|
|`(` *OwnerPropertyArrayIndex* `).(` *CollectionChildrenPropertyArrayIndex* `)` `[` *CollectionIndex* `].(` *FreezablePropertyArrayIndex* `)`|
Where *CollectionIndex* is the index of the object in its array or collection.
@@ -1,6 +1,8 @@
---
title: "Timing Behaviors Overview"
description: Learn about the Timing Behaviors Overview.
ms.date: "03/30/2017"
ms.custom: devdivchpfy22
helpviewer_keywords:
- "timing behaviors [WPF]"
- "behaviors [WPF], timing"
@@ -32,11 +34,11 @@ This topic describes the timing behaviors of animations and other <xref:System.W
## Properties that Control the Length of a Timeline
A <xref:System.Windows.Media.Animation.Timeline> represents a segment of time, and the length of a timeline can be described in different ways. The following table defines several terms for describing the length of a timeline.
|Term|Description|Properties||||
|----------|-----------------|----------------|-|-|-|
|Simple duration|The length of time a timeline takes to make a single forward iteration.|<xref:System.Windows.Media.Animation.Timeline.Duration%2A>||||
|One repetition|The length of time it takes for a timeline to play forward once and, if the <xref:System.Windows.Media.Animation.Timeline.AutoReverse%2A> property is true, play backwards once.|<xref:System.Windows.Media.Animation.Timeline.Duration%2A>, <xref:System.Windows.Media.Animation.Timeline.AutoReverse%2A>||||
|Active period|The length of time it takes for a timeline to complete all the repetitions specified by its <xref:System.Windows.Media.Animation.RepeatBehavior> property.|<xref:System.Windows.Media.Animation.Timeline.Duration%2A>, <xref:System.Windows.Media.Animation.Timeline.AutoReverse%2A>, <xref:System.Windows.Media.Animation.RepeatBehavior>||||
|Term|Description|Properties|
|----------|-----------------|----------------|
|Simple duration|The length of time a timeline takes to make a single forward iteration.|<xref:System.Windows.Media.Animation.Timeline.Duration%2A>|
|One repetition|The length of time it takes for a timeline to play forward once and, if the <xref:System.Windows.Media.Animation.Timeline.AutoReverse%2A> property is true, play backwards once.|<xref:System.Windows.Media.Animation.Timeline.Duration%2A>, <xref:System.Windows.Media.Animation.Timeline.AutoReverse%2A>|
|Active period|The length of time it takes for a timeline to complete all the repetitions specified by its <xref:System.Windows.Media.Animation.RepeatBehavior> property.|<xref:System.Windows.Media.Animation.Timeline.Duration%2A>, <xref:System.Windows.Media.Animation.Timeline.AutoReverse%2A>, <xref:System.Windows.Media.Animation.RepeatBehavior>|
<a name="duration"></a>
### The Duration Property
@@ -1,6 +1,8 @@
---
title: "Transforms Overview"
description: Learn about the transformations.
ms.date: "03/30/2017"
ms.custom: devdivchpfy22
helpviewer_keywords:
- "transformations [WPF], about transformations"
- "classes [WPF], 2D transform"
@@ -27,8 +29,8 @@ This topic describes how to use the 2D <xref:System.Windows.Media.Transform> cla
### A 2D transformation matrix
||||
|-|-|-|
| X-axis| Y-axis| Affine transformation |
|-------|-------|-----------------------|
|<xref:System.Windows.Media.Matrix.M11%2A><br /><br /> Default: 1.0|<xref:System.Windows.Media.Matrix.M12%2A><br /><br /> Default: 0.0|0.0|
|<xref:System.Windows.Media.Matrix.M21%2A><br /><br /> Default: 0.0|<xref:System.Windows.Media.Matrix.M22%2A><br /><br /> Default: 1.0|0.0|
|<xref:System.Windows.Media.Matrix.OffsetX%2A><br /><br /> Default: 0.0|<xref:System.Windows.Media.Matrix.OffsetY%2A><br /><br /> Default: 0.0|1.0|