zoukankan      html  css  js  c++  java
  • 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>
  • 相关阅读:
    利用js在Table中追加数据
    C#API配置跨域
    C#linq查询DataTable
    erlang格式化输出
    erlang 的源代码保护机制
    MP3格式音频文件结构解析
    使用异步 I/O 大大提高应用程序的性能
    虚拟机安装mac 关键是换引导
    C/C++规则整理
    字节对齐
  • 原文地址:https://www.cnblogs.com/androllen/p/5106596.html
Copyright © 2011-2022 走看看