Пример #1
0
        private void UpdateMessage()
        {
            string message = null;

            if (IsDetailsPaneVisible)
            {
                PackageViewModel selectedPackage = this.SelectedPackage;
                if (this.SelectedPackage != null)
                {
                    message = this.SelectedPackage.Message;
                }
            }

            Message = message;
        }
        private Action <Task <IEnumerable <IPackage> > > UpdateUpdatesFilter()
        {
            return((task) =>
            {
                if (task.Result == null)
                {
                    return;
                }

                _updatesFilter.Items.Clear();
                var packages = task.Result;
                foreach (var package in packages)
                {
                    var packageViewModel = new PackageViewModel(this.Model, package, PackageViewModelAction.Update);
                    _updatesFilter.Items.Add(new ListViewItemWrapper()
                    {
                        Item = packageViewModel,
                        SearchText = packageViewModel.SearchText,
                        Name = packageViewModel.Name,
                    });
                }
            });
        }
Пример #3
0
        private Action<Task<IEnumerable<IPackage>>> UpdateUpdatesFilter()
        {
            return (task) =>
            {
                if (task.Result == null)
                {
                    return;
                }

                _updatesFilter.Items.Clear();
                var packages = task.Result;
                foreach (var package in packages)
                {
                    var packageViewModel = new PackageViewModel(this.Model, package, PackageViewModelAction.Update);
                    _updatesFilter.Items.Add(new ListViewItemWrapper()
                    {
                        Item = packageViewModel,
                        SearchText = packageViewModel.SearchText,
                        Name = packageViewModel.Name,
                    });
                }
            };
        }
Пример #4
0
        private void OnSelectedItemChanged(object oldValue, object newValue)
        {
            var oldVirtualizingListEntry = oldValue as VirtualizingListEntry;
            if (oldVirtualizingListEntry != null)
            {
                oldVirtualizingListEntry.PropertyChanged -= this.SelectedItem_PropertyChanged;
            }

            var virtualizingListViewEntry = newValue as VirtualizingListEntry;
            var listViewItemWrapper = newValue as ListViewItemWrapper;

            if (virtualizingListViewEntry != null)
            {
                virtualizingListViewEntry.PropertyChanged += this.SelectedItem_PropertyChanged;
                SelectedPackage = virtualizingListViewEntry.Item as PackageViewModel;
            }
            else if (listViewItemWrapper != null)
            {
                SelectedPackage = listViewItemWrapper.Item as PackageViewModel;
            }
            else
            {
                SelectedPackage = null;
            }
        }