国产一级a片免费看高清,亚洲熟女中文字幕在线视频,黄三级高清在线播放,免费黄色视频在线看

打開APP
userphoto
未登錄

開通VIP,暢享免費(fèi)電子書等14項(xiàng)超值服

開通VIP
Windows8可拖拽的GridViewItem

Windows8可拖拽的GridViewItem

(2013-01-22 09:28:07)
標(biāo)簽:

雜談




   public class Item : INotifyPropertyChanged
   {
       publicevent PropertyChangedEventHandler PropertyChanged;

       protectedvirtual void OnPropertyChanged(string propertyName)
       {
          if (this.PropertyChanged !=null)
          {
             this.PropertyChanged(this, newPropertyChangedEventArgs(propertyName));
          }
       }

       privatestring _Title = string.Empty;
       publicstring Title
       {
          get
          {
             return this._Title;
          }

          set
          {
             if (this._Title != value)
             {
                this._Title = value;
                this.OnPropertyChanged("Title");
             }
          }
       }

       privatestring _Subtitle = string.Empty;
       publicstring Subtitle
       {
          get
          {
             return this._Subtitle;
          }

          set
          {
             if (this._Subtitle != value)
             {
                this._Subtitle = value;
                this.OnPropertyChanged("Subtitle");
             }
          }
       }

       privateImageSource _Image = null;
       publicImageSource Image
       {
          get
          {
             return this._Image;
          }

          set
          {
             if (this._Image != value)
             {
                this._Image = value;
                this.OnPropertyChanged("Image");
             }
          }
       }

       publicvoid SetImage(Uri baseUri, String path)
       {
          Image = new BitmapImage(newUri(baseUri, path));
       }

       privatestring _Category = string.Empty;
       publicstring Category
       {
          get
          {
             return this._Category;
          }

          set
          {
             if (this._Category != value)
             {
                this._Category = value;
                this.OnPropertyChanged("Category");
             }
          }
       }

   }





    public classStoreData
    {
       private Item item;
       private Uri _baseUri = newUri("ms-appx:///");

       public StoreData()
       {
          CreateItem("Royma1", "Images/Royma1.jpg");
          CreateItem("Royma2", "Images/Royma2.jpg");
          CreateItem("Royma3", "Images/Royma3.jpg");

          CreateItem("Fuji1", "Images/Fuji1.jpg");
          CreateItem("Fuji2", "Images/Fuji2.jpg");
          CreateItem("Fuji3", "Images/Fuji3.jpg");

          CreateItem("Tesga1", "Images/Tesga1.jpg");
          CreateItem("Tesga2", "Images/Tesga2.jpg");
          CreateItem("Tesga3", "Images/Tesga3.jpg");
          CreateItem("Tesga4", "Images/Tesga4.jpg");
          CreateItem("Tesga5", "Images/Tesga5.jpg");
       }

       public void CreateItem(string title,stringpath)
       {
           item = newItem();
           item.Title= title;
          item.Subtitle = "Tennis" + title;
          item.SetImage(_baseUri, path);
          item.Category = "Category:" +"\r\n"+ title.ToUpper();
          Collection.Add(item);
       }

       publicObservableCollection<Item> Collection= newObservableCollection<Item>();
    }


    public sealed partialclass MainPage : Page
    {
       private StoreData storeData = null;

       public MainPage()
       {
          this.InitializeComponent();

           storeData= new StoreData();
          //直接使用StoreData中的Collection集合作為GridView的ItemsSource
          ItemGridView.ItemsSource = storeData.Collection;

          ////按照字母顯示GridView
          //List<GroupInfoList<object>>dataLetter = storeData.GetGroupsByLetter();
          //dataSource.Source = dataLetter;
          
          //按照目錄顯示GridView
          //List<GroupInfoList<object>>dataCategory = storeData.GetGroupsByCategory();
          //dataSource.Source = dataCategory;

          //SemanticZoom
          //(semanticZoom.ZoomedOutView as ListViewBase).ItemsSource =dataSource.View.CollectionGroups;
       }

       private void ItemGridView_ItemClick(objectsender, ItemClickEventArgs e)
       {


       }

       private void GetGridViewItemInfo_Click(objectsender, RoutedEventArgs e)
       {

       }

    }





              <GridViewx:Name="ItemGridView" 
                      BorderBrush="Blue"BorderThickness="3" 
                      VerticalAlignment="Top"HorizontalAlignment="Left"
                      ScrollViewer.VerticalScrollBarVisibility="Auto"ScrollViewer.HorizontalScrollMode="Enabled"
                     ScrollViewer.HorizontalScrollBarVisibility="Auto"
                      SelectionMode="Multiple"Background="Transparent"
                      IsItemClickEnabled="True"ItemClick="ItemGridView_ItemClick"
                      
                      CanDragItems="True" CanReorderItems="True"AllowDrop="True"          
                      >
          <GridView.ItemsPanel>
             <ItemsPanelTemplate>
                <!--不能為VariableSizedWrapGrid-->
                 <WrapGridOrientation="Horizontal"/>
             </ItemsPanelTemplate>
          </GridView.ItemsPanel>  
          <GridView.ItemTemplate>
             <DataTemplate>
                 <Grid HorizontalAlignment="Left"Background="Black">
                    <StackPanel Orientation="Horizontal"Margin="5,5,0,5">
                        <ImageSource="{Binding Image}" Height="300" Width="300"VerticalAlignment="Center" Margin="0,0,0,0"/>
                        <StackPanelMargin="0,0,0,0" Orientation="Vertical">
                           <TextBlock Name="title"TextWrapping="Wrap" Width="100" Foreground="White" FontSize="15"VerticalAlignment="Center" Text="{BindingTitle}" 
                                    HorizontalAlignment="Left" FontFamily="Segoe UI"/>
                           <TextBlock Name="category"TextWrapping="Wrap" Width="100" Foreground="Beige" FontSize="15"VerticalAlignment="Center" Text="{BindingCategory}" 
                                    HorizontalAlignment="Left" FontFamily="Segoe UI"/>
                       </StackPanel>
                    </StackPanel>
                 </Grid>
             </DataTemplate>
          </GridView.ItemTemplate>   
          <GridView.ItemContainerStyle>
              <StyleTargetType="GridViewItem">
                 <Setter Property="BorderBrush"Value="Blue" />
                 <SetterProperty="BorderThickness" Value="2" />
                 <SetterProperty="HorizontalContentAlignment" Value="Center"/>
                 <SetterProperty="VerticalContentAlignment" Value="Center"/>
                 <Setter Property="Background"Value="Transparent"/>
             </Style>
          </GridView.ItemContainerStyle>      
       </GridView>
本站僅提供存儲(chǔ)服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊舉報(bào)
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
C#如何讀取Excel表格數(shù)據(jù)并顯示到GridView控件
image011.jpg (532×393)
《繽紛浪漫的拼布生活》(內(nèi)附實(shí)物大紙型可供打印)
一些有圖解的漂亮花邊!
葉子 -
鉤出小可愛
更多類似文章 >>
生活服務(wù)
分享 收藏 導(dǎo)長(zhǎng)圖 關(guān)注 下載文章
綁定賬號(hào)成功
后續(xù)可登錄賬號(hào)暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服