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>
  • 相关阅读:
    让IIS支持解析.json格式文件
    请问4-20位字符可由中文,英文,数字及“—”,“-”组成 正则表达式
    jquery中的$(document).ready(function(){})和$(window).load()比较
    根据数组对象的某个属性值找到指定的元素
    JS数组中的indexOf方法
    bat修改注册表
    生动详细解释javascript的冒泡和捕获
    Jquery Easyui与Jquery Bootstrap的比较
    缺少的文件是 ..packagesMicrosoft.Net.Compilers.1.0.0uildMicrosoft.Net.Compilers.props。
    C#中ToString()格式详解
  • 原文地址:https://www.cnblogs.com/androllen/p/5106596.html
Copyright © 2011-2022 走看看