首页 > 代码库 > AvalonDock

AvalonDock

参考:http://www.cnblogs.com/01codeworld/category/355205.html

 

官方网站:http://avalondock.codeplex.com/

 

引用 AvalonDock 2.0,以及需要的样式。然后在需要使用 AvalonDock 的窗口顶部放上这行代码:

xmlns:avalonDock="http://schemas.xceed.com/wpf/xaml/avalondock"

然后在窗口主体区域使用类似如下代码:

<avalonDock:DockingManager x:Name="DManager">	<avalonDock:DockingManager.Theme>		<avalonDock:MetroTheme/>	</avalonDock:DockingManager.Theme>	<avalonDock:LayoutRoot>		<avalonDock:LayoutRoot.RightSide>			<avalonDock:LayoutAnchorSide >				<avalonDock:LayoutAnchorGroup>					<avalonDock:LayoutAnchorable Title="背景色" AutoHideWidth="50" ContentId="left1">						<WrapPanel>							<Rectangle Margin="5" Width="50" Height="30" Fill="Beige"/>							<Rectangle Margin="5" Width="50" Height="30" Fill="BlueViolet"/>							<Rectangle Margin="5" Width="50" Height="30" Fill="MediumAquamarine"/>							<Rectangle Margin="5" Width="50" Height="30" Fill="CadetBlue"/>							<Rectangle Margin="5" Width="50" Height="30" Fill="DarkGoldenrod"/>							<Rectangle Margin="5" Width="50" Height="30" Fill="Firebrick"/>							<Rectangle Margin="5" Width="50" Height="30" Fill="Gold"/>						</WrapPanel>					</avalonDock:LayoutAnchorable>					<avalonDock:LayoutAnchorable Title="模板" AutoHideWidth="20" ContentId="left2">						<TextBlock Text="Left2"/>					</avalonDock:LayoutAnchorable>				</avalonDock:LayoutAnchorGroup>			</avalonDock:LayoutAnchorSide>		</avalonDock:LayoutRoot.RightSide>		<avalonDock:LayoutPanel>			<avalonDock:LayoutAnchorablePaneGroup DockWidth="100">				<avalonDock:LayoutAnchorablePane>					<avalonDock:LayoutAnchorable Title="页面" ContentId="text1">						<Grid>							<StackPanel>								<Rectangle Margin="0 5" Width="80" Height="50" Fill="#95c459">									<Rectangle.Effect>										<DropShadowEffect Color="#999"/>									</Rectangle.Effect>								</Rectangle>								<Rectangle Margin="0 5" Width="80" Height="50" Fill="#95c459">									<Rectangle.Effect>										<DropShadowEffect Color="#999"/>									</Rectangle.Effect>								</Rectangle>								<Rectangle Margin="0 5" Width="80" Height="50" Fill="#95c459">									<Rectangle.Effect>										<DropShadowEffect Color="#999"/>									</Rectangle.Effect>								</Rectangle>								<Rectangle Margin="0 5" Width="80" Height="50" Fill="#95c459">									<Rectangle.Effect>										<DropShadowEffect Color="#999"/>									</Rectangle.Effect>								</Rectangle>							</StackPanel>						</Grid>					</avalonDock:LayoutAnchorable>				</avalonDock:LayoutAnchorablePane>			</avalonDock:LayoutAnchorablePaneGroup>			<avalonDock:LayoutDocumentPane>				<avalonDock:LayoutDocument Title="新建1" ContentId="doc1">					<Grid Background="LightGray">						<Rectangle Margin="20" Fill="#95c459">							<Rectangle.Effect>								<DropShadowEffect Color="#999"/>							</Rectangle.Effect>						</Rectangle>					</Grid>				</avalonDock:LayoutDocument>				<avalonDock:LayoutAnchorable Title="班级风采" ContentId="doc1">					<TextBox AcceptsReturn="True" TextWrapping="Wrap"></TextBox>				</avalonDock:LayoutAnchorable>			</avalonDock:LayoutDocumentPane>		</avalonDock:LayoutPanel>	</avalonDock:LayoutRoot></avalonDock:DockingManager>

  

AvalonDock