private void TvView_NavigationStarting(WebView sender, WebViewNavigationStartingEventArgs args) { TvView.NavigationStarting -= TvView_NavigationStarting; // WebView native object must be inserted in the OnNavigationStarting event handler Handler winRTObject = new Handler(); // Expose the native WinRT object on the page's global object TvView.AddWebAllowedObject("NotifyApp", winRTObject); }
public TeamEditorController(TvView tvView, ShipDetailsView shipDetailsView, Stack <ICommand> undoStack) { _tvView = tvView; _tvView.OnShipSelected += _tvView_OnShipSelected; _shipDetailsView = shipDetailsView; _shipDetailsView.ShipNameChanged += shipNameChanged; _undoStack = undoStack; _tvView.OnDeleteCrewDeck += _tvView_OnDeleteCrewDeck; _tvView.OnDeleteEngine += _tvView_OnDeleteEngine; _tvView.OnDeleteReactor += _tvView_OnDeleteReactor; _tvView.OnDeleteShield += _tvView_OnDeleteShield; _tvView.OnDeleteWeapon += _tvView_OnDeleteWeapon; }
public MainWindow() { InitializeComponent(); Title = DEFAULT_TITLE; TvView tview = new TvView(treeView); DataContext = this; InputBindings.Add(new KeyBinding(new ActionCommand(() => OnUndo(this, null)), Key.Z, ModifierKeys.Control)); _tvController = new TeamEditorController( tview, new ShipDetails.ShipDetailsView( new TeamEditor.ShipDetails.ShipDetailsViewContext() { ShipStatsDataGrid = shipDetailsStatsGrid, ShipNameTextBox = shipDetailsShipName }), _undoStack); }
private async void TvView_NavigationCompleted(WebView sender, WebViewNavigationCompletedEventArgs args) { TvView.NavigationCompleted -= TvView_NavigationCompleted; // Get HTML Content var html = await TvView.InvokeScriptAsync("eval", new[] { "document.documentElement.innerHTML" }); // Retrieve video source var splitted = html.Split(new[] { "iframe src=" }, StringSplitOptions.RemoveEmptyEntries); var last = splitted[1].Trim().Split('"'); var source = last[1]; TvView.Visibility = Visibility.Collapsed; TvView.Stop(); MainGrid.Children.Remove(TvView); GC.Collect(); TvView.Source = new Uri("http://Miriot.suismoi.fr", UriKind.Absolute); if (_cachedUrls.ContainsKey(_currentChannelKey)) { _cachedUrls[_currentChannelKey] = source; } else { _cachedUrls.Add(_currentChannelKey, source); } try { var vm = SimpleIoc.Default.GetInstance <MainViewModel>(); //vm.User.UserData.CachedTvUrls = _cachedUrls; //Task.Run(async () => await vm.UpdatePersonAsync()); } catch (Exception) { // To be removed } LoadStream(source); }
private void LoadAllShowsViewModel(TvView view) { IEnumerable<string> images = view.ShowsItems.Take(1).Select(i => _apiClient.GetImageUrl(i.Id, new ImageOptions { ImageType = i.ImageType, Tag = i.ImageTag, Height = Convert.ToInt32(HomeViewModel.TileWidth*2), EnableImageEnhancers = false })); AllShowsImagesViewModel.Images.AddRange(images); AllShowsImagesViewModel.StartRotating(); }
private void LoadSpotlightViewModel(TvView view) { SpotlightViewModel.Items = view.SpotlightItems; }
private void LoadMiniSpotlightsViewModel(TvView view) { BaseItemDto[] items = view.MiniSpotlights.Take(3).ToArray(); for (int i = 0; i < items.Length; i++) { if (MiniSpotlightItems.Count > i) { MiniSpotlightItems[i].Item = items[i]; } else { ItemTileViewModel vm = CreateMiniSpotlightItem(); vm.Item = items[i]; MiniSpotlightItems.Add(vm); } } if (MiniSpotlightItems.Count > items.Length) { List<ItemTileViewModel> toRemove = MiniSpotlightItems.Skip(items.Length).ToList(); MiniSpotlightItems.RemoveRange(toRemove); } }