Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. WPF
  4. How to set the youtube player location fix in a xaml page, its getting on the botton of the page ...instead of the right position.

How to set the youtube player location fix in a xaml page, its getting on the botton of the page ...instead of the right position.

Scheduled Pinned Locked Moved WPF
helpwpftutorial
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Ch Gayatri Subudhi
    wrote on last edited by
    #1

    Hi, I took a class for youtube player and create a instance of that youtube player in Page3.xaml page..The issue is at runtime (F5), in the application i got the youtube video in the bottom of the page and even its there for each and every xaml pae while i am navigating..how to resolve this issue for setting the youtube video exact position where i want and stop reflecting to other pages .The code is as below: in Class1.cs -------------

    using System;
    using System.Collections.Generic;
    using System.Text;
    using System.Windows;
    using System.Windows.Controls;
    using System.Windows.Data;
    using System.Windows.Documents;
    using System.Windows.Input;
    using System.Windows.Media;
    using System.Windows.Media.Imaging;
    using System.Windows.Shapes;
    using System.Windows.Media.Animation;
    using System.Windows.Browser;

    namespace K12
    {

    		public class YouTubePlayer : IDisposable
    {
    
        /// <summary>
        /// The default with of a player, if none is specified.
        /// </summary>
        public const int DefaultWidth = 425;
    
        /// <summary>
        /// The default height of a player, if none is specified.
        /// </summary>
        public const int DefaultHeight = 344;
    
        #region Private properties
        private string uniqueId = Guid.NewGuid().ToString();
    
        private double top;
        private double left;
        private double height = DefaultHeight;
        private double width = DefaultWidth;
    
        private string videoId;
        private bool isEmbeded;
        private HtmlElement div;
        #endregion
    
        /// <summary>
        /// Creates a player for the given video id. You must invoke Embed()
        /// later, to actually insert the video into the page.
        /// </summary>
        /// <param name="videoId"></param>
        public YouTubePlayer(string videoId)
        {
            this.videoId = videoId;
        }
    
        /// <summary>
        /// The absolute y position of this player.
        /// </summary>
        public double Top
        {
            get { return top; }
            set
            {
                top = value;
    
                if (isEmbeded)
                {
                    SetStyleProperty(DivId, "top", "\\"" + (int)top + "px\\"");
                }
            }
        }
    
        /// <summary>
        /// The absolute x position of this player.
        /// </summary>
        public double L
    
    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups