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 9219215
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T03:03:42+00:00 2026-06-18T03:03:42+00:00

I have gone through several Q&A here and on different portals but cannot get

  • 0

I have gone through several Q&A here and on different portals but cannot get this working…
My page orientation is Portrait…

    <Rectangle x:Name="videoRectangle" Margin="0,0,0,0">
        <Rectangle.Fill>
            <VideoBrush x:Name="viewfinderBrush" AlignmentX="Left" AlignmentY="Top" Stretch="UniformToFill">
                <VideoBrush.RelativeTransform>
                    <CompositeTransform x:Name="videoBrushTransform" CenterX="0.5" CenterY="0.5" />
                </VideoBrush.RelativeTransform>
            </VideoBrush>
        </Rectangle.Fill>
    </Rectangle>

the code behind ARPage_OrientationChanged never gets invoked

    public ARPage()
    {
        InitializeComponent();

        this.OrientationChanged += ARPage_OrientationChanged;
    }

    void ARPage_OrientationChanged(object sender, OrientationChangedEventArgs e)
    {
        abc.Text = e.Orientation.ToString();

        switch (e.Orientation)
        {
            case PageOrientation.Landscape:
            case PageOrientation.LandscapeLeft:
                videoBrushTransform.Rotation = 0;
                break;
            case PageOrientation.LandscapeRight:
                videoBrushTransform.Rotation = -45;
                break;
            case PageOrientation.Portrait:
            case PageOrientation.PortraitUp:
                videoBrushTransform.Rotation = -270;
                break;
            case PageOrientation.PortraitDown:
                videoBrushTransform.Rotation = -90;
                break;
        }
    }

The video brush always show video in landscape mode…

what i am doing wrong

  • 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-06-18T03:03:43+00:00Added an answer on June 18, 2026 at 3:03 am

    it is not necessary to assign the event in the constructor, you can do this:

    public ARPage()
        {
            InitializeComponent();
        }
    
    
    protected override void OnOrientationChanged(OrientationChangedEventArgs e)
            {
                abc.Text = e.Orientation.ToString();
    
                switch (e.Orientation)
                {
                    case PageOrientation.Landscape:
                    case PageOrientation.LandscapeLeft:
                        videoBrushTransform.Rotation = 0;
                        break;
                    case PageOrientation.LandscapeRight:
                        videoBrushTransform.Rotation = -45;
                        break;
                    case PageOrientation.Portrait:
                    case PageOrientation.PortraitUp:
                        videoBrushTransform.Rotation = -270;
                        break;
                    case PageOrientation.PortraitDown:
                        videoBrushTransform.Rotation = -90;
                        break;
                }
    
                base.OnOrientationChanged(e);
            }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

There are several other questions about this topic that I have gone through, but
Have gone through hibernate api specification on FlushMode but didn't get the exact difference.
I have gone through this page... http://www.php.net/manual/en/function.hash.php MD5 is 32 characters long while sha1
I have gone through the fadein/fadeout tutorial that is on this page: For the
I have gone through most of the code here and tried several ways to
Have gone through several questions on this topic at SO, and am unable to
I have gone through several articles through this stack overflow and other related articles
I have gone through many questions already asked about this problem but i didn't
I have gone through several tutorials on fragments and I can't get my queries
I have gone through Google and Stack Overflow search, but nowhere I was able

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.