* Reset branch for WPF changes * Convert BMP to PNG; fix link-out-of-scope err * Add snippets for WPF... 6794 files!!!! * Add missing snippets * update file updated between migration * Fix paths to include * update breadcrumb and toc * fix index links * fix index links * fix index links * fix markdown
1.6 KiB
title, ms.date, dev_langs, helpviewer_keywords, ms.assetid
| title | ms.date | dev_langs | helpviewer_keywords | ms.assetid | ||||
|---|---|---|---|---|---|---|---|---|
| How to: Change the FlowDirection of Content Programmatically | 03/30/2017 |
|
|
02f5a8ba-f8c0-4e5a-84b9-4c5bf12922a2 |
How to: Change the FlowDirection of Content Programmatically
This example shows how to programmatically change the xref:System.Windows.FrameworkElement.FlowDirection%2A property of a xref:System.Windows.Controls.FlowDocumentReader.
Example
Two xref:System.Windows.Controls.Button elements are created, each representing one of the possible values of xref:System.Windows.FlowDirection. When a button is clicked, the associated property value is applied to the contents of a xref:System.Windows.Controls.FlowDocumentReader named tf1. The property value is also written to a xref:System.Windows.Controls.TextBlock named txt1.
[!code-xamlFlowDirectionSnippets#_FlowDirectionXAML]
Example
The events associated with the button clicks defined above are handled in a C# code-behind file.
[!code-csharpFlowDirectionSnippets#_FlowDirection] [!code-vbFlowDirectionSnippets#_FlowDirection]