示例#1
0
 private void PhotoItemControl_Tapped(object sender, TappedRoutedEventArgs e)
 {
     selected         = true;
     photoitemcontrol = (PhotoItemControl)sender;
     x         = sender;
     photoitem = photoitemcontrol.PhotoItem;
     deletePicButton.Visibility = Visibility.Visible;
     changeView();
 }
示例#2
0
        private String splitViewPaneLength;  //Hassan added NEW

        public MainPage()
        {
            this.InitializeComponent();
            selected                   = false;
            splitViewPaneLength        = "200"; //Hassan added NEW
            photoitem                  = new PhotoItem();
            photoitemcontrol           = new PhotoItemControl();
            PhotoItems                 = new ObservableCollection <PhotoItem>();
            MenuItems                  = new ObservableCollection <MenuItem>();
            tempItems                  = new ObservableCollection <PhotoItem>();
            MenuItemsWithoutFavourites = new ObservableCollection <ListItem>();  //Hassan added
            menuItemTemp               = new MenuItem();
            MenuItemFactory.init();
            MenuItems = MenuItemFactory.getMenuItems();
            PhotoItemFactory.init();
            PhotoItemFactory.getAllPhotoItems(PhotoItems);
            PhotoItemFactory.getAllLists(MenuItemsWithoutFavourites); //Hassan updated NEW
            BackButton.Visibility     = Visibility.Collapsed;
            EditStackPanel.Visibility = Visibility.Collapsed;
            EditPicButton.Visibility  = Visibility.Collapsed;
            Category                        = "unCategorized";
            GridImage.Visibility            = Visibility.Collapsed;
            WaterMarkTextBlock.Visibility   = Visibility.Collapsed;
            DeleteCategoryButton.Visibility = Visibility.Collapsed;  //Hassan added NEW NEW



            // testing code
            Uri         uri = new Uri("ms-appx:///Assets/Friends 01.JPG");
            BitmapImage i   = new BitmapImage(uri);

            PhotoItem photoItem = new PhotoItem()
            {
                Id = 1, Title = title + "1", Description = "Test Photo", Category = "Friends", ImagePath = i
            };

            uri = new Uri("ms-appx:///Assets/Friends 02.JPG");
            i   = new BitmapImage(uri);

            PhotoItem photoItem1 = new PhotoItem()
            {
                Id = 2, Title = title + "2", Description = "Test Photo", Category = "Friends", ImagePath = i
            };

            uri = new Uri("ms-appx:///Assets/Friends 03.JPG");
            i   = new BitmapImage(uri);

            PhotoItem photoItem2 = new PhotoItem()
            {
                Id = 3, Title = title + "3", Description = "Test Photo", Category = "Friends", ImagePath = i
            };

            uri = new Uri("ms-appx:///Assets/Friends 04.JPG");
            i   = new BitmapImage(uri);

            PhotoItem photoItem3 = new PhotoItem()
            {
                Id = 4, Title = title + "4", Description = "Test Photo", Category = "Friends", ImagePath = i
            };

            uri = new Uri("ms-appx:///Assets/Friends 05.JPG");
            i   = new BitmapImage(uri);

            PhotoItem photoItem4 = new PhotoItem()
            {
                Id = 5, Title = title + "5", Description = "Test Photo", Category = "Friends", ImagePath = i
            };

            uri = new Uri("ms-appx:///Assets/Friends 06.JPG");
            i   = new BitmapImage(uri);

            PhotoItem photoItem5 = new PhotoItem()
            {
                Id = 6, Title = title + "6", Description = "Test Photo", Category = "Friends", ImagePath = i
            };

            uri = new Uri("ms-appx:///Assets/Friends 07.JPG");
            i   = new BitmapImage(uri);

            PhotoItem photoItem6 = new PhotoItem()
            {
                Id = 7, Title = title + "7", Description = "Test Photo", Category = "Friends", ImagePath = i
            };

            uri = new Uri("ms-appx:///Assets/Hassan 01.jpg");
            i   = new BitmapImage(uri);

            PhotoItem photoItem7 = new PhotoItem()
            {
                Id = 8, Title = title1 + "1", Description = "Test Photo", Category = "Me", ImagePath = i
            };

            uri = new Uri("ms-appx:///Assets/Hassan 02.jpg");
            i   = new BitmapImage(uri);

            PhotoItem photoItem8 = new PhotoItem()
            {
                Id = 9, Title = title1 + "2", Description = "Test Photo", Category = "Me", ImagePath = i
            };

            uri = new Uri("ms-appx:///Assets/Hassan 03.jpg");
            i   = new BitmapImage(uri);

            PhotoItem photoItem9 = new PhotoItem()
            {
                Id = 10, Title = title1 + "3", Description = "Test Photo", Category = "Me", ImagePath = i
            };

            uri = new Uri("ms-appx:///Assets/Hassan 04.JPG");
            i   = new BitmapImage(uri);

            PhotoItem photoItem10 = new PhotoItem()
            {
                Id = 11, Title = title1 + "4", Description = "Test Photo", Category = "Me", ImagePath = i
            };

            uri = new Uri("ms-appx:///Assets/Hassan 05.jpg");
            i   = new BitmapImage(uri);

            PhotoItem photoItem11 = new PhotoItem()
            {
                Id = 12, Title = title1 + "5", Description = "Test Photo", Category = "Me", ImagePath = i
            };

            PhotoItemFactory.updatePhotoItems(PhotoItems, photoItem);
            PhotoItemFactory.updatePhotoItems(PhotoItems, photoItem1);
            PhotoItemFactory.updatePhotoItems(PhotoItems, photoItem2);
            PhotoItemFactory.updatePhotoItems(PhotoItems, photoItem3);
            PhotoItemFactory.updatePhotoItems(PhotoItems, photoItem4);
            PhotoItemFactory.updatePhotoItems(PhotoItems, photoItem5);
            PhotoItemFactory.updatePhotoItems(PhotoItems, photoItem6);
            PhotoItemFactory.updatePhotoItems(PhotoItems, photoItem7);
            PhotoItemFactory.updatePhotoItems(PhotoItems, photoItem8);
            PhotoItemFactory.updatePhotoItems(PhotoItems, photoItem9);
            PhotoItemFactory.updatePhotoItems(PhotoItems, photoItem10);
            PhotoItemFactory.updatePhotoItems(PhotoItems, photoItem11);

            // End
        }