September 03, 2006

WPF - Content Model

Content Model

  • templates for many controls, such as labels and captions
  • contain placeholders for additional content, which allows for the composition of elements

  • flexible content model that enables use of any content in these placeholders, including other controls, drawings, or animations and obviously text, or a bitmap

Example

<Page x:Class="TestXBAP.Page1"

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

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

Title="Page1" >

<Grid>

<Button Name="dkdk" Width="126" HorizontalAlignment="Right">

<Image Source="http://photos1.blogger.com/x/blogger2/7687/3061/259/z/637943/gse_multipart33566.jpg "/>

</Button>

<Button Name="fw" HorizontalAlignment="Left" VerticalAlignment="Top" Width="166">

<TextBlock>This is Button</TextBlock>

</Button>

</Grid >

</Page>