Pages

Tuesday, 12 March 2013

Content Control in WPF

Content Control in WPF

A ContentControl has a limited default style. If you want to enhance the appearance of the control, you can create a new DataTemplate. Another typical scenario is to use the ContentControl to show more information about an item selected in an ItemsControl control. 

Content Model: ContentControl is the class from which other content controls inherit.

XAML Code 

<ContentControl Margin="0,17,19,51" Name="contentControl1" />
<Button Height="73" Margin="0,17,0,0" Name="button1" VerticalAlignment="Top" 
HorizontalAlignment="Left" Width="71">Button</Button>
<Button Height="73" Margin="0,17,86,0" Name="button2" VerticalAlignment="Top"
HorizontalAlignment="Right" Width="68">Button</Button>
<Button Height="73" HorizontalAlignment="Right" Margin="0,17,19,0" Name="button3" 
VerticalAlignment="Top" Width="67">Button</Button>
<Button HorizontalAlignment="Left" Margin="0,89,0,100" Name="button4" Width="71">Button</Button>
<Button Margin="0,89,86,100" Name="button5" HorizontalAlignment="Right" Width="68">Button</Button>
<Button HorizontalAlignment="Right" Margin="0,89,19,100" Name="button6" Width="67">Button</Button> 
<Button Height="51" Margin="0,0,19,51" Name="button7" VerticalAlignment="Bottom">Button</Button> 
 
Output-


2 comments:

  1. Lot of questions have raised after the release of dot Net core and dot net framework. I have seen some reasonable answer for all those questions. Thanks for your answers and differences between .Net Core and .Net framework.
    DOT NET Training in Chennai
    DOT NET Course in Chennai

    ReplyDelete