public PictureViewContent(FrameworkElement sourceControl, Picture preview, Photo photo) { InitializeComponent(); PropertiesBackKeyAction = new Action(() => OnCloseDetailsButtonClicked(this, new RoutedEventArgs())); SourceControl = sourceControl; SourceControl.Opacity = 0; Context = new ContentContext(photo); if (photo.Original is IPictureStreamReadinessInformation) { PictureReadiness = (IPictureStreamReadinessInformation)photo.Original; PictureReadiness.Ready += OnPictureReady; } PicturePreviewControl.SetValue(PictureLoader.SourceProperty, preview); PictureControl.SetValue(PictureLoader.SourceProperty, photo.Original); Transition = new ContinuumTransition(); SizeChanged += OnSizeChanged; }
private async void OnPictureReady(IPictureStreamReadinessInformation sender, IRandomAccessStream stream) { PictureStream = stream; await App.Dispatcher.RunAsync(() => SaveButton.IsEnabled = true); }