Note that there are some explanatory texts on larger screens.

plurals
  1. POZooming in specific part of screen in WPF
    primarykey
    data
    text
    <p>I am implementing one small WPF application which has multiple rows and multiple columns. 0th row and 0th column contains a MediaElement and 1st row and 0th column contains a full screen button. When user clicks on full screen button I want to switch to a gird which has only two rows and one column. 0th row and 0th column will occupy most of the screen space having inside MediaElement and 1st row and 0th column will show a minimize button which will bring original UI back. In traditional windows we were used to toggle visibility of a full screen panel hosting WindowsMedia player to achieve this behavior. How can I achieve this in WPF?</p> <p>Adding my XAML code.</p> <pre><code>&lt;Window x:Class="LearnEnglish.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="350" Width="525"&gt; &lt;Grid&gt; &lt;Grid.RowDefinitions&gt; &lt;RowDefinition Height="5*" /&gt; &lt;RowDefinition Height="1*" /&gt; &lt;/Grid.RowDefinitions&gt; &lt;Grid.ColumnDefinitions&gt; &lt;ColumnDefinition Width="5*" /&gt; &lt;ColumnDefinition Width="2*" /&gt; &lt;ColumnDefinition Width="2*" /&gt; &lt;ColumnDefinition Width="1*" /&gt; &lt;/Grid.ColumnDefinitions&gt; &lt;MediaElement LoadedBehavior="Manual" Name="me" Source="C:\Users\Pritam\Documents\Freecorder\Screen\Northern Ireland Scene 1 LearnEnglish British Council.wmv" Volume="{Binding ElementName=txtVolume,Path=Text}" Grid.ColumnSpan="2"&gt; &lt;/MediaElement&gt; &lt;Button Click="Button_Click" Grid.Row="1" Margin="4"&gt;Play&lt;/Button&gt; &lt;Button Click="Button_Click" Grid.Row="1" Grid.Column="1" Margin="4"&gt;Full Screen&lt;/Button&gt; &lt;Button Click="Button_Click" Grid.Row="1" Grid.Column="1" Margin="4" Visibility="Hidden"&gt;Restore&lt;/Button&gt; &lt;/Grid&gt; &lt;/Window&gt; </code></pre> <p>When user clicks on 'Full Screen' button I want my 'MediaElement' to occupy most of the scree space ( by hiding all other controls ) and leaving 'Restore' button in the bottom-right hand side of screen. </p> <p>Regards, Hemant</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload