Merge pull request #338 from microsoft/robmikh/removevideolink

Remove link button from Video Playground sample
This commit is contained in:
Robert Mikhayelyan 2019-09-05 10:15:45 -07:00 коммит произвёл GitHub
Родитель da7495d96d 54de96f4ae
Коммит 1b2a428d28
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 4 добавлений и 54 удалений

Просмотреть файл

@ -113,22 +113,10 @@
Margin="10, 10, 25, 10">
<!-- Controls to load video. -->
<TextBlock Text="Video Source" Style="{StaticResource VideoPlaygroundText}" />
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Button x:Name="OpenFileButton"
Content="Open File"
Style="{StaticResource VideoPlaygroundButton}"
Command="{Binding OpenFileCommand}"/>
<Button x:Name="OpenUriButton"
Grid.Column="1"
Content="Open Link"
Style="{StaticResource VideoPlaygroundButton}"
Command="{Binding OpenLinkDialogCommand}"
CommandParameter="{Binding ElementName=LinkDialog}"/>
</Grid>
<Button x:Name="OpenFileButton"
Content="Open File"
Style="{StaticResource VideoPlaygroundButton}"
Command="{Binding OpenFileCommand}"/>
<!-- The rest of these controls shouldn't show if there is not video loaded, as
there shouldn't be a current effect assigned until then.-->

Просмотреть файл

@ -184,8 +184,6 @@ namespace CompositionSampleGallery
public IDelegateCommand AddLightCommand { get; private set; }
public IDelegateCommand RemoveLightCommand { get; private set; }
public IDelegateCommand OpenFileCommand { get; private set; }
public IDelegateCommand OpenLinkDialogCommand { get; private set; }
public IDelegateCommand OpenLinkCommand { get; private set; }
public IDelegateCommand AnimateCommand { get; private set; }
#endregion
@ -227,8 +225,6 @@ namespace CompositionSampleGallery
RemoveLightCommand = new DelegateCommand(RemoveLightButton);
AnimateCommand = new DelegateCommand(Animate);
OpenFileCommand = new DelegateCommand(OpenFile);
OpenLinkDialogCommand = new DelegateCommand(OpenLinkDialog);
OpenLinkCommand = new DelegateCommand(OpenLink);
DurationIndex = 0;
}
@ -244,40 +240,6 @@ namespace CompositionSampleGallery
LoadFile();
}
/// <summary>
/// Command that shows the given ContentDialog.
/// </summary>
/// <param name="param">The ContentDialog to show.</param>
private async void OpenLinkDialog(object param)
{
var dialog = param as ContentDialog;
if (dialog != null)
{
await dialog.ShowAsync();
}
}
/// <summary>
/// Command that opens the given link as a MediaSource.
/// </summary>
/// <param name="param">String that is a valid Uri.</param>
private void OpenLink(object param)
{
try
{
var link = param as String;
var source = MediaSource.CreateFromUri(new Uri(link));
LoadSource(source);
}
catch(Exception ex)
{
var ignored = ErrorMessage("Video Error", ex.Message);
}
}
/// <summary>
/// Show the file picker UI and returns the given video.
/// </summary>