0

Hi i just recently found out that you can use components from WPF and add into windows form just by creating them and later adding then into the form as element Host

So what i am trying to do is to create a video player using MediaElement and i also know that you can use Direct X or use Windows Media player for this put i want to custom make some controls in this so here is my question

when i try to add a the media element into my windows form it give me this error enter image description here

here's my code for the mediaelement wpf

<UserControl x:Class="Videoplayer_2._0.MediaPlayer"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:Videoplayer_2._0"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <Grid>
        <MediaElement x:Name="mediaElement" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />

    </Grid>
</UserControl>

So is adding mediaElement just doesn't work or i did something wrong and also i added a WPF slider into the form also just saying because i have no idea if it will affect it or not

Annonymous177
  • 563
  • 2
  • 10
  • 21

1 Answers1

0

You just need to restart Visual Studio I think.

Gopichandar
  • 2,742
  • 2
  • 24
  • 54