新しいものを(画像付きで)追加するウィンドウがあります。UserControl
コントロールを画面の中央(垂直方向と水平方向の両方)に配置したいだけです。私は垂直のものしか動作させられません。CodeBehindのコンテンツをスワップしDockPanel
、スライドショー UI を開始する前にこの起動画面を表示したいと考えています。これは、コンテンツが CodeBehind から設定されていることを意味します。
私のWindow
:
<Window x:Class="GreenWebPlayerWPF.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1" Height="512" Width="853" WindowStyle="None" WindowState="Maximized" WindowStartupLocation="CenterScreen">
<DockPanel Width="Auto" Height="Auto" Name="TransitionContainer" Background="Black" Margin="0" LastChildFill="True"></DockPanel>
</Window>
私のUserControl
:
<UserControl x:Class="GreenWebPlayerWPF.FrontPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<DockPanel Background="Black">
<Image Name="image1" Stretch="None" Source="/GreenWebPlayerWPF;component/gw.png" />
</DockPanel>
</UserControl>
最大化/フルスクリーンを使用していることに注意してください。