コード例 #1
0
        private void View_Drop(object sender, DragEventArgs e)
        {
            object data = e.Data.GetData("Zhichkin.Metadata.Model.Entity");

            if (data == null)
            {
                return;
            }
            SetDefaultBackground(sender);

            Entity entity = data as Entity;

            if (entity == null)
            {
                return;
            }

            MetadataTreeViewModel viewModel = this.DataContext as MetadataTreeViewModel;

            if (viewModel == null)
            {
                return;
            }

            viewModel.BuildDataNodesTree(entity);

            Z.Notify(new Notification {
                Title = "Hermes", Content = "Узлы данных сформированы."
            });
        }
コード例 #2
0
        private void TreeView_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs <object> e)
        {
            MetadataTreeViewModel viewModel = this.DataContext as MetadataTreeViewModel;

            if (viewModel == null)
            {
                return;
            }
            viewModel.SelectedNode = (MetadataTreeNode)e.NewValue;
        }
コード例 #3
0
        private void BuildMetadataTree()
        {
            Z.ClearRightRegion(this.regionManager);
            IRegion rightRegion = this.regionManager.Regions[RegionNames.RightRegion];

            if (rightRegion == null)
            {
                return;
            }

            MetadataTreeViewModel model = new MetadataTreeViewModel();
            MetadataTreeView      view  = new MetadataTreeView();

            view.DataContext = model;
            rightRegion.Add(view);
        }
コード例 #4
0
        public void DocumentsTreeIsBuilt(MetadataTreeNode root)
        {
            if (root == null)
            {
                return;
            }

            Dispatcher.Invoke(() =>
            {
                MetadataTreeViewModel viewModel = this.DataContext as MetadataTreeViewModel;
                if (viewModel == null)
                {
                    return;
                }
                viewModel.Nodes.Add(root);
            });
        }
コード例 #5
0
 public void SetStateText(string text)
 {
     if (string.IsNullOrWhiteSpace(text))
     {
         return;
     }
     Dispatcher.Invoke(() =>
     {
         MetadataTreeViewModel viewModel = this.DataContext as MetadataTreeViewModel;
         if (viewModel == null)
         {
             return;
         }
         viewModel.SetStateText(text);
         int last_index = viewModel.StateList.Count - 1;
         this.StateListBox.SelectedIndex = last_index;
         this.StateListBox.ScrollIntoView(this.StateListBox.SelectedItem);
     });
 }