Exemplo n.º 1
0
        private static void Click(object sender, RoutedEventArgs e)
        {
            var dataContext = sender as FrameworkElement;

            Mouse.OverrideCursor = Cursors.Arrow;

            StationCore.UnlockAll();

            if (!(dataContext.DataContext is ISimulationService simulationService))
            {
                throw new Exception($"Element {dataContext} not implement {typeof(ISimulationService)}");
            }

            simulationService.SetDragService(new CursorAnimation());
            StationCore.SetStationPickService(new DefaultPickService(simulationService));
        }
Exemplo n.º 2
0
        private static void Click(object sender, RoutedEventArgs e)
        {
            var dataContext = sender as FrameworkElement;

            Mouse.OverrideCursor = Cursors.Arrow;

            if (!(dataContext.DataContext is ISimulationService simulationService))
            {
                throw new Exception($"Element {dataContext} not implement {typeof(ISimulationService)}");
            }
            var vm      = new RouteDialogeViewModel();
            var content = new RouteDialogeView
            {
                DataContext = vm,
            };

            Dialoge.ShowDialog(content, "Route builder");

            simulationService.SetDragService(new CursorAnimation());
            StationCore.SetStationPickService(new DefaultPickService(simulationService));
            StationCore.UnlockAll();
        }