• 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>
  • 相关阅读:
    面向对象 :类的创建以及应用
    面向对象(1)
    HTML 表单和验证事件2
    HTML 表单和验证事件
    html的导航制作
    静态网页的window.document对象
    JavaScript的DOM操作
    Java Script基础
    静态网页的格式布局
    构造函数
  • 原文地址:https://www.cnblogs.com/luquanmingren/p/5106596.html
Copyright © 2020-2023  润新知