2

リンクのHereは素敵なドッキングアプリケーションですが、Mac OSXドックのようなものが必要です。画面を使わずに横にドッキングし、必要なときにそこにあります。

画面スペースを占有しないドッキング ソリューションを教えてください。

4

1 に答える 1

0

これは、あなたが達成しようとしていると私が想像するものに基づいた、暗闇の中でのショットです。Windows ベースの完全信頼ローカル アプリを実行していると仮定します。コンテキストを設定するだけで、信頼はおそらく重要ではありません。

私が想像している解決策には、次の 3 つの部分があります。

Window1.xaml (your main app window)
 <Window blah blah>
  <Grid>
  <!--Your application content-->
    <local:PseudoDock VerticalAlignment='Bottom' />
  </Grid>
</Window>

PseudoDock.xaml
<UserControl Height='5'>
 <UserControl.Triggers>
  <Trigger Property='FrameworkElement.IsMouseOver'>
   <Setter Property='Height' Value='NaN' />
  </Trigger>
 </UserControl.Triggers>
 <ItemsControl>
  <ItemsControl.ItemsPanelTemplate>
   <StackPanel Orientation='Horizontal' />
  </ItemsControl.ItemsPanelTemplate>
  <ItemsControl.ItemTemplate>
   <DataTemplate>
    <Button Command='{Binding Path=Command}'>
     <StackPanel>
      <Image Source='{Binding Path=Icon}' />
      <TextBlock Source='{Binding Path=Label}' />
     </StackPanel>
    </Button>
   </DataTemplate>
  </ItemsControl.ItemTemplate>
 </ItemsControl>
</UserControl>

ドックの重要な点は、高さが 5 ピクセルで、下部では目立たないことと、マウスオーバーで完全な高さになることです。(明示的な高さを設定することもできます。高さを NaN に設定すると、その子に対して測定されると思いますが、間違っている可能性があります)。

最後に、ドックを構成するアイテムの構造:

DockItem.cs
class DockItem{
 ICommand Command{get;set;}
 String Label{get;set;}
 ImageSource Icon{get;set;}
}

(コメント交換後)デスクトップ上に透過的に配置したい場合は、次のように設定する必要があります。

<Window WindowStyle='None' Background='Transparent' State='Maximized'>
于 2010-10-30T09:04:46.397 に答える