public FrameworkElement CreateWidgetControl(IDiagram widgetViewModel, ContextMenu contextMenu)
        {
            var viewModel = widgetViewModel as TicketExplorerWidgetViewModel;

            Debug.Assert(viewModel != null);

            var ret = new TicketExplorerView {
                DataContext = viewModel.TicketExplorerViewModel, ContextMenu = contextMenu, Tag = viewModel
            };

            var heightBinding = new Binding("Height")
            {
                Source = viewModel, Mode = BindingMode.TwoWay
            };
            var widthBinding = new Binding("Width")
            {
                Source = viewModel, Mode = BindingMode.TwoWay
            };
            var xBinding = new Binding("X")
            {
                Source = viewModel, Mode = BindingMode.TwoWay
            };
            var yBinding = new Binding("Y")
            {
                Source = viewModel, Mode = BindingMode.TwoWay
            };

            ret.SetBinding(InkCanvas.LeftProperty, xBinding);
            ret.SetBinding(InkCanvas.TopProperty, yBinding);
            ret.SetBinding(FrameworkElement.HeightProperty, heightBinding);
            ret.SetBinding(FrameworkElement.WidthProperty, widthBinding);

            return(ret);
        }
        public FrameworkElement CreateWidgetControl(IDiagram widgetViewModel, ContextMenu contextMenu)
        {
            var viewModel = widgetViewModel as TicketExplorerWidgetViewModel;
            Debug.Assert(viewModel != null);

            var ret = new TicketExplorerView { DataContext = viewModel.TicketExplorerViewModel, ContextMenu = contextMenu, Tag = viewModel };

            var heightBinding = new Binding("Height") { Source = viewModel, Mode = BindingMode.TwoWay };
            var widthBinding = new Binding("Width") { Source = viewModel, Mode = BindingMode.TwoWay };
            var xBinding = new Binding("X") { Source = viewModel, Mode = BindingMode.TwoWay };
            var yBinding = new Binding("Y") { Source = viewModel, Mode = BindingMode.TwoWay };

            ret.SetBinding(InkCanvas.LeftProperty, xBinding);
            ret.SetBinding(InkCanvas.TopProperty, yBinding);
            ret.SetBinding(FrameworkElement.HeightProperty, heightBinding);
            ret.SetBinding(FrameworkElement.WidthProperty, widthBinding);

            return ret;
        }