我想在Windows Phone 7中更改复制和粘贴图标,还想在Windows phone中添加自定义菜单,如在Windows phone中复制和粘贴突出显示,以及在etc浏览器控件中添加书签等。
Q1:当文本被选中时,我可以生成类似复制的控件吗?Q2:当文本被选中时,我可以添加圆形图标吗?
我已经尝试了列表和windows phone7工具栏的上下文菜单,但我想对windows phone使用相同的方案。
如果有人有相关信息,请提供帮助。
谢谢
发布于 2012-12-07 19:23:24
使用列表框添加弹出窗口
<Popup Name="textSelectionMenuPopup">
<ListBox Name="textSelectionMenu" Margin="0,0,0,100" ItemContainerStyle="{StaticResource myLBStyle}" SelectionChanged="OnTextSelectionMenuSelectionChanged">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<toolkit:WrapPanel/>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBoxItem Content="Copy">
<ListBoxItem.Background>
<ImageBrush ImageSource="/Images/Copy.png"/>
</ListBoxItem.Background>
</ListBoxItem>
<ListBoxItem Content="Highlights">
<ListBoxItem.Background>
<ImageBrush ImageSource="/Images/Highlights.png"/>
</ListBoxItem.Background>
</ListBoxItem>
<ListBoxItem Content="Tag">
<ListBoxItem.Background>
<ImageBrush ImageSource="/Images/Tag.png"/>
</ListBoxItem.Background>
</ListBoxItem>
<ListBoxItem Content="Note">
<ListBoxItem.Background>
<ImageBrush ImageSource="/Images/Note.png"/>
</ListBoxItem.Background>
</ListBoxItem>
</ListBox>
</Popup>并处理OnTextSelectionMenuSelectionChanged
void OnTextSelectionMenuSelectionChanged(object sender, SelectionChangedEventArgs args)
{
ListBox lstbox = sender as ListBox;
if (lstbox.SelectedItem != null)
{
textSelectionMenuPopup.IsOpen = false;
string command = (lstbox.SelectedItem as ListBoxItem).Content as string;
switch (command)
{
case "Copy":
break;
case "Highlights":
break;
case "Tag":
break;
case "Note":
break;
case "cancel":
break;
}
}https://stackoverflow.com/questions/13584858
复制相似问题