Ejemplo n.º 1
0
        public void SetItems(List <SpotObject> spots)
        {
            // If items have something, clear.
            this.Items.Clear();

            // Sorting spots
            spots.Sort((s1, s2) =>
            {
                return(s1.SpotName.CompareTo(s2.SpotName));
            });
            spots.Sort((s1, s2) =>
            {
                return(s1.SpotDistance.CompareTo(s2.SpotDistance));
            });

            // Convert jarray spots to spot view items and set to view model
            foreach (SpotObject spot in spots)
            {
                // Set new spot view item
                SpotViewItem spotViewItem = new SpotViewItem(spot);

                if (spot.IsPrivate)
                {
                    spotViewItem.IsPrivateImage = FileObjectViewModel.IS_PRIVATE_IMAGE_URI;
                }
                else
                {
                    spotViewItem.IsPrivateImage = FileObjectViewModel.TRANSPARENT_IMAGE_URI;
                }

                this.Items.Add(spotViewItem);
            }
        }
Ejemplo n.º 2
0
        public void SetItems(List<SpotObject> spots)
        {
            // If items have something, clear.
            this.Items.Clear();

            // Sorting spots
            spots.Sort((s1, s2) =>
            {
                return s1.SpotName.CompareTo(s2.SpotName);
            });
            spots.Sort((s1, s2) =>
            {
                return s1.SpotDistance.CompareTo(s2.SpotDistance);
            });

            // Convert jarray spots to spot view items and set to view model
            foreach (SpotObject spot in spots)
            {
                // Set new spot view item
                SpotViewItem spotViewItem = new SpotViewItem(spot);

                if (spot.IsPrivate)
                    spotViewItem.IsPrivateImage = FileObjectViewModel.IS_PRIVATE_IMAGE_URI;
                else
                    spotViewItem.IsPrivateImage = FileObjectViewModel.TRANSPARENT_IMAGE_URI;

                this.Items.Add(spotViewItem);
            }
        }
        /// 이 섹션에서 제공되는 메서드는 NavigationHelper에서
        /// 페이지의 탐색 메서드에 응답하기 위해 사용됩니다.
        /// 
        /// 페이지별 논리는 다음에 대한 이벤트 처리기에 있어야 합니다.  
        /// <see cref="GridCS.Common.NavigationHelper.LoadState"/>
        /// 및 <see cref="GridCS.Common.NavigationHelper.SaveState"/>입니다.
        /// 탐색 매개 변수는 LoadState 메서드 
        /// 및 이전 세션 동안 유지된 페이지 상태에서 사용할 수 있습니다.

        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            this.NavigationHelper.OnNavigatedTo(e);

            // Get Parameter
            this.CurrentSpotViewItem = e.Parameter as SpotViewItem;

            // Set this explorer page.
            uiSpotNameText.Text = this.CurrentSpotViewItem.SpotName;
            uiAccountNameText.Text = this.CurrentSpotViewItem.AccountName;
            Switcher.SetStorageTo(Switcher.GetMainStorage().GetStorageName());
            this.CurrentSpot = App.SpotManager.GetSpotObject(this.CurrentSpotViewItem.SpotId);

            uiExplorerList.SelectedIndex = EventHelper.PICK_PIVOT;
            this.SetPickPivot(AppResources.Loading);
            this.SetPinPivot(AppResources.Loading);
        }