protected override void OnInitialize()
        {
            base.OnInitialize();

            var musicFileContext = Container.GetExportedValue<MockMusicFileContext>();
            musicFiles = new ObservableCollection<MusicFile>()
            {
               musicFileContext.Create(@"C:\Users\Public\Music\Dancefloor\Culture Beat - Serenity.wav"),
               musicFileContext.Create(@"C:\Culture Beat - Serenity - Epilog.wma"),
            };
            selectionService = Container.GetExportedValue<SelectionService>();
            selectionService.Initialize(musicFiles);
            
            playlistManager = new PlaylistManager();
            playlistSettings = new PlaylistSettings();
            controller = Container.GetExportedValue<PlayerController>();
            controller.PlaylistSettings = playlistSettings;
            controller.PlaylistManager = playlistManager;
            controller.Initialize();

            shellService = Container.GetExportedValue<ShellService>();
            shellService.ShowPlaylistViewAction = () => { };
            view = (MockPlayerView)shellService.PlayerView;
            viewModel = ViewHelper.GetViewModel<PlayerViewModel>(view);
        }
Example #2
0
        public PvPViewModel()
        {
            CurrentViewModel = new PlayerViewModel();
            NavigationCommand = new RelayCommand<string>(OnNavigation);

            PlayerDisplayName = "SKT Marin";
        }
 public PlayerDiagnostics(PlayerViewModel playerViewModel, AssetViewerViewModel assetViewerViewModel, BaseShellViewModel shellViewModel, ISettingsService settingsService, ScriptBridge scriptBridge)
 {
     EventHandler<ViewAttachedEventArgs> handler = null;
     this._playerViewModel = playerViewModel;
     this._assetViewerViewModel = assetViewerViewModel;
     this._baseShellViewModel = shellViewModel;
     this._settingsService = settingsService;
     if (handler == null)
     {
         handler = delegate (object s, ViewAttachedEventArgs e) {
             this._bufferingTimeMonitor = new BufferingTimeMonitor(this._playerViewModel.Instance);
             this._videoPlayer = this._playerViewModel.Instance;
         };
     }
     this._playerViewModel.ViewAttached += handler;
     this._playerViewModel.PropertyChanged += new PropertyChangedEventHandler(this._playerViewModel_PropertyChanged);
 }
        public ActionResult Index()
        {
            List<PlayerViewModel> players = new List<PlayerViewModel>();
            StockEngine engine = new YahooStockEngine();

            // Chris
            Player player = new Chris();
            Investment investment = engine.GetCurrentInvestmentForPlayer(player.Name);
            Quote quote = engine.GetCurrentQuoteForPlayer(player.Name);
            PlayerViewModel model = new PlayerViewModel(investment, quote, player);
            players.Add(model);

            // Fiona
            player = new Fiona();
            investment = engine.GetCurrentInvestmentForPlayer(player.Name);
            quote = engine.GetCurrentQuoteForPlayer(player.Name);
            model = new PlayerViewModel(investment, quote, player);
            players.Add(model);

            // Wilson
            player = new Wilson();
            investment = engine.GetCurrentInvestmentForPlayer(player.Name);
            quote = engine.GetCurrentQuoteForPlayer(player.Name);
            model = new PlayerViewModel(investment, quote, player);
            players.Add(model);

            // Katherine
            player = new Katherine();
            investment = engine.GetCurrentInvestmentForPlayer(player.Name);
            quote = engine.GetCurrentQuoteForPlayer(player.Name);
            model = new PlayerViewModel(investment, quote, player);
            players.Add(model);

            // Jon
            player = new Jon();
            investment = engine.GetCurrentInvestmentForPlayer(player.Name);
            quote = engine.GetCurrentQuoteForPlayer(player.Name);
            model = new PlayerViewModel(investment, quote, player);
            players.Add(model);

            return View(players);
        }
Example #5
0
        /// <summary>
        ///     Initializes a new instance of the MainViewModel class.
        /// </summary>
        /// <param name="collectionService">
        ///     The collection service.
        /// </param>
        /// <param name="service">
        ///     The service.
        /// </param>
        /// <param name="spotify">
        ///     The spotify.
        /// </param>
        /// <param name="audioticaService">
        ///     The audiotica service.
        /// </param>
        /// <param name="audioPlayer">
        ///     The audio player.
        /// </param>
        /// <param name="playerViewModel"></param>
        public MainViewModel(
            ICollectionService collectionService,
            IScrobblerService service,
            ISpotifyService spotify,
            IAudioticaService audioticaService,
            AudioPlayerHelper audioPlayer,
            PlayerViewModel playerViewModel)
        {
            PlayerViewModel = playerViewModel;
            _collectionService = collectionService;
            _service = service;
            _spotify = spotify;
            _audioticaService = audioticaService;
            _audioPlayer = audioPlayer;
            _collectionService.LibraryLoaded += CollectionServiceOnLibraryLoaded;
            _audioPlayer.TrackChanged += CollectionServiceOnLibraryLoaded;

            // Load data automatically
            LoadChartDataAsync();
        }
Example #6
0
 private void OnNavigation(string destination)
 {
     switch (destination)
     {
         case "play":
             CurrentViewModel = new PlayViewModel();
             break;
         case "player":
             CurrentViewModel = new PlayerViewModel();
             break;
         case "customize":
             CurrentViewModel = new CustomizeViewModel();
             break;
         case "statistics":
             CurrentViewModel = new StatisticsViewModel();
             break;
         default:
             throw new ArgumentException($"Failed to navigate to '{destination}', the destination was not recognized");
     }
 }
        protected async override void OnNavigatedTo(NavigationEventArgs e)
        {
            ViewModel = new PlayerViewModel();

            await ViewModel.StartListeningAsync();

            Frame rootFrame = Window.Current.Content as Frame;

            if (rootFrame.CanGoBack)
            {
                // Show UI in title bar if opted-in and in-app backstack is not empty.
                SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility =
                    AppViewBackButtonVisibility.Visible;
            }
            else
            {
                // Remove the UI from the title bar if in-app back stack is empty.
                SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility =
                    AppViewBackButtonVisibility.Collapsed;
            }
        }
 public OnlineProfileViewModel(PhotoSelectorViewModel photoSelectorViewModel, AccountManager accountManager)
 {
     _photoSelectorViewModel = photoSelectorViewModel;
     _accountManager = accountManager;
     Player = new PlayerViewModel(accountManager.CurrentUser);
 }
 public void UpdateUI()
 {
     Application.Current.Dispatcher.BeginInvoke(
       DispatcherPriority.Background,
       new Action(() =>
       {
           var data = PokerGameObject.GetData();
           if (!data.Players.Any())
           {
               return;
           }
           ViewModel.Players.Clear();
           data.Players.Select(x =>
           {
               var p = new PlayerViewModel()
               {
                   Name = x.Name,
                   IsActive = x == data.ActivePlayer,
                   Money = x.Wallet.Money
               };
               var bet = data.Bets.FirstOrDefault(b => b.Player == x);
               if (bet != null)
               {
                   p.CurrentBet = bet.Amount;
               }
               if (x.Cards.Any())
               {
                   p.Cards = new ObservableCollection<StandartCard>(x.Cards);
               }
               return p;
           }).ToList().ForEach(x => ViewModel.Players.Add(x));
           ViewModel.Pot = data.Pot;
           ViewModel.DealerCards = new ObservableCollection<StandartCard>(data.DealerCards);
           ViewModel.RaiseAmount = 0;
       }));
 }
Example #10
0
 public ItemBoughtEventArgs(CardViewModel purchasedCardID, PlayerViewModel purchasingPlayer)
 {
     this.PurchasedCard = purchasedCardID;
     this.PurchasingPlayer = purchasingPlayer;
 }