示例#1
0
        void SelectorItem_PointerMoved(object sender, PointerRoutedEventArgs e)
        {
            CustomSelector selectorViewModel = this.DataContext as CustomSelector;

            if (isPressed && Command != null)
            {
                DrawParam param = new DrawParam(e, ((IEnumerable <object>)selectorViewModel.Nodes).FirstOrDefault());
                this.Command.Execute(param);
                isPressed = false;
            }
        }
示例#2
0
        public CustomDiagramControl()
        {
            CustomSelector selector = new CustomSelector();

            selector.Graph = (this.Info as IGraphInfo);
            selector.Graph.Commands.Delete.Execute(null);
            selector.Graph.Commands.BringToFront.Execute(null);
            selector.Graph.Commands.SendToBack.Execute(null);
            selector.Graph.Commands.Draw.Execute(null);
            SelectedItems       = selector;
            selector.ZIndex     = 10000;
            selector.Nodes      = new ObservableCollection <object>();
            selector.Connectors = new ObservableCollection <object>();
            selector.Groups     = new ObservableCollection <object>();
        }