Exemplo n.º 1
0
        public void MarqueeBrowse(MetadataCategory category, string name, object icon)
        {
            if (name == null)
            {
                throw new ArgumentNullException("name");
            }

            try
            {
                var view        = taskController.GetMarqueeView(category);
                var description = string.Format("Browse: {0}", name);

                Action workFunction  = () => view.RefreshItems();
                var    taskViewModel = new SimpleTaskViewModel(logger, workFunction, name, description, icon);

                var tabItem = new TabItem();

                //TextBlock header = new TextBlock();
                //header.Inlines.Add(name);
                //header.ToolTip = description;
                tabItem.Header = new TaskHeader(logger, taskViewModel);

                tabItem.Content = view;
                resultControl.Items.Add(tabItem);
                tabItem.IsSelected = true;

                AddViewModel(taskViewModel, tabItem);

                if (taskViewModel.Status == TaskStatus.Ready)
                {
                    taskViewModel.Start();
                }
            }
            catch (Exception ex)
            {
                logger.Error("  TaskResultView.MarqueeBrowse", ex);
            }
        }