Inheritance: ListViewBase, IGridView
        public static async Task Search(object sender, RoutedEventArgs e, GridView SearchResults, TextBox SearchTermText, TextBlock StatusResult, IPlatformParameters parent)
        {
            if (string.IsNullOrEmpty(SearchTermText.Text))
            {
                MessageDialog dialog = new MessageDialog("Please enter a valid search term.");
                await dialog.ShowAsync();
                return;
            }

            List<User> results = await DirectorySearcherLib.DirectorySearcher.SearchByAlias(SearchTermText.Text, parent);
            if (results.Count == 0)
            {
                StatusResult.Text = "User Not Found. Try Another Term.";
                StatusResult.Foreground = new SolidColorBrush(Windows.UI.Colors.White);
                results.Add(new User());
            }
            else if (results[0].error != null)
            {
                StatusResult.Text = "Error! " + results[0].error;
                StatusResult.Foreground = new SolidColorBrush(Windows.UI.Colors.Red);
            }
            else
            {
                StatusResult.Text = "Success";
                StatusResult.Foreground = new SolidColorBrush(Windows.UI.Colors.Green);
            }

            SearchResults.ItemsSource = results;
        }
Exemplo n.º 2
0
        public void InitializeComponent()
        {
            if (_contentLoaded)
                return;

            _contentLoaded = true;
            Application.LoadComponent(this, new System.Uri("ms-appx:///HomePage.xaml"), Windows.UI.Xaml.Controls.Primitives.ComponentResourceLocation.Application);
 
            pageRoot = (_8Tracks.Common.LayoutAwarePage)this.FindName("pageRoot");
            groupedItemsViewSource = (Windows.UI.Xaml.Data.CollectionViewSource)this.FindName("groupedItemsViewSource");
            passwordPrompt = (Windows.UI.Xaml.Controls.Grid)this.FindName("passwordPrompt");
            itemGridView = (Windows.UI.Xaml.Controls.GridView)this.FindName("itemGridView");
            itemListView = (Windows.UI.Xaml.Controls.ListView)this.FindName("itemListView");
            backButton = (Windows.UI.Xaml.Controls.Button)this.FindName("backButton");
            pageTitle = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("pageTitle");
            loginText = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("loginText");
            loginBox = (Windows.UI.Xaml.Controls.TextBox)this.FindName("loginBox");
            passwordText = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("passwordText");
            passwordBox = (Windows.UI.Xaml.Controls.PasswordBox)this.FindName("passwordBox");
            doneButton = (Windows.UI.Xaml.Controls.Button)this.FindName("doneButton");
            ApplicationViewStates = (Windows.UI.Xaml.VisualStateGroup)this.FindName("ApplicationViewStates");
            FullScreenLandscape = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenLandscape");
            Filled = (Windows.UI.Xaml.VisualState)this.FindName("Filled");
            FullScreenPortrait = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenPortrait");
            Snapped = (Windows.UI.Xaml.VisualState)this.FindName("Snapped");
        }
Exemplo n.º 3
0
        public BannerControl(GridView bannerCanv, XCollection<Banner> banners, Frame frame)
        {
            _frame = frame;         
            bannerCanv.Items?.Clear();
            var deviceWidth = Window.Current.CoreWindow.Bounds.Width;
            foreach (var banner in banners)
            {
                var bannerBitmap = new BitmapImage {UriSource = new Uri(banner.Image, UriKind.RelativeOrAbsolute)};

                var bannerImage = SystemInfoHelper.IsMobile() || deviceWidth < 800 ? new Image
                {
                    Source = bannerBitmap,
                    Stretch = Stretch.Fill,
                    MaxWidth = deviceWidth + 5
                } : new Image
                {
                    Source = bannerBitmap,
                    Stretch = Stretch.Fill,
                    MaxHeight = bannerCanv.MaxHeight                    
                };
                bannerImage.Tapped += OnBannerTap;                
                bannerImage.Tag = banner;
                bannerCanv.Visibility = Visibility.Visible;
                bannerImage.Visibility = Visibility.Visible;
                bannerCanv.Items?.Add(bannerImage);
            }
            if (SystemInfoHelper.IsMobile() || deviceWidth < 800)
                bannerCanv.MaxHeight = deviceWidth / 2.46;
        }
        protected override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            LayoutRoot = GetTemplateChild("LayoutRoot") as Grid;
            header = GetTemplateChild("header") as CalendarHeader;
            yearheader = GetTemplateChild("yearheader") as CalendarYearHeadar;
            semanticzoomDate = GetTemplateChild("semanticzoomDate") as SemanticZoom;
            gridviewDays = GetTemplateChild("gridviewDays") as GridView;
            gridviewMonths = GetTemplateChild("gridviewMonths") as GridView;

            Days = new ObservableCollection<Day>();
            Months = new ObservableCollection<Month>();
            Years = new ObservableCollection<Year>();

            this.Loaded += Calendar_Loaded;
            this.header.LeftButtonClick += header_LeftButtonClick;
            this.header.RightButtonClick += header_RightButtonClick;

            this.yearheader.LeftButtonClick += yearheader_LeftButtonClick;
            this.yearheader.RightButtonClick += yearheader_RightButtonClick;

            this.gridviewDays.ItemClick += gridviewDays_ItemClick;

            this.semanticzoomDate.ViewChangeStarted += semanticzoomDate_ViewChangeStarted;
        }
        public void InitializeComponent()
        {
            if (_contentLoaded)
                return;

            _contentLoaded = true;
            Application.LoadComponent(this, new System.Uri("ms-resource://spotifyapp/Files/View/CollectionSummaryPage.xaml"));

            CollectionViewSource = (Windows.UI.Xaml.Data.CollectionViewSource)this.FindName("CollectionViewSource");
            LayoutRoot = (Windows.UI.Xaml.Controls.Grid)this.FindName("LayoutRoot");
            OrientationStates = (Windows.UI.Xaml.VisualStateGroup)this.FindName("OrientationStates");
            Full = (Windows.UI.Xaml.VisualState)this.FindName("Full");
            Fill = (Windows.UI.Xaml.VisualState)this.FindName("Fill");
            Portrait = (Windows.UI.Xaml.VisualState)this.FindName("Portrait");
            Snapped = (Windows.UI.Xaml.VisualState)this.FindName("Snapped");
            ScrollViewer = (Windows.UI.Xaml.Controls.ScrollViewer)this.FindName("ScrollViewer");
            CategoryPanel = (Windows.UI.Xaml.Controls.StackPanel)this.FindName("CategoryPanel");
            HeaderTitlePanel = (Windows.UI.Xaml.Controls.Grid)this.FindName("HeaderTitlePanel");
            ItemGridView = (Windows.UI.Xaml.Controls.GridView)this.FindName("ItemGridView");
            ItemListView = (Windows.UI.Xaml.Controls.ListView)this.FindName("ItemListView");
            Title = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("Title");
            Image = (Windows.UI.Xaml.Controls.Image)this.FindName("Image");
            DescriptionText = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("DescriptionText");
            BackButton = (Windows.UI.Xaml.Controls.Button)this.FindName("BackButton");
            PageTitle = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("PageTitle");
        }
Exemplo n.º 6
0
 public static void MakeResponsive(SizeChangedEventArgs e, int itemWidth,int minItemWidth, GridView gridView)
 {
     ItemsWrapGrid myItemsPanel = (ItemsWrapGrid)gridView.ItemsPanelRoot;
     double screenWidth = e.NewSize.Width;
     int? itemsNumber = gridView.Items?.Count;
     if (itemsNumber > 0)
     {
         if (myItemsPanel != null) myItemsPanel.ItemWidth = (screenWidth / GetNumberOfColumns(screenWidth, itemWidth, minItemWidth));
     }
 }
Exemplo n.º 7
0
        private static SelectedItemsBehavior GetOrCreateBehavior(GridView target, IList list)
        {
            var behavior = target.GetValue(SelectedItemsBehaviorProperty) as SelectedItemsBehavior;
            if (behavior == null)
            {
                behavior = new SelectedItemsBehavior(target, list);
                target.SetValue(SelectedItemsBehaviorProperty, behavior);
            }

            return behavior;
        }
Exemplo n.º 8
0
            public SelectedItemsBehavior(GridView listBox, IList boundList)
            {
                _boundList = boundList;
                if (_boundList is INotifyCollectionChanged)
                {
                    ((INotifyCollectionChanged)_boundList).CollectionChanged += SelectedItemsBehavior_CollectionChanged;
                }

                _listBox = listBox;
                _listBox.SelectionChanged += OnSelectionChanged;
            }
Exemplo n.º 9
0
        public void InitializeComponent()
        {
            if (_contentLoaded)
                return;

            _contentLoaded = true;
            Application.LoadComponent(this, new System.Uri("ms-appx:///MainPage.xaml"), Windows.UI.Xaml.Controls.Primitives.ComponentResourceLocation.Application);
 
            AddButton = (Windows.UI.Xaml.Controls.Button)this.FindName("AddButton");
            DeleteButton = (Windows.UI.Xaml.Controls.Button)this.FindName("DeleteButton");
            MainGrid = (Windows.UI.Xaml.Controls.GridView)this.FindName("MainGrid");
        }
Exemplo n.º 10
0
        public void InitializeComponent()
        {
            if (_contentLoaded)
                return;

            _contentLoaded = true;
            Application.LoadComponent(this, new System.Uri("ms-appx:///BlankPage.xaml"), Windows.UI.Xaml.Controls.Primitives.ComponentResourceLocation.Application);
 
            LoadButton = (Windows.UI.Xaml.Controls.Button)this.FindName("LoadButton");
            AfficheDetails = (Windows.UI.Xaml.Controls.Canvas)this.FindName("AfficheDetails");
            ElementsEdit = (Windows.UI.Xaml.Controls.GridView)this.FindName("ElementsEdit");
            VillesEdit = (Windows.UI.Xaml.Controls.GridView)this.FindName("VillesEdit");
            LocationEdit = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("LocationEdit");
            VentEdit = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("VentEdit");
            TimeEdit = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("TimeEdit");
            HumiditeEdit = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("HumiditeEdit");
            pressionEdit = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("pressionEdit");
            TemperatureEdit = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("TemperatureEdit");
        }
Exemplo n.º 11
0
        public void InitializeComponent()
        {
            if (_contentLoaded)
                return;

            _contentLoaded = true;
            Application.LoadComponent(this, new System.Uri("ms-appx:///RecoArtists.xaml"), Windows.UI.Xaml.Controls.Primitives.ComponentResourceLocation.Application);
 
            pageRoot = (Mu_genotype1.Common.LayoutAwarePage)this.FindName("pageRoot");
            itemGridScrollViewer = (Windows.UI.Xaml.Controls.ScrollViewer)this.FindName("itemGridScrollViewer");
            itemListScrollViewer = (Windows.UI.Xaml.Controls.ScrollViewer)this.FindName("itemListScrollViewer");
            itemListView = (Windows.UI.Xaml.Controls.ListView)this.FindName("itemListView");
            itemGridView = (Windows.UI.Xaml.Controls.GridView)this.FindName("itemGridView");
            backButton = (Windows.UI.Xaml.Controls.Button)this.FindName("backButton");
            pageTitle = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("pageTitle");
            FullScreenLandscape = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenLandscape");
            Filled = (Windows.UI.Xaml.VisualState)this.FindName("Filled");
            FullScreenPortrait = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenPortrait");
            Snapped = (Windows.UI.Xaml.VisualState)this.FindName("Snapped");
        }
        public void InitializeComponent()
        {
            if (_contentLoaded)
                return;

            _contentLoaded = true;
            Application.LoadComponent(this, new System.Uri("ms-resource://matchit/Files/GroupedCollectionPage.xaml"));

            GroupedCollectionViewSource = (Windows.UI.Xaml.Data.CollectionViewSource)this.FindName("GroupedCollectionViewSource");
            LayoutRoot = (Windows.UI.Xaml.Controls.Grid)this.FindName("LayoutRoot");
            OrientationStates = (Windows.UI.Xaml.VisualStateGroup)this.FindName("OrientationStates");
            Full = (Windows.UI.Xaml.VisualState)this.FindName("Full");
            Fill = (Windows.UI.Xaml.VisualState)this.FindName("Fill");
            Portrait = (Windows.UI.Xaml.VisualState)this.FindName("Portrait");
            Snapped = (Windows.UI.Xaml.VisualState)this.FindName("Snapped");
            ItemListView = (Windows.UI.Xaml.Controls.ListView)this.FindName("ItemListView");
            ItemGridView = (Windows.UI.Xaml.Controls.GridView)this.FindName("ItemGridView");
            BackButton = (Windows.UI.Xaml.Controls.Button)this.FindName("BackButton");
            PageTitle = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("PageTitle");
        }
        public void InitializeComponent()
        {
            if (_contentLoaded)
                return;

            _contentLoaded = true;
            Application.LoadComponent(this, new System.Uri("ms-appx:///GroupDetailPage.xaml"), Windows.UI.Xaml.Controls.Primitives.ComponentResourceLocation.Application);
 
            pageRoot = (ChampionshipOrganizer.Common.LayoutAwarePage)this.FindName("pageRoot");
            itemsViewSource = (Windows.UI.Xaml.Data.CollectionViewSource)this.FindName("itemsViewSource");
            itemGridView = (Windows.UI.Xaml.Controls.GridView)this.FindName("itemGridView");
            itemListView = (Windows.UI.Xaml.Controls.ListView)this.FindName("itemListView");
            backButton = (Windows.UI.Xaml.Controls.Button)this.FindName("backButton");
            pageTitle = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("pageTitle");
            ApplicationViewStates = (Windows.UI.Xaml.VisualStateGroup)this.FindName("ApplicationViewStates");
            FullScreenLandscape = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenLandscape");
            Filled = (Windows.UI.Xaml.VisualState)this.FindName("Filled");
            FullScreenPortrait = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenPortrait");
            Snapped = (Windows.UI.Xaml.VisualState)this.FindName("Snapped");
        }
Exemplo n.º 14
0
        public void InitializeComponent()
        {
            if (_contentLoaded)
                return;

            _contentLoaded = true;
            Application.LoadComponent(this, new System.Uri("ms-appx:///MapMusic.xaml"), Windows.UI.Xaml.Controls.Primitives.ComponentResourceLocation.Application);
 
            pageRoot = (Mu_genotype1.Common.LayoutAwarePage)this.FindName("pageRoot");
            progbar = (Windows.UI.Xaml.Controls.ProgressBar)this.FindName("progbar");
            test = (Windows.UI.Xaml.Controls.Grid)this.FindName("test");
            myMap = (Bing.Maps.Map)this.FindName("myMap");
            SubHeaderTb = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("SubHeaderTb");
            itemsGridView = (Windows.UI.Xaml.Controls.GridView)this.FindName("itemsGridView");
            backButton = (Windows.UI.Xaml.Controls.Button)this.FindName("backButton");
            pageTitle = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("pageTitle");
            FullScreenLandscape = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenLandscape");
            Filled = (Windows.UI.Xaml.VisualState)this.FindName("Filled");
            FullScreenPortrait = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenPortrait");
            Snapped = (Windows.UI.Xaml.VisualState)this.FindName("Snapped");
        }
Exemplo n.º 15
0
        public void InitializeComponent()
        {
            if (_contentLoaded)
                return;

            _contentLoaded = true;
            Application.LoadComponent(this, new System.Uri("ms-appx:///Trends.xaml"), Windows.UI.Xaml.Controls.Primitives.ComponentResourceLocation.Application);
 
            pageRoot = (Mu_genotype1.Common.LayoutAwarePage)this.FindName("pageRoot");
            progbar = (Windows.UI.Xaml.Controls.ProgressBar)this.FindName("progbar");
            gridScrollViewer = (Windows.UI.Xaml.Controls.ScrollViewer)this.FindName("gridScrollViewer");
            snappedScrollViewer = (Windows.UI.Xaml.Controls.ScrollViewer)this.FindName("snappedScrollViewer");
            gridLayoutPanel = (Windows.UI.Xaml.Controls.StackPanel)this.FindName("gridLayoutPanel");
            itemsGridView = (Windows.UI.Xaml.Controls.GridView)this.FindName("itemsGridView");
            GNameTb = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("GNameTb");
            GImage = (Windows.UI.Xaml.Controls.Image)this.FindName("GImage");
            GDesc = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("GDesc");
            backButton = (Windows.UI.Xaml.Controls.Button)this.FindName("backButton");
            pageTitle = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("pageTitle");
            FullScreenLandscape = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenLandscape");
            Filled = (Windows.UI.Xaml.VisualState)this.FindName("Filled");
            FullScreenPortrait = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenPortrait");
            Snapped = (Windows.UI.Xaml.VisualState)this.FindName("Snapped");
        }
Exemplo n.º 16
0
 public static IList GetSelectedItems(GridView listBox)
 {
     return listBox.GetValue(SelectedItemsProperty) as IList;
 }
Exemplo n.º 17
0
 public static void SetSelectedItems(GridView listBox, IList list)
 {
     listBox.SetValue(SelectedItemsProperty, list);
 }
 internal void Detach()
 {
     _gridView.SelectionChanged -= OnGridViewSelectionChanged;
     _gridView = null;
     var eventInfo =
         _boundSelection.GetType().GetDeclaredEvent("CollectionChanged");
     eventInfo.RemoveEventHandler(_boundSelection, _handler);
     _boundSelection = null;
 }
        private void Attach(GridView gridView, dynamic boundSelection)
        {
            _gridView = gridView;
            _gridView.SelectionChanged += OnGridViewSelectionChanged;
            _boundSelection = boundSelection;
            _gridView.SelectedItems.Clear();

            foreach (object item in _boundSelection)
            {
                if (!_gridView.SelectedItems.Contains(item))
                {
                    _gridView.SelectedItems.Add(item);
                }
            }

            var eventInfo =
                _boundSelection.GetType().GetDeclaredEvent("CollectionChanged");
            eventInfo.AddEventHandler(_boundSelection, _handler);
            //_boundSelection.CollectionChanged += OnBoundSelectionChanged;
        }
 public GridViewBindableSelectionHandler(
     GridView GridView, dynamic boundSelection)
 {
     _handler = OnBoundSelectionChanged;
     Attach(GridView, boundSelection);
 }
        /// <summary>
        /// Function to initialize ZoomedOutView of Semantic Zoom control
        /// </summary>
        private void InitializeZoomedOutView()
        {
            // Page Size is set to zero for items in main view so that pages of original size are rendered
            Size pageSize;

            // Page size for thumbnail view is set to 300px as this gives good view of the thumbnails on all resolutions
            pageSize.Width = (double)this.Resources["thumbnailWidth"];
            pageSize.Height = (double)this.Resources["thumbnailHeight"];

            // Thumbnail view items are rendered on a SIS surface as they are of fixed size
            this.pdfDataSourceZoomedOutView = new PdfDocViewModel(pdfDocument, pageSize, SurfaceType.SurfaceImageSource);

            this.zoomedOutView = new GridView();
            this.zoomedOutView.Style = this.zoomedOutViewStyle;
            this.zoomedOutView.ItemTemplate = this.zoomedOutViewItemTemplate;
            this.zoomedOutView.ItemsPanel = this.zoomedOutViewItemsPanelTemplate;
            this.zoomedOutView.ItemContainerStyle = this.zoomedOutViewItemContainerStyle;
            this.zoomedOutView.ItemsSource = this.pdfDataSourceZoomedOutView;
            this.semanticZoom.ZoomedOutView = this.zoomedOutView;
        }
        public static void SwitchGridViewOrientation(GridView gridView, Orientation orientation, int maxItemsPerRow = -1)
        {
            if (gridView == null) return;
            var wrapGrid = gridView.ItemsPanelRoot as ItemsWrapGrid;

            // Desiered GridView Orientation should be oppsite with WrapGrid's major layout orientation
            if (wrapGrid == null || wrapGrid.Orientation != orientation)
                return;

            var scrollViwer = gridView.GetFirstDescendantOfType<ScrollViewer>();
            if (orientation == Orientation.Horizontal)
            {
                scrollViwer.VerticalScrollMode = ScrollMode.Disabled;
                scrollViwer.VerticalScrollBarVisibility = ScrollBarVisibility.Disabled;
                scrollViwer.HorizontalScrollMode = ScrollMode.Enabled;
                scrollViwer.HorizontalScrollBarVisibility = ScrollBarVisibility.Auto;
                wrapGrid.Orientation = Orientation.Vertical;
                wrapGrid.MaximumRowsOrColumns = maxItemsPerRow;
            }
            else
            {
                scrollViwer.VerticalScrollMode = ScrollMode.Enabled;
                scrollViwer.VerticalScrollBarVisibility = ScrollBarVisibility.Auto;
                scrollViwer.HorizontalScrollMode = ScrollMode.Disabled;
                scrollViwer.HorizontalScrollBarVisibility = ScrollBarVisibility.Disabled;
                wrapGrid.Orientation = Orientation.Horizontal;
                wrapGrid.MaximumRowsOrColumns = maxItemsPerRow;
            }
        }
Exemplo n.º 23
0
 private void Register(object sender, RoutedEventArgs e)
 {
     Control c = sender as Control;
     if(c == null)
     {
         imageLoader = sender as Image;
         return;
     }
     switch (c.Name)
     {
         case "queue":
             queue = sender as GridView;
             break;
         case "tracker":
             tracker = sender as ListView;
             break;
         case "cale":
             cale = sender as GridView;
             break;
     }
 }
Exemplo n.º 24
0
        private void GridView_SizeChanged(object sender, SizeChangedEventArgs e)
        {
            gridView = sender as GridView;

            if (e.PreviousSize.Width != e.NewSize.Width)
            {
                RecalculateLayout(e.NewSize.Width);
            }
        }
Exemplo n.º 25
0
        protected override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            gridView = GetTemplateChild("gridView") as GridView;
            gridView.SizeChanged += GridView_SizeChanged;
            _isInitialized = true;
            OnOneRowModeEnabledChanged(this, OneRowModeEnabled);
        }
Exemplo n.º 26
0
        private void CategoriesGridView_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            categoriesGrid = (GridView)sender;
            PlaylistViewModel playlistAdded = (PlaylistViewModel)e.AddedItems.FirstOrDefault();
            if (DownloadAccessor.Instance.Downloading)
            {
                if (categoriesGrid.SelectedItems.Count >= 1)
                {
                    if (playlistAdded != null)
                    {
                        if (playlistAdded.DownloadedIcon_Visibility == Visibility.Visible)
                        {
                            DeleteButton_Visibility = Visibility.Visible;
                            playlistsSelected = categoriesGrid.SelectedItems.ToList();
                        }
                        else
                        {
                            categoriesGrid.SelectedItems.Remove(e.AddedItems[0]);
                        }
                    }
                }
                AppBarOpen = true;
            }
            else
            {

                if (categoriesGrid.SelectedItems.Count == 0)
                {
                    DownloadButton_Visibility = Visibility.Collapsed;
                    Downloading_Visibility = Visibility.Collapsed;
                    DeleteButton_Visibility = Visibility.Collapsed;
                }

                if (categoriesGrid.SelectedItems.Count == 1 && playlistAdded != null)
                {
                    if (playlistAdded.DownloadedIcon_Visibility == Visibility.Visible)
                    {
                        DownloadButton_Visibility = Visibility.Collapsed;
                        Downloading_Visibility = Visibility.Collapsed;
                        DeleteButton_Visibility = Visibility.Visible;

                    }
                    else
                    {
                        DownloadButton_Visibility = Visibility.Visible;
                        Downloading_Visibility = Visibility.Collapsed;
                        DeleteButton_Visibility = Visibility.Collapsed;
                    }
                }

                if (categoriesGrid.SelectedItems.Count > 1)
                {
                    PlaylistViewModel firstPlaylist = (PlaylistViewModel)playlistsSelected.ElementAt(0);
                    if (playlistAdded != null)
                    {
                        if (playlistAdded.DownloadedIcon_Visibility != firstPlaylist.DownloadedIcon_Visibility)
                        {
                            categoriesGrid.SelectedItems.Remove(e.AddedItems[0]);
                        }
                    }
                }
                playlistsSelected = categoriesGrid.SelectedItems.ToList();
                AppBarOpen = playlistsSelected.Any() ? true : false;
            }
            
        }
Exemplo n.º 27
0
 private void OnDragItemsStarting(object sender, DragItemsStartingEventArgs e)
 {
     _draggedFrom = sender as GridView;
     _draggedPiece = e.Items.OfType<PieceElement>().First();
 }
Exemplo n.º 28
0
 private void gvProfiles_Loaded(object sender, RoutedEventArgs e)
 {
     gvProfiles = sender as GridView;
 }
Exemplo n.º 29
0
 public void SetPictureView(GridView PictureView)
 {
     this.PictureView = PictureView;
 }
        public void InitializeComponent()
        {
            if (_contentLoaded)
                return;

            _contentLoaded = true;
            Application.LoadComponent(this, new System.Uri("ms-appx:///SearchResultsPage1.xaml"), Windows.UI.Xaml.Controls.Primitives.ComponentResourceLocation.Application);
 
            pageRoot = (Fashionizer2.Common.LayoutAwarePage)this.FindName("pageRoot");
            resultsViewSource = (Windows.UI.Xaml.Data.CollectionViewSource)this.FindName("resultsViewSource");
            filtersViewSource = (Windows.UI.Xaml.Data.CollectionViewSource)this.FindName("filtersViewSource");
            resultsPanel = (Windows.UI.Xaml.Controls.Grid)this.FindName("resultsPanel");
            noResultsTextBlock = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("noResultsTextBlock");
            typicalPanel = (Windows.UI.Xaml.Controls.Grid)this.FindName("typicalPanel");
            snappedPanel = (Windows.UI.Xaml.Controls.Grid)this.FindName("snappedPanel");
            resultsListView = (Windows.UI.Xaml.Controls.ListView)this.FindName("resultsListView");
            filtersItemsControl = (Windows.UI.Xaml.Controls.ItemsControl)this.FindName("filtersItemsControl");
            resultsGridView = (Windows.UI.Xaml.Controls.GridView)this.FindName("resultsGridView");
            backButton = (Windows.UI.Xaml.Controls.Button)this.FindName("backButton");
            pageTitle = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("pageTitle");
            resultText = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("resultText");
            queryText = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("queryText");
            ApplicationViewStates = (Windows.UI.Xaml.VisualStateGroup)this.FindName("ApplicationViewStates");
            ResultStates = (Windows.UI.Xaml.VisualStateGroup)this.FindName("ResultStates");
            ResultsFound = (Windows.UI.Xaml.VisualState)this.FindName("ResultsFound");
            NoResultsFound = (Windows.UI.Xaml.VisualState)this.FindName("NoResultsFound");
            FullScreenLandscape = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenLandscape");
            Filled = (Windows.UI.Xaml.VisualState)this.FindName("Filled");
            FullScreenPortrait = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenPortrait");
            Snapped = (Windows.UI.Xaml.VisualState)this.FindName("Snapped");
        }