public void Select(GraphItemViewModel viewModelObject)
        {
            if (viewModelObject == null) return;

            InspectorViewModel.TargetViewModel = viewModelObject;

            if (viewModelObject.IsSelected)
            {
                return;
            }
            if (LastMouseEvent != null && LastMouseEvent.ModifierKeyStates != null && !LastMouseEvent.ModifierKeyStates.Alt)
                DeselectAll();

            viewModelObject.IsSelected = true;
            InvertApplication.SignalEvent<IGraphSelectionEvents>(
                _ => _.SelectionChanged(viewModelObject));
        }
Example #2
0
 protected Drawer(GraphItemViewModel viewModelObject)
 {
     ViewModelObject = viewModelObject;
 }
//        void Update()
//        {
//            if (TreeModel != null && TreeModel.IsDirty) TreeModel.Refresh();
//            Repaint();
//        }

        public void SelectionChanged(GraphItemViewModel selected)
        {
            if (TreeModel == null) return;
            var selectedData = selected == null ? null : selected.DataObject;

            if (selectedData != TreeModel.SelectedData)
            {
                var item = TreeModel.TreeData.FirstOrDefault(_ => _.Data == selectedData);
                if (item != null)
                {
                    TreeModel.SelectedIndex = item.Index;
                    TreeModel.ExpandPathTo(item);
                    TreeModel.ScrollToItem(item);
                }
                else
                {
                    TreeModel.SelectedIndex = -1;
                }
            }
        }
 public void SelectionChanged(GraphItemViewModel selected)
 {
     Debug.Log("Item selected: "+selected.GetType().Name);
 }
 public void SelectionChanged(GraphItemViewModel selected)
 {
     HideSelection();
 }