Skip to content
This repository was archived by the owner on Jun 10, 2024. It is now read-only.

Commit 1b2a428

Browse files
authored
Merge pull request #338 from microsoft/robmikh/removevideolink
Remove link button from Video Playground sample
2 parents da7495d + 54de96f commit 1b2a428

File tree

2 files changed

+4
-54
lines changed

2 files changed

+4
-54
lines changed

SampleGallery/Samples/SDK 14393/VideoPlayground/VideoPlayground.xaml

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -113,22 +113,10 @@
113113
Margin="10, 10, 25, 10">
114114
<!-- Controls to load video. -->
115115
<TextBlock Text="Video Source" Style="{StaticResource VideoPlaygroundText}" />
116-
<Grid>
117-
<Grid.ColumnDefinitions>
118-
<ColumnDefinition Width="*"/>
119-
<ColumnDefinition Width="*"/>
120-
</Grid.ColumnDefinitions>
121-
<Button x:Name="OpenFileButton"
122-
Content="Open File"
123-
Style="{StaticResource VideoPlaygroundButton}"
124-
Command="{Binding OpenFileCommand}"/>
125-
<Button x:Name="OpenUriButton"
126-
Grid.Column="1"
127-
Content="Open Link"
128-
Style="{StaticResource VideoPlaygroundButton}"
129-
Command="{Binding OpenLinkDialogCommand}"
130-
CommandParameter="{Binding ElementName=LinkDialog}"/>
131-
</Grid>
116+
<Button x:Name="OpenFileButton"
117+
Content="Open File"
118+
Style="{StaticResource VideoPlaygroundButton}"
119+
Command="{Binding OpenFileCommand}"/>
132120

133121
<!-- The rest of these controls shouldn't show if there is not video loaded, as
134122
there shouldn't be a current effect assigned until then.-->

SampleGallery/Samples/SDK 14393/VideoPlayground/VideoPlaygroundViewModel.cs

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,6 @@ public LightMode LightMode
184184
public IDelegateCommand AddLightCommand { get; private set; }
185185
public IDelegateCommand RemoveLightCommand { get; private set; }
186186
public IDelegateCommand OpenFileCommand { get; private set; }
187-
public IDelegateCommand OpenLinkDialogCommand { get; private set; }
188-
public IDelegateCommand OpenLinkCommand { get; private set; }
189187
public IDelegateCommand AnimateCommand { get; private set; }
190188
#endregion
191189

@@ -227,8 +225,6 @@ public VideoPlaygroundViewModel(Compositor compositor, Grid videoContentGrid)
227225
RemoveLightCommand = new DelegateCommand(RemoveLightButton);
228226
AnimateCommand = new DelegateCommand(Animate);
229227
OpenFileCommand = new DelegateCommand(OpenFile);
230-
OpenLinkDialogCommand = new DelegateCommand(OpenLinkDialog);
231-
OpenLinkCommand = new DelegateCommand(OpenLink);
232228

233229
DurationIndex = 0;
234230
}
@@ -244,40 +240,6 @@ private void OpenFile(object obj)
244240
LoadFile();
245241
}
246242

247-
/// <summary>
248-
/// Command that shows the given ContentDialog.
249-
/// </summary>
250-
/// <param name="param">The ContentDialog to show.</param>
251-
private async void OpenLinkDialog(object param)
252-
{
253-
var dialog = param as ContentDialog;
254-
255-
if (dialog != null)
256-
{
257-
await dialog.ShowAsync();
258-
}
259-
}
260-
261-
/// <summary>
262-
/// Command that opens the given link as a MediaSource.
263-
/// </summary>
264-
/// <param name="param">String that is a valid Uri.</param>
265-
private void OpenLink(object param)
266-
{
267-
try
268-
{
269-
var link = param as String;
270-
271-
var source = MediaSource.CreateFromUri(new Uri(link));
272-
273-
LoadSource(source);
274-
}
275-
catch(Exception ex)
276-
{
277-
var ignored = ErrorMessage("Video Error", ex.Message);
278-
}
279-
}
280-
281243
/// <summary>
282244
/// Show the file picker UI and returns the given video.
283245
/// </summary>

0 commit comments

Comments
 (0)