Ejemplo n.º 1
0
        private void MoveSelected(object parameter)
        {
            if (parameter is ListView listView)
            {
                var selectedItems = new List <ResourceInfo>();

                foreach (var selectedItem in listView.SelectedItems)
                {
                    if (selectedItem is ResourceInfo resourceInfo)
                    {
                        selectedItems.Add(resourceInfo);
                    }
                }

                var parameters = new MoveFileOrFolderPageParameters
                {
                    ResourceInfos = selectedItems
                };

                if (selectedItems.Count == 1)
                {
                    parameters = new MoveFileOrFolderPageParameters
                    {
                        ResourceInfo = selectedItems[0]
                    };
                }

                Directory.ToggleSelectionMode();
                _navigationService.Navigate(PageToken.MoveFileOrFolder.ToString(), parameters.Serialize());
            }
        }
Ejemplo n.º 2
0
        public override void OnNavigatedTo(NavigatedToEventArgs e, Dictionary <string, object> viewModelState)
        {
            base.OnNavigatedTo(e, viewModelState);
            base.OnNavigatedTo(e, viewModelState);
            ResourceInfo  = null;
            ResourceInfos = null;
            var parameters    = MoveFileOrFolderPageParameters.Deserialize(e.Parameter);
            var resourceInfo  = parameters?.ResourceInfo;
            var resourceInfos = parameters?.ResourceInfos;

            if (resourceInfo != null)
            {
                ResourceInfo = resourceInfo;
            }
            else if (resourceInfos != null)
            {
                ResourceInfos = resourceInfos;
            }
            else
            {
                return;
            }

            Directory = DirectoryService.Instance;
            StartDirectoryListing();
            _isNavigatingBack    = false;
            SelectedFileOrFolder = null;
        }
Ejemplo n.º 3
0
        private void MoveResource(object obj)
        {
            if (ResourceInfo == null)
            {
                return;
            }

            var parameters = new MoveFileOrFolderPageParameters
            {
                ResourceInfo = ResourceInfo
            };

            _navigationService.Navigate(PageTokens.MoveFileOrFolder.ToString(), parameters.Serialize());
        }