Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6831619
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:45:31+00:00 2026-05-26T22:45:31+00:00

I have a popup that is a ChildWindow. Inside that popup I have a

  • 0

I have a popup that is a ChildWindow. Inside that popup I have a UserControl (MediaPreviewView) that has a MediaElement and some buttons to control the video. My requirements state that I need a fullscreen button and show the video fullscreen when the user clicks on the button.

I’m using MVVM, so I decided to try this with Messaging in the MVVM Light. I’m sending a message to my base View. Inside that View’s codebehind, I’m showing a Grid (hidden and at the bottom of the XAML, with a high zindex). My message contains the MediaPreviewControl and I’m setting the Grid.Children.Add( to the control. I’ve tried multiple things, and can get the ChildWindow to be invisible, but the buttons don’t work. It seems that the ChildWindow is still on top of the buttons, even though the width and height was 0.
Is there a better a workable approach to making my MediaPreviewView fullscreen?

public class MediaPreviewFullScreenMessage
{
    public MediaPreviewView PreviewView { get; set; }
    public ChildWindow ContainerChildWindow { get; set; }
    public bool ChangeToFullScreen { get; set; }
}

// Register for FullScreen media preview
Messenger.Default.Register<MediaPreviewFullScreenMessage>(this,
(fullScreenMessage) =>
{
  this.fullScreenHolderGrid.Visibility = fullScreenMessage.ChangeToFullScreen ? Visibility.Visible : Visibility.Collapsed;
  this.fullScreenHolderGrid.Children.Clear();
  if (fullScreenMessage.ChangeToFullScreen)
  {
// I've tried, Visibility, width and height = 0 on the fullScreenMessage.ContainerChildWindow, even a TranslateTransform
....
}
});
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T22:45:31+00:00Added an answer on May 26, 2026 at 10:45 pm

    How about just simply maximising the ChildWindow? Behind your full screen Button you do,

        private void FullScreenButton_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            // get the explorer window size
            double height = App.Current.Host.Content.ActualHeight;
            double width = App.Current.Host.Content.ActualWidth;
    
            // need to make it a little bit smaller or it won't resize
            this.Height = height - 1;
            this.Width = width - 1;
    
            // need to update the layout here
            this.UpdateLayout();
    
            // the following code repositions the child window
            var root = VisualTreeHelper.GetChild(this, 0) as FrameworkElement;
            if (root == null)
            {
                return;
            }
    
            var contentRoot = root.FindName("ContentRoot") as FrameworkElement;
            if (contentRoot == null)
            {
                return;
            }
    
            var group = contentRoot.RenderTransform as TransformGroup;
            if (group == null)
            {
                return;
            }
    
            TranslateTransform translateTransform = null;
            foreach (var transform in group.Children.OfType<TranslateTransform>())
            {
                translateTransform = transform;
            }
    
            if (translateTransform == null)
            {
                return;
            }
    
            // reset transform
            translateTransform.X = 0.0;
            translateTransform.Y = 0.0;
        }
    

    UPDATE

    In the ChildWindow‘s default style, it has this Grid called ContentRoot which sets the position of the ChildWindow by RenderTransform. That’s why you need to reset the TranslateX and TranslateY to make it top left.

                            <Grid x:Name="ContentRoot" HorizontalAlignment="{TemplateBinding HorizontalAlignment}" Height="{TemplateBinding Height}" RenderTransformOrigin="0.5,0.5" VerticalAlignment="{TemplateBinding VerticalAlignment}" Width="{TemplateBinding Width}">
                                <Grid.RenderTransform>
                                    <TransformGroup>
                                        <ScaleTransform/>
                                        <SkewTransform/>
                                        <RotateTransform/>
                                        <TranslateTransform/>
                                    </TransformGroup>
                                </Grid.RenderTransform>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a popup that has two buttons. How to avoid the scenario where
I have a popup menu that has a few items in it. Option 1
I have a modal popup with several links inside that have the :confirm and
I have a container that is a popup over a page and it has
I have some problems with ChildWindow control, I have created an error window control
I have a WPF Popup that has several controls in it. The user can
I have a popup that contains a TabNavigator control. The tabs are dynamically added
I have a box popup that appears on mouseover for some links. The box
I have a Popup control that I added a thumb to so I can
I have a web page that also has a popup where the user can

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.