2011-02-08 1 views
0

MacまたはObjectBarでDockBarを模倣しようとしています。このプロセスでは、WPFカスタムコントロールを学び、私とコミュニティのために使用可能なコントロールを作成したいと考えています。これまでのところ、私はこのWPFのMacスタイルのDockBar機能

<Window x:Class="WPFMacStyleTBar.Window1" 
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
Title="Window1" Height="356" Width="577"> 
<Grid> 
    <Grid.RowDefinitions> 
     <RowDefinition/> 
     <RowDefinition/> 
     <RowDefinition/> 
     <RowDefinition/> 
     <RowDefinition/> 
    </Grid.RowDefinitions> 
    <Grid Grid.Row="3"> 
     <Grid.ColumnDefinitions> 
      <ColumnDefinition/> 
      <ColumnDefinition/> 
      <ColumnDefinition/> 
      <ColumnDefinition/> 
      <ColumnDefinition/> 
     </Grid.ColumnDefinitions> 
     <Button Grid.Column="1" x:Name="btnHome" Background="Transparent" BorderBrush="Transparent" Margin="0,0,47,0" Foreground="Transparent"> 
      <Button.Content> 
       <Image Source="C:\Vikram\Projects\WPFMacStyleTBar\WPFMacStyleTBar\Images\Home.png"></Image> 
      </Button.Content> 
     </Button> 
     <Button Grid.Column="2" x:Name="btnGlobe" Background="Transparent" BorderBrush="Transparent" Margin="0,0,47,0" Foreground="Transparent"> 
      <Button.Content> 
       <Image Source="C:\Vikram\Projects\WPFMacStyleTBar\WPFMacStyleTBar\Images\Globe.png"></Image> 
      </Button.Content> 
     </Button> 
     <Button Grid.Column="3" x:Name="btnNotes" Background="Transparent" BorderBrush="Transparent" Margin="0,0,49,0" Foreground="Transparent"> 
      <Button.Content> 
       <Image Source="C:\Vikram\Projects\WPFMacStyleTBar\WPFMacStyleTBar\Images\Notes.png"></Image> 
      </Button.Content> 
     </Button> 
    </Grid>   
</Grid> 

を持っているそれは少し初歩的だが、私は初心者のために、これは問題ないはずと感じました。私が直面している問題は、背景と境界線を透明に設定した後でさえ、ボタンの境界線がまだ現れることです。その上に私は画像の部分に切り取るためにボタン領域にしたい。私はこれがどのようにできるかについての助けに感謝します。私はhere

答えて

0

探していたものを見つけ

EDIT

は私がhttp://msdn.microsoft.com/en-us/library/system.windows.controls(ラップパネルを考えます。 wrappanel.aspx)は、ユーザーが設定できるボタンを制限するだけの賢明な選択肢になります。

また、ボタンのスタイルを作成し、ボタンのサイズをイメージのサイズにバインドすることもできます(コードビハインドをチェックして、最大イメージサイズを設定します)。

非透明ボタンのボーダーに関しては、私は本当になぜそれが起こるのかという手がかりを持っていません。可能であればスクリーンショットを投稿してください;

+0

可能であれば、ラップパネルを確認してスクリーンショットを投稿します。与えられたXAMLをコピーするだけで、私が何を意味しているのかがわかるはずです。 – vikramjb

+0

このために独自のスタイルやControlTemplateを作成する必要があります。http://msdn.microsoft.com/en-us/library/ms745683.aspx起動します;) – Machinarius

+0

コントロールテンプレートは間違いなく正しい方向に向かいます。リンクありがとう、ありがとう:) – vikramjb