2012-11-27 36 views
1

我想改變複製和Windows Phone 7的粘貼圖標,也希望增加自定義菜單像複製並粘貼到Windows phone的例如高亮,書籤等在Web瀏覽器控制。變化複製和在WP7粘貼圖標和添加自定義菜單像複製,並在Windows手機貼

Q1:我可以生成複製像控制時,文本選擇。 Q2:我可以添加圈子圖標時,文本選擇。

我已經嘗試了列表和Windows Phone 7工具欄上的文本菜單,但我想使用的Windows Phone相同的方案。

如果某人有關的信息,請幫助。

感謝名單

回答

0

添加具有列表框

<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; 
      } 
     }