ToolBar

image

<Grid xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" >
    <ToolBar HorizontalAlignment="Center" VerticalAlignment="Center">
        <Button>1</Button>
        <Button>2</Button>
    </ToolBar>
</Grid>

ScrollViewer

image

<Grid xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" >
    <ScrollViewer >         
    <StackPanel VerticalAlignment="Top" HorizontalAlignment="Left">
        <TextBlock TextWrapping="Wrap" Margin="0,0,0,20">Scrolling is
        enabled when it is necessary.</TextBlock>
        <Rectangle Fill="Red" Width="400" Height="800"></Rectangle>
    </StackPanel>
</ScrollViewer>
</Grid>

FlowDocumentPageViewer

image

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

    <Paragraph Style="{StaticResource HeaderStyle}">Canvas Overview</Paragraph>
    <Paragraph><Rectangle Fill="Black" Height="1" Width="500" HorizontalAlignment="Left" /><LineBreak/></Paragraph>
    <Paragraph Style="{StaticResource DisStyle}">[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]<LineBreak/></Paragraph>
<Paragraph Style="{StaticResource mainContentStyle}">The Canvas element is used to position content according to absolute x- and y-coordinates. Canvas provides ultimate flexibility for positioning and arranging elements on the screen. Elements can be drawn in a unique location, or in the event that elements occupy the same coordinates, the order in which they appear in markup determines the order in which elements are drawn.</Paragraph>

<Paragraph Style="{StaticResource mainContentStyle}">This topic contains the following sections.</Paragraph>

<List>

<ListItem><Paragraph Style="{StaticResource mainContentStyle}">What Can I Do with the Canvas?</Paragraph></ListItem>
<ListItem><Paragraph Style="{StaticResource mainContentStyle}">Adding a Border to a Canvas Element</Paragraph></ListItem>
<ListItem><Paragraph Style="{StaticResource mainContentStyle}">Order of Elements in a Canvas</Paragraph></ListItem>
<ListItem><Paragraph Style="{StaticResource mainContentStyle}">Creating a Canvas in "XAML"</Paragraph></ListItem>
<ListItem><Paragraph Style="{StaticResource mainContentStyle}">Creating a Canvas in Code</Paragraph></ListItem>

</List>
    <Paragraph Style="{StaticResource SubHeaderStyle}">What Can I Do with the Canvas?</Paragraph>
    <Paragraph Style="{StaticResource mainContentStyle}">Canvas provides the most flexible layout support of any Panel element. Height and Width properties are used to define the area of the canvas, and elements inside are assigned absolute coordinates relative to the upper left corner of the parent Canvas. This allows you to position and arrange elements precisely where you want them on the screen.</Paragraph>

<Paragraph Style="{StaticResource SubHeaderStyle}">Adding a Border to a Canvas Element</Paragraph>
<Paragraph Style="{StaticResource mainContentStyle}">In order for a Canvas element to have a border, it must be encapsulated within a Border element.</Paragraph>
</FlowDocument>
</FlowDocumentPageViewer>
</Grid>

TabControl

image

<Grid xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" >
    <TabControl HorizontalAlignment="Center" VerticalAlignment="Center">
    <TabItem Header="Background" IsSelected="true"><Button Name="btn" Background="LightGray">Background</Button>
    </TabItem>
    <TabItem Header="Foreground"><Button Name="btn1" Foreground="Black">Foreground</Button>
    </TabItem>
    <TabItem Header="FontFamily"><Button Name="btn2" FontFamily="Arial">FontFamily</Button></TabItem>
    <TabItem Header="FontSize"><Button Name="btn3" FontSize="10">FontSize</Button></TabItem>
    <TabItem Header="FontStyle"><Button Name="btn4" FontStyle="Normal">FontStyle</Button></TabItem>
    <TabItem Header="FontWeight"><Button Name="btn5" FontWeight="Normal">FontWeight</Button></TabItem>
    <TabItem Header="BorderBrush"><Button Name="btn6" BorderBrush="Red">BorderBrush</Button></TabItem>
</TabControl>
</Grid>

InkCanvas

image

<Grid xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" >
    <InkCanvas EditingMode="Ink" MaxWidth="300" MaxHeight="300">
                <TextBlock>Use your Mouse or Stylus to draw on the screen.</TextBlock>
            </InkCanvas>
</Grid>

Menu

image

<Grid xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" >
<Menu Background="Gray" HorizontalAlignment="Center" VerticalAlignment="Center">
   <MenuItem Header="File">
          <MenuItem Header="New"/>
          <MenuItem Header="Open"/>
	        <Separator/>
          <MenuItem Header="submenu">
                <MenuItem Header="submenuitem1"/>
                <MenuItem Header="submenuitem2">          
                      <MenuItem Header="submenuitem2.1"/>
                </MenuItem>
         </MenuItem>
   </MenuItem>
   <MenuItem Header="View">
       <MenuItem Header="Source"/>
    </MenuItem>   
</Menu>
</Grid>

 

Border

image

<Grid xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" >
    <Border Background="LightGray" CornerRadius="10" Padding="10"  HorizontalAlignment="Center" 
		VerticalAlignment="center" BorderBrush="Black" BorderThickness="4">
        <TextBlock>Content inside of a Border</TextBlock>
    </Border>
</Grid>

 

StackPanel

image

<Grid xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" >
    <StackPanel>
        <Border Background="SkyBlue" BorderBrush="Black" BorderThickness="1">
            <TextBlock Foreground="black" FontSize="12">Stacked Item #1</TextBlock>
        </Border>
        <Border Width="400" Background="CadetBlue" BorderBrush="Black" BorderThickness="1">
            <TextBlock Foreground="black" FontSize="14">Stacked Item #2</TextBlock>
        </Border>
        <Border Background="#ffff99" BorderBrush="Black" BorderThickness="1">
            <TextBlock Foreground="black" FontSize="16">Stacked Item #3</TextBlock>
        </Border>
        <Border Width="200" Background="PaleGreen" BorderBrush="Black" BorderThickness="1">
            <TextBlock Foreground="black" FontSize="18">Stacked Item #4</TextBlock>
        </Border>
        <Border Background="White" BorderBrush="Black" BorderThickness="1">
            <TextBlock Foreground="black" FontSize="20">Stacked Item #5</TextBlock>
        </Border>
    </StackPanel>
</Grid>

 

image

<Grid xmlns="http://schemas.microsoft.com/winfx/2006/xaml
/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" >
    <Canvas Margin="10">
        <Canvas Height="100" Width="100"  Top="0" Left="0">
            <Rectangle Width="100" Height="100" Fill="red"/>
        </Canvas>
        <Canvas Height="100" Width="100" Top="100" Left="100">
            <Rectangle Width="100" Height="100" Fill="green"/>
         </Canvas>
         <Canvas Height="100" Width="100" Top="50" Left="50">
            <Rectangle Width="100" Height="100" Fill="blue"/>
         </Canvas>
     </Canvas>
</Grid>

image

<Grid xmlns="http://schemas.microsoft.com/winfx
/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" >
    <Viewbox MaxWidth="500" MaxHeight="500" StretchDirection="Both" Stretch="Fill">
            <Grid >
            <Ellipse Fill="#99ccff" Stroke="RoyalBlue" StrokeDashArray="3"  />
            <TextBlock Text="Viewbox" />
            </Grid>
    </Viewbox>
</Grid>

image

<Grid xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" >
    <DockPanel>
        <Border Height="25" Background="SkyBlue" BorderBrush="Black" BorderThickness="1" DockPanel.Dock="Top">
            <TextBlock Foreground="black">Dock = "Top"</TextBlock>
        </Border>
        <Border Height="25" Background="SkyBlue" BorderBrush="Black" BorderThickness="1" DockPanel.Dock="Top">
            <TextBlock Foreground="black">Dock = "Top"</TextBlock>
        </Border>
        <Border Height="25" Background="#ffff99" BorderBrush="Black" BorderThickness="1" DockPanel.Dock="Bottom">
            <TextBlock Foreground="black">Dock = "Bottom"</TextBlock>
        </Border>
        <Border Width="200" Background="PaleGreen" BorderBrush="Black" BorderThickness="1" DockPanel.Dock="Left">
            <TextBlock Foreground="black">Dock = "Left"</TextBlock>
        </Border>
        <Border Background="White" BorderBrush="Black" BorderThickness="1">
            <TextBlock Foreground="black">This content fills the remaining, unallocated space.</TextBlock>
        </Border>
    </DockPanel>
</Grid>

Expander

image

<Expander Header="More Options">
    <StackPanel Margin="10,4,0,0">
        <CheckBox Margin="4" Content="Option 1" />
        <CheckBox Margin="4" Content="Option 2" />
        <CheckBox Margin="4" Content="Option 3" />
    </StackPanel>
</Expander>

스택판넬에 안넣으니깐 기본적으로 벌어져보이네 ㅋ

+ Recent posts