public MainWindow()
        {
            InitializeComponent();

            for (int i = 1; i <= 30; i++)
            {
                PhaseFirstTimeCb.Items.Add(i);
                PhaseSecTimeCb.Items.Add(i);
            }

            ExitAppBtn.Visibility              = Visibility.Hidden;
            StopNNTSPbtn.Visibility            = Visibility.Hidden;
            _dTforUpdatingProgressBar          = new DispatcherTimer();
            _dTforUpdatingProgressBar.Tick    += DispatcherTimerForUpdatingProgressBar_Tick;
            _dTforUpdatingProgressBar.Interval = new TimeSpan(0, 0, 0, 0, 500);
            _resultsConsumer = new ResultsConsumer();
            this.DataContext = _resultsConsumer;
        }
示例#2
0
        public BestTourWindow(ResultsConsumer resultsCons)
        {
            InitializeComponent();
            _resultsConsumer = resultsCons;
            this.DataContext = _resultsConsumer;

            Loaded += delegate
            {
                Height = _resultsConsumer.YHeight;
                Width  = _resultsConsumer.XWidth;
                _resultsConsumer.PropertyChanged += ViewModelOnPropertyChanged;
                SizeChanged += BestTourWindow_SizeChanged;
            };
            Unloaded += delegate
            {
                _resultsConsumer.PropertyChanged -= ViewModelOnPropertyChanged;
                SizeChanged -= BestTourWindow_SizeChanged;
            };
        }