diff --git a/source/iNKORE.UI.WPF.Modern.Gallery/ControlPages/MediaPlayerElementPage.xaml b/source/iNKORE.UI.WPF.Modern.Gallery/ControlPages/MediaPlayerElementPage.xaml
index f00eeca5..ad261421 100644
--- a/source/iNKORE.UI.WPF.Modern.Gallery/ControlPages/MediaPlayerElementPage.xaml
+++ b/source/iNKORE.UI.WPF.Modern.Gallery/ControlPages/MediaPlayerElementPage.xaml
@@ -21,14 +21,6 @@
Source="{Binding Tag, RelativeSource={RelativeSource Self}, Converter={StaticResource RelativeToAbsoluteConverter}}"
Tag="Assets/SampleMedia/ladybug.wmv" />
-
-
-<ui:MediaPlayerElement Source="/Assets/SampleMedia/ladybug.wmv"
- MaxWidth="400"
- AutoPlay="False"
- AreTransportControlsEnabled="True" />
-
-
@@ -39,13 +31,6 @@
Source="{Binding Tag, RelativeSource={RelativeSource Self}, Converter={StaticResource RelativeToAbsoluteConverter}}"
Tag="Assets/SampleMedia/fishes.wmv" />
-
-
-<ui:MediaPlayerElement Source="/Assets/SampleMedia/fishes.wmv"
- MaxWidth="400"
- AutoPlay="True" />
-
-
diff --git a/source/iNKORE.UI.WPF.Modern.Gallery/ControlPages/MediaPlayerElementPage.xaml.cs b/source/iNKORE.UI.WPF.Modern.Gallery/ControlPages/MediaPlayerElementPage.xaml.cs
index 947bf617..f12159a1 100644
--- a/source/iNKORE.UI.WPF.Modern.Gallery/ControlPages/MediaPlayerElementPage.xaml.cs
+++ b/source/iNKORE.UI.WPF.Modern.Gallery/ControlPages/MediaPlayerElementPage.xaml.cs
@@ -25,15 +25,27 @@ public partial class MediaPlayerElementPage : Page
public MediaPlayerElementPage()
{
InitializeComponent();
+ UpdateExampleCode();
}
#region Example Code
public void UpdateExampleCode()
{
-
+ Example1.Xaml = Example1Xaml;
+ Example2.Xaml = Example2Xaml;
}
+ public string Example1Xaml => $@"
+
+";
+
+ public string Example2Xaml => $@"
+
+";
+
#endregion
}
diff --git a/source/iNKORE.UI.WPF.Modern.Gallery/Controls/SampleCodePresenter.xaml.cs b/source/iNKORE.UI.WPF.Modern.Gallery/Controls/SampleCodePresenter.xaml.cs
index 1069af4e..b27016dd 100644
--- a/source/iNKORE.UI.WPF.Modern.Gallery/Controls/SampleCodePresenter.xaml.cs
+++ b/source/iNKORE.UI.WPF.Modern.Gallery/Controls/SampleCodePresenter.xaml.cs
@@ -247,9 +247,12 @@ private CodeColorizer GenerateRichTextFormatter()
private void CopyCodeButton_Click(object sender, RoutedEventArgs e)
{
- Clipboard.SetText(actualCode);
-
- VisualStateManager.GoToState(this, "ConfirmationDialogVisible", false);
+ try
+ {
+ Clipboard.SetText(actualCode);
+ VisualStateManager.GoToState(this, "ConfirmationDialogVisible", false);
+ }
+ catch { }
// Automatically close teachingtip after 1 seconds
this.RunOnUIThread(async () =>