ツールバーの絵
サンプルコードのツールバーはビットマップを埋め込んでいると思い込んでいたのですが、きっちりXAMLで描画していました。
<Window x:Class="MyFirstAvalonApp.Window1" xmlns="http://schemas.microsoft.com/winfx/avalon/2005" xmlns:x="http://schemas.microsoft.com/winfx/xaml/2005" Title="ToolBar" Width="200" Height="60"> <Window.Resources> <Path x:Key="back" Fill="Cyan" Stroke="Black" StrokeThickness="1" Data="M 0,7 L 5,2 5,5 13,5 13,9 5,9 5,12 z" /> <Path x:Key="forward" Fill="Cyan" Stroke="Black" StrokeThickness="1" Data="M 13,7 L 7,2 7,5 0,5 0,9 7,9 7,12 z" /> <Canvas x:Key="home" Width="15" Height="15"> <Rectangle Fill="Black" Canvas.Left="11" Canvas.Top="0" Width="2" Height="6" /> <Path Fill="White" Stroke="Black" StrokeThickness="01" Data="M 1,15 L 13,15 13,7 7,2 1,7 z" /> <Path Fill="Yellow" Stroke="Black" StrokeThickness="1" Data="M 0,7 L 7,0 14,7 13,9 7,3 1,9 z" /> <Rectangle Fill="Yellow" Stroke="Black" Width="4" Height="6" Canvas.Left="5" Canvas.Top="9.5" /> </Canvas> <Path x:Key="sync" Fill="Cyan" Stroke="Black" StrokeThickness="1" Data="M 0,7 L 5,2 5,5 8,5 8,2 13,7 8,12 8,9 5,9 5,12 z" /> <Path x:Key="prev" Fill="Cyan" Stroke="Black" StrokeThickness="1" Data="M 7,0 L 2,5 5,5 5,13 9,13 9,5 12,5 z" /> <Path x:Key="next" Fill="Cyan" Stroke="Black" StrokeThickness="1" Data="M 7,13 L 2,7 5,7 5,0 9,0 9,7 12,7 z" /> </Window.Resources> <ToolBar> <Button Content="{StaticResource back}" /> <Button Content="{StaticResource forward}" /> <Button Content="{StaticResource home}" /> <ComboBox Width="100" /> <Button Content="{StaticResource sync}" /> <Button Content="{StaticResource prev}" /> <Button Content="{StaticResource next}" /> </ToolBar> </Window>
うあー、ちまちま描いているよ・・・