我希望当我最小化窗口时,StackPanel保持在它的位置上(保持在顶部,不要向下),同时最小化窗口.
100
问题(GIF格式)
XAML代码
<Grid Padding="25">
<NavigationView PaneDisplayMode="Top">
<NavigationView.MenuItems>
<NavigationViewItem Content="Test" IsSelected="False" Icon="PreviewLink" />
</NavigationView.MenuItems>
<Viewbox StretchDirection="Both" Stretch="Uniform" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Height="1111">
<StackPanel Width="1400" Height="1000" Margin="85, 0, 0, 150">
<Border CornerRadius="25" Background="#1D1D1D" Height="180" Width="300" Margin="-1099, 50, 10, 10">
<Canvas Background="#1D1D1D" Width="250" Height="200" HorizontalAlignment="Left">
<TextBlock FontSize="40" Padding="0, 35, 300, 0" Margin="115, 35, 0, 0" Text="Test"
Foreground="#1D1D1D"
/>
</Canvas>
</Border>
<Border CornerRadius="25" Background="#1D1D1D" Height="180" Width="300" Margin="-420, -190, 10, 10">
<Canvas Opacity="50" Background="#1D1D1D" Width="250" Height="200" HorizontalAlignment="Left">
<TextBlock FontSize="40" Padding="0, 35, 300, 0" Margin="115, 35, 0, 0" Text="Test"
Foreground="#1D1D1D"
/>
</Canvas>
</Border>
<Border CornerRadius="25" Background="#1D1D1D" Height="180" Width="300" Margin="260, -190, 10, 10">
<Canvas Background="#1D1D1D" Width="250" Height="200" HorizontalAlignment="Left">
<TextBlock FontSize="40" Padding="0, 35, 300, 0" Margin="115, 35, 0, 0" Text="Test"
Foreground="#1D1D1D"
/>
</Canvas>
</Border>
<Border CornerRadius="25" Background="#1D1D1D" Height="180" Width="300" Margin="940, -190, 10, 10">
<Canvas Background="#1D1D1D" Width="250" Height="200" HorizontalAlignment="Left">
<TextBlock FontSize="35" Padding="0, 35, 300, 0" Margin="60, 35, 0, 0" Text="Test"
Foreground="#1D1D1D"
/>
</Canvas>
</Border>
</StackPanel>
</Viewbox>
</NavigationView>
</Grid>