:: Home

  login:         
  passwords:  

WPF FAQs

WPF General Questions
Concepts Element Tree
Concepts Dependency Property
Concepts Attached Property
Concepts Routed Events
Concepts Resources.
Concepts Animation
Concepts Freezable Object
Concepts Input and Commands.
Concepts Layouts
XAML Inline Styles and Templates
XAML XML Namespaces
XAML Code Behind
XAML Custom Class
XAML Type Converters
Content Model ItemControl
Content Model HeaderedItemsControl
Content Model HeaderedContentControl
Content Model Content Control
Content Model Decorator Content Model
Content Model Panel Content Model
Documents Serialization and Storage
Documents Annotations
Documents Flow Content
Documents Printing
Graphics and Multimedia Rendering Graphics
Graphics and Multimedia Animation and Timing
Graphics and Multimedia 2D Graphics
Graphics and Multimedia 3D Graphics
Graphics and Multimedia Visual Layer
Control Customization Adorners
Control Customization Stylable controls
Control Customization ControlTemplates
Data Data Binding
Data DragandDrop
Data Serialization
Globalization and Localization Attributes
Globalization and Localization Comments
Globalization and Localization Globalization Struc
Application and Deployment ClickOnce
Application and Deployment Frame
Application and Deployment Page
Application and Deployment Navigation
Application and Deployment Setup
Application and Deployment Window
Interoperability Message Loops Between
Interoperability Win32 in WPF
Interoperability WPF in Win32
Interoperability Windows Forms and WPF
Security Trusted Security
Security Partial Trust Security
Tools Microsoft Expression Blend
Tools ZAM3D
Tools XAMLPAD
Controls ToolTip
Controls TextBlock
Controls TabControl
Controls ProgressBar
Controls PrintDialog
Controls Popup
Controls TextBox
Controls Canvas
Controls ComboBox
Controls ListBox
Controls StatusBar
Controls ToolBar
Controls Context Menu
Controls Expander
Controls DocumentViewer
Controls FlowDocumentReader
Controls GroupBox
Controls GridSplitter
Controls Image
Controls Menu
Controls ScrollBar
Controls Slider
Controls RichTextBox
Controls Border
Controls Buttons

SilverLight Interview Qs

SAP Interview Questions

Oracle Interview Questions

PHP Interview Questions

Ajax Interview Questions

IIS 7.0

OOP Interview Questions

Ruby Interview Questions

Sql Server Interview Questions

Winforms Interview Questions

SharePoint 2007 Questions

Microsoft Crm Questions

Documents Flow Content Interview Questions & FAQs

Questions and answers for Documents Flow Content.

24. Documents Flow Content

    24.1 How can I define three paragraphs under one section ?
    24.2 How can I use the BlockUIContainer element to host UIElement objects within Flow content ?
    24.3 Can I embed a figure into a paragraph of text ?

24.1 How can I define three paragraphs under one section ?

We can define three paragraphs under one section as follows.

In the following example, the section has a “Background” property value of Red, therefore the background color of the paragraphs is also red.

[XAML]

<FlowDocument xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

<!-- By default, Section applies no formatting to elements contained

within it. However, in this example, the section has a Background

property value of "Red", therefore, the three paragraphs (the block)

inside the section also have a red background. -->

<Section Background="Red">

<Paragraph>

Paragraph 1

</Paragraph>

<Paragraph>

Paragraph 2

</Paragraph>

<Paragraph>

Paragraph 3

</Paragraph>

</Section>

</FlowDocument>


24.2 How can I use the BlockUIContainer element to host UIElement objects within Flow content ?

A BlockUIContainer is a flow content element that allows UIElement to be hosted inside the flow content. This can be done as follows.

[XAML]

<FlowDocument ColumnWidth="400">

<Section Background="GhostWhite">

<Paragraph>

A UIElement element may be embedded directly in flow content

by enclosing it in a BlockUIContainer element.

</Paragraph>

<BlockUIContainer>

<Button>Click me!</Button>

</BlockUIContainer>

<Paragraph>

The BlockUIContainer element may host no more than one top-level

UIElement. However, other UIElements may be nested within the

UIElement contained by an BlockUIContainer element. For example,

a StackPanel can be used to host multiple UIElement elements within

a BlockUIContainer element.

</Paragraph>

<BlockUIContainer>

<StackPanel>

<Label Foreground="Blue">Choose a value:</Label>

<ComboBox>

<ComboBoxItem IsSelected="True">a</ComboBoxItem>

<ComboBoxItem>b</ComboBoxItem>

<ComboBoxItem>c</ComboBoxItem>

</ComboBox>

<Label Foreground ="Red">Choose a value:</Label>

<StackPanel>

<RadioButton>x</RadioButton>

<RadioButton>y</RadioButton>

<RadioButton>z</RadioButton>

</StackPanel>

<Label>Enter a value:</Label>

<TextBox>

A text editor embedded in flow content.

</TextBox>

</StackPanel>

</BlockUIContainer>

</Section>

</FlowDocument>

We can define three paragraphs under one section as follows.

In the following example, the section has a “Background” property value of Red, therefore the background color of the paragraphs is also red.


24.3 Can I embed a figure into a paragraph of text ?

Figure and Floater are used to embed content in Flow Documents with placement properties that can be customized independent of the primary content flow. Figure or Floater elements are often used to highlight or accentuate portions of content to host supporting images or other content within the main content flow or to inject loosely related content such as advertisements.

The following example shows how to embed a Figure into a paragraph of text.

XAML]

<FlowDocument xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

<Paragraph>

<Figure

Width="300" Height="100"

Background="GhostWhite" HorizontalAnchor="PageLeft" >

<Paragraph FontStyle="Italic" Background="Beige" Foreground="DarkGreen" >

A Figure embeds content into flow content with placement properties

that can be customized independently from the primary content flow

</Paragraph>

</Figure>

</Paragraph>

</FlowDocument>

bottom user control
::  Home :: Services ::  Prices ::  Request Quote
Copyright 2007, Megasolutions Ltd