Zuerst ist hier meine XAML-Markup (ModifySpDefaultValues.xaml) erhalten sehen:Kann nicht das Layout rechts (WPF)
<Page x:Class="EMS_WPF_Test.ModifySpDefaultValues"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:EMS_WPF_Test"
mc:Ignorable="d" d:DesignWidth="360" Title="ModifyPvDefaultValues" Style="{DynamicResource Form}" d:DesignHeight="360" MinHeight="360" MinWidth="360">
<ScrollViewer Margin="10" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
<DockPanel>
<StackPanel DockPanel.Dock="Left">
<Label Content="Min/max" Style="{DynamicResource Label}"/>
<Label Content="Minimum allowed sp:" Style="{DynamicResource Label}"/>
<Label Content="Maximum allowed sp:" Style="{DynamicResource Label}"/>
<Label Style="{DynamicResource Label}"/>
<Label Content="Alarm values" Style="{DynamicResource Label}"/>
<Label Content="Period:" Style="{DynamicResource Label}"/>
<Label Content="Min Pv:" Style="{DynamicResource Label}"/>
<Label Content="Max Pv:" Style="{DynamicResource Label}"/>
<Label Style="{DynamicResource Label}"/>
<Label Content="Local setpoint" Style="{DynamicResource Label}"/>
<Label Content="Default setpoint:" Style="{DynamicResource Label}"/>
<Label Style="{DynamicResource Label}"/>
<Label Content="External setpoint" Style="{DynamicResource Label}"/>
<Label Content="Sp addition:" Style="{DynamicResource Label}"/>
<Label Content="Default manual setpoint:" Style="{DynamicResource Label}"/>
<Label Style="{DynamicResource Label}"/>
<Label x:Name="GoBack" Content="Back" Style="{DynamicResource Hyperlink}" MouseLeftButtonUp="GoBack_MouseLeftButtonUp"/>
</StackPanel>
<StackPanel DockPanel.Dock="Right">
<Label Style="{DynamicResource Label}"/>
<Label Content="What's this?" Style="{DynamicResource Hyperlink}"/>
<Label Content="What's this?" Style="{DynamicResource Hyperlink}"/>
<Label Style="{DynamicResource Label}"/>
<Label Style="{DynamicResource Label}"/>
<Label Content="What's this?" Style="{DynamicResource Hyperlink}"/>
<Label Content="What's this?" Style="{DynamicResource Hyperlink}"/>
<Label Content="What's this?" Style="{DynamicResource Hyperlink}"/>
<Label Style="{DynamicResource Label}"/>
<Label Style="{DynamicResource Label}"/>
<Label Content="What's this?" Style="{DynamicResource Hyperlink}"/>
<Label Style="{DynamicResource Label}"/>
<Label Style="{DynamicResource Label}"/>
<Label Content="What's this?" Style="{DynamicResource Hyperlink}"/>
<Label Content="What's this?" Style="{DynamicResource Hyperlink}"/>
</StackPanel>
<StackPanel>
<Label Style="{DynamicResource Label}"/>
<TextBox Style="{DynamicResource TextBox}"/>
<TextBox Style="{DynamicResource TextBox}"/>
<Label Style="{DynamicResource Label}"/>
<Label Style="{DynamicResource Label}"/>
<TextBox Style="{DynamicResource TextBox}"/>
<TextBox Style="{DynamicResource TextBox}"/>
<TextBox Style="{DynamicResource TextBox}"/>
<Label Style="{DynamicResource Label}"/>
<Label Style="{DynamicResource Label}"/>
<TextBox Style="{DynamicResource TextBox}"/>
<Label Style="{DynamicResource Label}"/>
<Label Style="{DynamicResource Label}"/>
<TextBox Style="{DynamicResource TextBox}"/>
<TextBox Style="{DynamicResource TextBox}"/>
</StackPanel>
</DockPanel>
</ScrollViewer>
XAML für Fenster (lädt die Seite oben):
<NavigationWindow x:Class="EMS_WPF_Test.Window1"
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:EMS_WPF_Test"
mc:Ignorable="d"
Title="Modify device" MinHeight="300" MinWidth="680" Height="300" Width="680" Source="ModifySpDefaultValues.xaml" WindowStartupLocation="CenterScreen" ShowsNavigationUI="False">
Styles:
<Application x:Class="Test.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="MainWindow.xaml">
<Application.Resources>
<!-- Header text style -->
<Style x:Key="Hyperlink">
<Setter Property="Label.Margin" Value="0,0,25,0"></Setter>
<Setter Property="Label.Foreground" Value="{DynamicResource {x:Static SystemColors.HotTrackBrushKey}}"></Setter>
<Setter Property="Label.Cursor" Value="Hand"></Setter>
<Setter Property="Label.Height" Value="20"></Setter>
<Setter Property="Label.Padding" Value="0"/>
</Style>
<Style x:Key="OperationMethodBox">
<Setter Property="Label.Margin" Value="0,0,25,0"></Setter>
<Setter Property="ComboBox.Width" Value="300"></Setter>
<Setter Property="Label.Height" Value="20"></Setter>
<Setter Property="Label.Padding" Value="0"/>
</Style>
<Style x:Key="TextBox">
<Setter Property="Label.Margin" Value="0,0,25,0"></Setter>
<Setter Property="TextBox.MinWidth" Value="50"></Setter>
<Setter Property="Label.Height" Value="20"></Setter>
<Setter Property="Label.Padding" Value="0"/>
</Style>
<Style x:Key="Label">
<Setter Property="Label.Height" Value="20"/>
<Setter Property="Panel.Margin" Value="0,0,25,0"/>
<Setter Property="Label.Padding" Value="0"/>
</Style>
<Style x:Key="Form">
<Setter Property="Page.Background" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
</Style>
</Application.Resources>
Ich bin neu in WPF, und es zeigt wahrscheinlich. Ich kann die Bildlaufleisten nicht wie gewünscht aufrufen. Aus irgendeinem Grund erscheint die vertikale Bildlaufleiste nie, selbst wenn die Höhe meines Fensters geringer ist als die minimale Höhe der Seite, deren XAML-Markup ich oben gezeigt habe.
Ich bin neu in all dem, also, wenn jemand mir einen Rat geben kann, was ich falsch mache oder hilfreiche Links zu hilfreichen Ressourcen poste, würde ich es begrüßen.
Die ScrollBar sollte funktionieren, überprüfen Sie noch einmal. –
Nun, es tut es nicht. Ich starte die App, ich versuche das Fenster zu skalieren, aber die Bildlaufleiste erscheint nie, egal wie ich die Größe ändere. – Athena
Dann stört etwas anderes. Nicht genug Informationen hier zu erzählen. –