private void mediaPlayerView_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            int counter = 0;

            if (mediaPlayerView.HasVideo)
            {
                if (e.ClickCount == 2 && counter == 0 && (Taskbar.WindowFullscreenTaskbar.IsMaximize == false))
                {
                    counter = 1;

                    if (this.WindowState == WindowState.Normal)
                    {
                        this.WindowState = WindowState.Maximized;
                    }

                    if (this.WindowState == WindowState.Maximized)
                    {
                        if (this.WindowStyle == WindowStyle.SingleBorderWindow)
                        {
                            this.WindowStyle = WindowStyle.None;
                        }

                        if (m_MainMenu.IsVisible == true)
                        {
                            m_MainMenu.Visibility = Visibility.Hidden;
                        }

                        if (playButton.IsVisible == true)
                        {
                            playButton.Visibility = Visibility.Hidden;
                        }

                        if (pauseButton.IsVisible == true)
                        {
                            pauseButton.Visibility = Visibility.Hidden;
                        }

                        if (stopButton.IsVisible == true)
                        {
                            stopButton.Visibility = Visibility.Hidden;
                        }

                        if (loopButton.IsVisible == true)
                        {
                            loopButton.Visibility = Visibility.Hidden;
                        }

                        if (fullscreenButton.IsVisible == true)
                        {
                            fullscreenButton.Visibility = Visibility.Hidden;
                        }

                        if (muteButton.IsVisible == true)
                        {
                            muteButton.Visibility = Visibility.Hidden;
                        }

                        if (durationBar.IsVisible == true)
                        {
                            durationBar.Visibility = Visibility.Hidden;
                        }

                        if (volumeBar.IsVisible == true)
                        {
                            volumeBar.Visibility = Visibility.Hidden;
                        }

                        Taskbar.WindowFullscreenTaskbar.IsMaximize = true;

                        mediaPlayerView.Stretch = Stretch.Fill;
                        mediaPlayerView.Margin  = new Thickness(0D, 0D, 0D, 0D);

                        if (Taskbar.WindowFullscreenTaskbar.IsMaximize == true)
                        {
                            handle = new WindowInteropHelper(this).Handle;

                            Taskbar.SetCustomWinFullScreen(
                                handle,
                                mediaPlayerView.NaturalVideoWidth,
                                mediaPlayerView.NaturalVideoHeight
                                );
                        }

                        this.Topmost = true;
                    }
                }
                else if (e.ClickCount == 2)
                {
                    {
                        Taskbar.WindowFullscreenTaskbar.IsMaximize = false;

                        if (Taskbar.WindowFullscreenTaskbar.IsMaximize == false)
                        {
                            handle = new WindowInteropHelper(this).Handle;
                            Taskbar.SetCustomWinFullScreen(
                                handle,
                                mediaPlayerView.NaturalVideoWidth,
                                mediaPlayerView.NaturalVideoHeight
                                );
                        }
                    }

                    if (this.WindowStyle == WindowStyle.None)
                    {
                        this.WindowStyle = WindowStyle.SingleBorderWindow;
                    }

                    if (this.WindowState == WindowState.Maximized)
                    {
                        if (m_MainMenu.IsVisible == false)
                        {
                            m_MainMenu.Visibility = Visibility.Visible;
                        }

                        if (playButton.IsVisible == false)
                        {
                            playButton.Visibility = Visibility.Visible;
                        }

                        if (pauseButton.IsVisible == false)
                        {
                            pauseButton.Visibility = Visibility.Visible;
                        }

                        if (stopButton.IsVisible == false)
                        {
                            stopButton.Visibility = Visibility.Visible;
                        }

                        if (loopButton.IsVisible == false)
                        {
                            loopButton.Visibility = Visibility.Visible;
                        }

                        if (fullscreenButton.IsVisible == false)
                        {
                            fullscreenButton.Visibility = Visibility.Visible;
                        }

                        if (muteButton.IsVisible == false)
                        {
                            muteButton.Visibility = Visibility.Visible;
                        }

                        if (durationBar.IsVisible == false)
                        {
                            durationBar.Visibility = Visibility.Visible;
                        }

                        if (volumeBar.IsVisible == false)
                        {
                            volumeBar.Visibility = Visibility.Visible;
                        }

                        Taskbar.WindowFullscreenTaskbar.IsMaximize = false;

                        mediaPlayerView.Stretch = Stretch.Uniform;
                        mediaPlayerView.Margin  = new Thickness(0D, 22D, 0D, 60D);

                        if (Taskbar.WindowFullscreenTaskbar.IsMaximize == false)
                        {
                            handle = new WindowInteropHelper(this).Handle;
                            Taskbar.SetCustomWinFullScreen(
                                handle,
                                mediaPlayerView.NaturalVideoWidth,
                                mediaPlayerView.NaturalVideoHeight
                                );
                        }

                        this.WindowState = WindowState.Normal;
                        this.Width       = 800;
                        this.Height      = 450;
                        this.Topmost     = true;
                    }

                    counter = 0;
                }
            }
        }
        private void fullscreenButton_Click(object sender, RoutedEventArgs e)
        {
            if (this.WindowState == WindowState.Normal)
            {
                this.WindowState = WindowState.Maximized;
            }

            if (this.WindowState == WindowState.Maximized)
            {
                if (this.WindowStyle == WindowStyle.SingleBorderWindow)
                {
                    this.WindowStyle = WindowStyle.None;
                }

                if (m_MainMenu.IsVisible == true)
                {
                    m_MainMenu.Visibility = Visibility.Hidden;
                }

                if (playButton.IsVisible == true)
                {
                    playButton.Visibility = Visibility.Hidden;
                }

                if (pauseButton.IsVisible == true)
                {
                    pauseButton.Visibility = Visibility.Hidden;
                }

                if (stopButton.IsVisible == true)
                {
                    stopButton.Visibility = Visibility.Hidden;
                }

                if (loopButton.IsVisible == true)
                {
                    loopButton.Visibility = Visibility.Hidden;
                }

                if (fullscreenButton.IsVisible == true)
                {
                    fullscreenButton.Visibility = Visibility.Hidden;
                }

                if (muteButton.IsVisible == true)
                {
                    muteButton.Visibility = Visibility.Hidden;
                }

                if (durationBar.IsVisible == true)
                {
                    durationBar.Visibility = Visibility.Hidden;
                }

                if (volumeBar.IsVisible == true)
                {
                    volumeBar.Visibility = Visibility.Hidden;
                }

                Taskbar.WindowFullscreenTaskbar.IsMaximize = true;

                mediaPlayerView.Margin = new Thickness(0D, 0D, 0D, 0D);

                if (mediaPlayerView.HasVideo)
                {
                    if (Taskbar.WindowFullscreenTaskbar.IsMaximize)
                    {
                        mediaPlayerView.Stretch = Stretch.Uniform;
                        handle = new WindowInteropHelper(this).Handle;

                        Taskbar.SetCustomWinFullScreen(
                            handle,
                            mediaPlayerView.NaturalVideoWidth,
                            mediaPlayerView.NaturalVideoHeight
                            );
                    }
                }

                this.Topmost = true;
            }
        }