i'm beginning in C# and my problem is he following :
I'd like to use a WPF with buttons, textBoxs etc... to control (display informations and videos in) another WPF.
But I can't find how to properly interact with the other WPF.
Code of my WPF windows :
<Window x:Class="WPF_AVC.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:WPF_AVC"
mc:Ignorable="d"
Title="ConfiguratorAVC" Height="350" Width="525">
<Grid Background="Black">
<TextBox x:Name="textBox" HorizontalAlignment="Center" Height="22" Margin="0,48,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="120" Background="Black" BorderBrush="#FF707070" Foreground="#FF707071" SelectionBrush="Black" TextChanged="textBox_TextChanged" KeyDown="OnKeyDownHandler"/>
<TextBlock x:Name="textBlock" HorizontalAlignment="Center" Margin="0,32,0,0" TextWrapping="Wrap" Text="Entrez un mot" VerticalAlignment="Top" Width="120" Foreground="#FF707071" TextAlignment="Center"/>
<Button x:Name="generate_words_btn" Content="Generer hologramme" HorizontalAlignment="Center" Margin="0,76,0,0" VerticalAlignment="Top" Width="120" Background="Black" Foreground="#FF707070" Click="generate_words_btn_Click"/>
<Border Margin="0,267,-0.2,22" HorizontalAlignment="Center">
<Grid>
<Button x:Name="Pay_btn" Content="►" HorizontalAlignment="Center" Margin="0,0,243,0" VerticalAlignment="Top" Width="74" Background="Black" FontWeight="Bold" Foreground="#FF707071" HorizontalContentAlignment="Center" Height="30" Click="Pay_btn_Click" OpacityMask="Black">
<Button.BindingGroup>
<BindingGroup/>
</Button.BindingGroup>
</Button>
<Button x:Name="Stop_btn" Content="■" HorizontalAlignment="Center" Margin="160,0,81,0" VerticalAlignment="Top" Width="76" Background="Black" FontWeight="Bold" Foreground="#FF707071" HorizontalContentAlignment="Center" Height="30" Click="Stop_btn_Click">
<Button.BindingGroup>
<BindingGroup/>
</Button.BindingGroup>
</Button>
<Button x:Name="Pause_btn" Content="❚❚" HorizontalAlignment="Center" Margin="79,0,162,0" VerticalAlignment="Center" Width="76" Background="Black" FontWeight="Bold" Foreground="#FF707071" HorizontalContentAlignment="Center" Height="30" Click="Pause_btn_Click">
<Button.BindingGroup>
<BindingGroup/>
</Button.BindingGroup>
</Button>
<Button x:Name="Open_btn" Content="Open" HorizontalAlignment="Center" Margin="241,0,0,0" VerticalAlignment="Top" Width="76" Background="Black" FontWeight="Bold" Foreground="#FF707071" HorizontalContentAlignment="Center" Height="30" Click="Open_btn_Click" OpacityMask="Black">
<Button.BindingGroup>
<BindingGroup/>
</Button.BindingGroup>
</Button>
</Grid>
</Border>
<ListBox x:Name="listBox" HorizontalAlignment="Left" Height="84" Margin="53,120,0,0" VerticalAlignment="Top" Width="100" Background="Black" BorderBrush="#FF707070">
<ListBoxItem Content="Iron Man" Foreground="#FF707071" Selected="ListBoxItem_Selected"/>
<ListBoxItem Content="Daft Punk" Foreground="#FF707071" Selected="ListBoxItem_Selected_1"/>
<ListBoxItem Content="Link Shield" Foreground="#FF707071" Selected="ListBoxItem_Selected_2"/>
<ListBoxItem Content="Anonymous" Foreground="#FF707071" Selected="ListBoxItem_Selected_3"/>
</ListBox>
</Grid>
<Window x:Name="holoAvcWindow" x:Class="WPF_AVC.DisplaynWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:WPF_AVC"
mc:Ignorable="d"
Title="HoloAVC" Height="950.333" Width="1600" Background="Black" WindowStyle="ToolWindow" SnapsToDevicePixels="True" ResizeMode="NoResize" WindowStartupLocation="CenterScreen" >
<Window.BindingGroup>
<BindingGroup/>
</Window.BindingGroup>
<Grid>
<MediaElement x:Name="mediaElement" HorizontalAlignment="Center" Height="720" Margin="0" VerticalAlignment="Center" Width="1280"/>
<Grid Margin="336,0,336,50">
<MediaElement x:Name="videoDisplayElement" Height="300" VerticalAlignment="Top" Margin="0,311,622,0" RenderTransformOrigin="0.5,0.5" OpacityMask="Black">
<MediaElement.RenderTransform>
<TransformGroup>
<ScaleTransform/>
<SkewTransform/>
<RotateTransform Angle="-90"/>
<TranslateTransform/>
</TransformGroup>
</MediaElement.RenderTransform>
</MediaElement>
<MediaElement x:Name="videoDisplayElement_Copy" HorizontalAlignment="Center" Height="300" Width="300" Margin="311,622,311,0" RenderTransformOrigin="0.5,0.5" OpacityMask="Black" VerticalAlignment="Top">
<MediaElement.RenderTransform>
<TransformGroup>
<ScaleTransform/>
<SkewTransform/>
<RotateTransform Angle="180"/>
<TranslateTransform/>
</TransformGroup>
</MediaElement.RenderTransform>
</MediaElement>
<MediaElement x:Name="videoDisplayElement_Copy1" HorizontalAlignment="Center" Height="300" VerticalAlignment="Top" Width="300" Margin="311,0" OpacityMask="Black"/>
<MediaElement x:Name="videoDisplayElement_Copy2" HorizontalAlignment="Left" Height="300" VerticalAlignment="Top" Width="300" Margin="622,311,0,0" RenderTransformOrigin="0.5,0.5" OpacityMask="Black">
<MediaElement.RenderTransform>
<TransformGroup>
<ScaleTransform/>
<SkewTransform/>
<RotateTransform Angle="+90"/>
<TranslateTransform/>
</TransformGroup>
</MediaElement.RenderTransform>
</MediaElement>
<TextBlock x:Name="textBlock2" HorizontalAlignment="Left" Margin="60,371,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Foreground="White" FontSize="48" Width="300" Height="180" RenderTransformOrigin="0.5,0.5" TextAlignment="Center">
<TextBlock.RenderTransform>
<TransformGroup>
<ScaleTransform/>
<SkewTransform/>
<RotateTransform Angle="-90"/>
<TranslateTransform/>
</TransformGroup>
</TextBlock.RenderTransform>
</TextBlock>
</Grid>
<TextBlock x:Name="textBlock1" HorizontalAlignment="Left" Margin="647,120,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Foreground="White" FontSize="48" Width="300" Height="180" TextAlignment="Center"/>
<TextBlock x:Name="textBlock3" HorizontalAlignment="Left" Margin="898,371,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Foreground="White" FontSize="48" Width="300" Height="180" RenderTransformOrigin="0.5,0.5" TextAlignment="Center">
<TextBlock.RenderTransform>
<TransformGroup>
<ScaleTransform/>
<SkewTransform/>
<RotateTransform Angle="90"/>
<TranslateTransform/>
</TransformGroup>
</TextBlock.RenderTransform>
</TextBlock>
<TextBlock x:Name="textBlock4" HorizontalAlignment="Left" Margin="647,622,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Foreground="White" FontSize="48" Width="300" Height="180
" RenderTransformOrigin="0.5,0.5" TextAlignment="Center">
<TextBlock.RenderTransform>
<TransformGroup>
<ScaleTransform/>
<SkewTransform/>
<RotateTransform Angle="180"/>
<TranslateTransform/>
</TransformGroup>
</TextBlock.RenderTransform>
</TextBlock>
</Grid>
I know that the codes above are not optimised.
I'd like to understand how from an input in the first WPF you can display a video in the second WPF for example.
Thank you !