我想創建一個特定ListBoxItem的或longlistselector的項目 喜歡的圖片邊欄菜單一個ListBoxItem的Windows phone的側面菜單
,當你按住藍色面板出來的ListBoxItem的,反正是有這個 ?
我管理該項目上的保留事件,但不是側面菜單!
我想創建一個特定ListBoxItem的或longlistselector的項目 喜歡的圖片邊欄菜單一個ListBoxItem的Windows phone的側面菜單
,當你按住藍色面板出來的ListBoxItem的,反正是有這個 ?
我管理該項目上的保留事件,但不是側面菜單!
有幾種可能的方法可以做到這一點,但基本的想法是,您可以將菜單添加到隱藏或摺疊狀態,然後在Hold事件中觸發動畫。下面是一個簡單的例子(使用交互式DLL System.Windows.Interactivity和Microsoft.Expression.Interactions.Core):
<Grid xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions">
<Grid.Resources>
<Storyboard x:Name="ShowMenu">
<DoubleAnimation Storyboard.TargetName="translate" Storyboard.TargetProperty="X"
To="0" Duration="0:0:0.3" />
</Storyboard>
<Storyboard x:Name="HideMenu">
<DoubleAnimation Storyboard.TargetName="translate" Storyboard.TargetProperty="X"
To="-300" Duration="0:0:0.3" />
</Storyboard>
</Grid.Resources>
<Grid Width="300" Background="LightBlue">
<Grid.RenderTransform>
<TranslateTransform x:Name="translate" X="-300" />
</Grid.RenderTransform>
<!-- Menu popup content here -->
<TextBlock Text="Menu">
<i:Interaction.Triggers>
<i:EventTrigger EventName="Hold">
<ei:ControlStoryboardAction Storyboard="{StaticResource HideMenu}" ControlStoryboardOption="Play" />
</i:EventTrigger>
</i:Interaction.Triggers>
</TextBlock>
</Grid>
<Grid>
<!-- Item content here -->
<TextBlock Text="Item">
<i:Interaction.Triggers>
<i:EventTrigger EventName="Hold">
<ei:ControlStoryboardAction Storyboard="{StaticResource ShowMenu}" ControlStoryboardOption="Play" />
</i:EventTrigger>
</i:Interaction.Triggers>
</TextBlock
</Grid>
</Grid>
您可以將此菜單包含在您的Item Template
中,並將其Visibility
設置爲Collapsed
。然後將代碼添加到將顯示它的Hold
事件中。看看Storyboard
類可能的動畫。
謝謝男人,它似乎工作! – 2014-08-29 12:07:36