Пример #1
0
        private void RoadGraphConfig()
        {
            var wnd = new View.ConfigWindows.RoadGraphConfigWindow();
            var vm  = new ViewModel.RoadGraphConfigViewModel(_scenario);

            wnd.DataContext = vm;
            wnd.Owner       = Helpers.MVVM.MVVMHelper.GetActiveWindow();
            wnd.ShowDialog();
            if (vm.DialogResult == true)
            {
                _scenario.RoadGraph = new Helpers.Graph.Graph <WayPoint, string>();
                foreach (var node in vm.RoadGraph.Nodes)
                {
                    _scenario.RoadGraph.Add(node);
                }
                foreach (var edge in vm.RoadGraph.Edges)
                {
                    _scenario.RoadGraph.AddEdge(edge.Start, edge.End, edge.Data.ToString(System.Globalization.CultureInfo.InvariantCulture));
                }
                _sim.RoadGraph = vm.RoadGraph;
            }
        }
 private void RoadGraphConfig()
 {
     var wnd = new View.ConfigWindows.RoadGraphConfigWindow();
     var vm = new ViewModel.RoadGraphConfigViewModel(_scenario);
     wnd.DataContext = vm;
     wnd.Owner = Helpers.MVVM.MVVMHelper.GetActiveWindow();
     wnd.ShowDialog();
     if (vm.DialogResult == true)
     {
         _scenario.RoadGraph = new Helpers.Graph.Graph<WayPoint, string>();
         foreach (var node in vm.RoadGraph.Nodes)
         {
             _scenario.RoadGraph.Add(node);
         }
         foreach (var edge in vm.RoadGraph.Edges)
         {
             _scenario.RoadGraph.AddEdge(edge.Start,edge.End,edge.Data.ToString(System.Globalization.CultureInfo.InvariantCulture));
         }
         _sim.RoadGraph = vm.RoadGraph;
     }
 }