Ejemplo n.º 1
0
        public JumpFinderViewModel()
        {
            FromStationSelector = new StationSelectorViewModel()
            {
                UserCanSelectAny     = true,
                UserCanSelectCurrent = true,
            };
            FromStationSelector.PropertyChanged += FromStationSelector_PropertyChanged;
            ToStationSelector = new StationSelectorViewModel()
            {
                UserCanSelectAny     = true,
                UserCanSelectCurrent = true,
            };
            ToStationSelector.PropertyChanged += ToStationSelector_PropertyChanged;

            FromStationSelector.Filter = FromStationFilter;
            ToStationSelector.Filter   = ToStationFilter;

            _resultsList       = new ObservableCollection <TradeJumpDataViewModel>();
            ResultsView        = new ListCollectionView(_resultsList);
            ResultsView.Filter = ResultsViewFilter;

            StartUpdatingCommand = new RelayCommand(StartUpdating);

            MaxDistance           = 500;
            CargoReference        = 4;
            MaximumPrice          = 1000;
            LowerProfitsThreshold = 1;
        }
        internal CommodityDetailsViewModel()
        {
            _sellersList = new ObservableCollection <TradingStationViewModel>();
            _buyersList  = new ObservableCollection <TradingStationViewModel>();
            SellersView  = new ListCollectionView(_sellersList);
            BuyersView   = new ListCollectionView(_buyersList);

            StationSelector = new StationSelectorViewModel()
            {
                UserCanSelectCurrent = true,
            };
        }
Ejemplo n.º 3
0
        public TravelDesignerViewModel()
        {
            ComputeCommand            = new RelayCommand(Compute, CanCompute);
            ShowDetailedResultCommand = new RelayCommand <TravelDetailsViewModel>(ShowDetailedResults);

            StationSelector = new StationSelectorViewModel()
            {
                UserCanSelectAny     = false,
                UserCanSelectCurrent = true,
            };

            StationSelector.SelectCurrent();

            ResultsList = new ObservableCollection <TravelDetailsViewModel>();
            ResultsView = new ListCollectionView(ResultsList);
            ResultsView.SortDescriptions.Add(new SortDescription("AvgProfitPerJump", ListSortDirection.Descending));

            Cargo                 = 4;
            Budget                = 1000;
            MaxJumpsPerTravel     = 4;
            MaxDistanceFromOrigin = 500;
            MaxDistancePerjump    = 10;
        }