:: 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

Content Model ItemControl Interview Questions & FAQs

Questions and answers for Content Model ItemControl.

16. Content Model ItemControl

    16.1 What is WPF?
    16.2 What is XAML?

16.1 How can I create Four Button controls with the contents set to a String, a DateTimeObject, an UIElement and A Panel that contains other UIElement objects?

The example Extensible Application Markup Language (XAML) version could use the tags around the content of each button, but it is not necessary. The Four buttons can be created as follows.

[XAML]

<!--Create a Button with a string as its content.-->

<Button>This is string content of a Button</Button>

<!--Create a Button with a DateTime object as its content.-->

<Button xmlns:sys="clr-namespace:System;assembly=mscorlib">

<sys:DateTime>2004/3/4 13:6:55</sys:DateTime>

</Button>

<!--Create a Button with a single UIElement as its content.-->

<Button>

<Rectangle Height="40" Width="40" Fill="Blue"/>

</Button>

<!--Create a Button with a panel that contains multiple objects

as its content.-->

<Button>

<StackPanel>

<Ellipse Height="40" Width="40" Fill="Blue"/>

<TextBlock TextAlignment="Center">Button</TextBlock>

</StackPanel>

</Button>


16.2 Can I create a ContentTemplate and apply the template to a ContentControl ?

The following code shows how the content template can be created and applied to a content control.

[XAML]

<DataTemplate x:Key="template1">

<TextBlock Text="{Binding}" FontSize="12" FontWeight="Bold" TextWrapping="Wrap"></TextBlock>

</DataTemplate>


The above code can be applied as follows.

[XAML]

<Button DataTemplate="{StaticResource template1}" Content="Click">

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