How to implement dock panel in wpf application?

Leave a Comment
HI I am giving you complete source code demo for dock panel. Code snippets for design  of dock panel is here. just keep this code in design panel and you will get complete knowledge of this panel.

MainWindow
<Window x:Class="Dockpanel.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="350" Width="525">
    <DockPanel>
        <Rectangle Fill="red" DockPanel.Dock="Left" Width="50"/>
        <Rectangle Fill="Green" DockPanel.Dock="Right" Width="50"/>
        <Rectangle Fill="Yellow" DockPanel.Dock="Top" Height="50"/>
        <Rectangle Fill="Pink" DockPanel.Dock="Bottom" Height="50"/>
        <Rectangle Fill="Black"/>
    </DockPanel>
</Window>
After keeping this code in design part you will get complete output like this.

 Download Complete Source Code

0 comments:

Post a Comment