이미지를 사용하여 새 UserControl
을 추가하는 창이 있습니다.이 컨트롤을 화면 가운데에 세로 및 가로로 가운데에 배치하기 만하면됩니다. 나는 수직 인물 만 작동시킬 수 있습니다. DockPanel
의 콘텐츠를 내 CodeBehind에서 바꾸고 슬라이드 쇼 UI를 시작하기 전에이 시작 화면을 표시하려고합니다. 이는 콘텐츠가 CodeBehind에서 설정되었음을 의미합니다. 내 Window
WPF 컨트롤 중앙에 넣기
:
<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>
I 최대화/전체 화면을 사용하고 있습니다.
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!-- Replace with your UserControl -->
<Button Content="Foo" Grid.Column="1" Grid.Row="1"/>
</Grid>
당신은 (당신이해야하는 경우 거기에 DockPanel
가) 당신의 DockPanel
스트레칭하는 내부를 고정 할 수 있습니다 :
들으 무리는,이 윈도우 RT – H4mm3rHead
작동합니다. Silverlight 파생물이 더 많습니다. –
XAML 기반의 RT에 스토어 앱을 쓰기 위해 사용되는 프레임 워크 WPF하지 작동하지 않습니다 :-) –