protected override void OnNavigatedTo(NavigationEventArgs e) { if (e.Parameter is EditedFileUploadModel edited) { _model = edited; } }
private async void DoCleanup() { try { var window = CoreWindow.GetForCurrentThread(); window.KeyUp -= OnWindowKeyUp; mediaElement.Source = null; _mediaStreamSource = null; _playTimer?.Stop(); _model = null; _renderTask = null; _tempFile = null; if (ApiInformation.IsTypePresent("Windows.UI.ViewManagement.StatusBar")) { DisplayInformation.AutoRotationPreferences = DisplayOrientations.Portrait; await StatusBar.GetForCurrentView().ShowAsync(); } else { DisplayInformation.AutoRotationPreferences = DisplayOrientations.None; } } catch (Exception ex) { Logger.LogError(ex); } GC.Collect(); }
private void EditButton_Click(object sender, RoutedEventArgs e) { var bigModel = DataContext as ChannelViewModel; var model = (sender as FrameworkElement).DataContext as FileUploadModel; var newModel = new EditedFileUploadModel(model) { Parent = this }; bigModel.FileUploads.Remove(model); bigModel.FileUploads.Add(newModel); this.FindParent <DiscordPage>().OpenCustomPane(typeof(VideoEditor), newModel); }
private void EditButton_Click(object sender, RoutedEventArgs e) { var bigModel = DataContext as ChannelViewModel; var model = (sender as FrameworkElement).DataContext as FileUploadModel; var newModel = new EditedFileUploadModel(model) { Parent = this }; bigModel.FileUploads.Remove(model); bigModel.FileUploads.Add(newModel); OverlayService.GetForCurrentView().ShowOverlay <VideoEditor>(newModel); }
private async void Close() { this.FindParent <DiscordPage>().CloseCustomPane(); mediaElement.Source = null; _mediaStreamSource = null; _playTimer?.Stop(); _model = null; _renderTask = null; _tempFile = null; if (ApiInformation.IsTypePresent("Windows.UI.ViewManagement.StatusBar")) { DisplayInformation.AutoRotationPreferences = DisplayOrientations.Portrait; await StatusBar.GetForCurrentView().ShowAsync(); } DisplayInformation.AutoRotationPreferences = DisplayOrientations.None; GC.Collect(); }
private async void Close() { OverlayService.GetForCurrentView().CloseOverlay(); mediaElement.Source = null; _mediaStreamSource = null; _playTimer?.Stop(); _model = null; _renderTask = null; _tempFile = null; if (ApiInformation.IsTypePresent("Windows.UI.ViewManagement.StatusBar")) { DisplayInformation.AutoRotationPreferences = DisplayOrientations.Portrait; await StatusBar.GetForCurrentView().ShowAsync(); } else { DisplayInformation.AutoRotationPreferences = DisplayOrientations.None; } GC.Collect(); }