• wp8 入门到精通 仿美拍评论黑白列表思路


           static bool isbool = false;
            private void BindGameDelete()
            {
                Tile tile = new Tile();
              
    
                List<Color> list = new List<Color>();
                list.Add(Colors.Blue);
                list.Add(Colors.Brown);
                if (isbool)
                {
                tile.Background = new SolidColorBrush(list[0]);
                    isbool = false;
                }
                else
                {
                    tile.Background = new SolidColorBrush(list[1]);
                    isbool = true;
                }
    
                tile.Width = 456;
                tile.Height = 60;
    
                ContextMenu cm = new ContextMenu();
                cm.IsZoomEnabled = false;
                RoutedEventHandler clickHandler = new RoutedEventHandler(GameDelete_Click);
    
                // Add "edit" entry
                MenuItem menuItem = new MenuItem()
                {
                    Header = "取消关注",
                    Tag = "Delete"
                };
    
                menuItem.Click += clickHandler;
                cm.Items.Add(menuItem);
    
                ContextMenuService.SetContextMenu(tile, cm);
    
                addTile.Children.Add(tile);
            }
            private void GameDelete_Click(object sender, RoutedEventArgs e)
            {
                var gameToDelte = ((MenuItem)sender).CommandParameter;
            }
            private void Tile_Hold(object sender, System.Windows.Input.GestureEventArgs e)
            {
                BindGameDelete();
    
    
            }
               <StackPanel x:Name="addTile" Grid.Row="1" Orientation="Vertical">
                            <c4f:Tile Background="Red" Content="11111" Width="456" Height="60" Hold="Tile_Hold"/>
                            <!--<c4f:Tile Background="Gray" Content="11111" Width="456" Height="60"/>
                            <c4f:Tile Background="Green" Content="11111" Width="456" Height="60"/>
                            <c4f:Tile Background="Yellow" Content="11111" Width="456" Height="60"/>
                            <c4f:Tile Background="Violet" Content="11111" Width="456" Height="60"/>
                            <c4f:Tile Background="Tomato" Content="11111" Width="456" Height="60"/>
                            <c4f:Tile Background="YellowGreen" Content="11111" Width="456" Height="60"/>
                            <c4f:Tile Background="Thistle" Content="11111" Width="456" Height="60"/>
                            <c4f:Tile Background="Turquoise" Content="11111" Width="456" Height="60"/>
                            <c4f:Tile Background="Tomato" Content="11111" Width="456" Height="60"/>
                            <c4f:Tile Background="Teal" Content="11111" Width="456" Height="60"/>
                            <c4f:Tile Background="Tan" Content="11111" Width="456" Height="60"/>
                            <c4f:Tile Background="SteelBlue" Content="11111" Width="456" Height="60"/>-->
                        </StackPanel>
  • 相关阅读:
    Leetcode: Largest Rectangle in Histogram
    Leetcode: Sum Root to Leaf Numbers
    Leetcode: LRU Cache
    Leetcode: Candy
    Leetcode: Interleaving String
    Leetcode: Implement strStr()
    Leetcode: Gray Code
    Leetcode: Restore IP addresses
    Leetcode: Median of Two Sorted Arrays
    Leetcode: Pow(x, n) and Summary: 负数补码总结
  • 原文地址:https://www.cnblogs.com/androllen/p/5106596.html
Copyright © 2020-2023  润新知