Merge branch 'v0.3.1-theming' into v0.4-opcua
This commit is contained in:
commit
2bf108905c
1 changed files with 117 additions and 109 deletions
|
|
@ -8,120 +8,128 @@
|
||||||
x:DataType="vm:MachineConfigViewModel"
|
x:DataType="vm:MachineConfigViewModel"
|
||||||
x:CompileBindings="True">
|
x:CompileBindings="True">
|
||||||
|
|
||||||
<DockPanel Margin="20">
|
<!-- header / body / footer -->
|
||||||
|
<Grid Margin="20" RowDefinitions="Auto,*,Auto">
|
||||||
|
|
||||||
<!-- Header -->
|
<!-- Header -->
|
||||||
<TextBlock DockPanel.Dock="Top" Classes="h1"
|
<TextBlock Grid.Row="0" Classes="h1"
|
||||||
Text="{Binding Title}"
|
Text="{Binding Title}"
|
||||||
Margin="0,0,0,16" />
|
Margin="0,0,0,16" />
|
||||||
|
|
||||||
<!-- Action bar -->
|
<!-- Body: fixed form column + stretching data-items column -->
|
||||||
<StackPanel DockPanel.Dock="Bottom" Orientation="Horizontal" Spacing="12" Margin="0,16,0,0">
|
<Grid Grid.Row="1" ColumnDefinitions="Auto,*">
|
||||||
<Button Classes="accent" Content="Save" Command="{Binding SaveCommand}" IsDefault="True" />
|
|
||||||
<Button Content="Cancel" Command="{Binding CancelCommand}" />
|
<!-- Form -->
|
||||||
|
<Border Grid.Column="0" Classes="card" Width="380" VerticalAlignment="Top">
|
||||||
|
<StackPanel Spacing="12">
|
||||||
|
|
||||||
|
<StackPanel Spacing="4">
|
||||||
|
<TextBlock Classes="fieldLabel" Text="Name" />
|
||||||
|
<TextBox Text="{Binding Name}" Watermark="Machine name" />
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
|
<StackPanel Spacing="4">
|
||||||
|
<TextBlock Classes="fieldLabel" Text="Protocol" />
|
||||||
|
<ComboBox ItemsSource="{Binding AvailableProtocols}"
|
||||||
|
SelectedItem="{Binding SelectedProtocol}"
|
||||||
|
HorizontalAlignment="Stretch"
|
||||||
|
PlaceholderText="Select a protocol" />
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
|
<StackPanel Spacing="4">
|
||||||
|
<TextBlock Classes="fieldLabel" Text="Agent URL" />
|
||||||
|
<TextBox Text="{Binding AgentUrl}" Watermark="http://host:5000" />
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
|
<StackPanel Spacing="4">
|
||||||
|
<TextBlock Classes="fieldLabel" Text="Poll Interval (seconds)" />
|
||||||
|
<TextBox Text="{Binding PollIntervalSeconds}" Width="120" HorizontalAlignment="Left" />
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
|
</StackPanel>
|
||||||
|
</Border>
|
||||||
|
|
||||||
|
<!-- Data items to monitor (fills remaining width + height) -->
|
||||||
|
<Border Grid.Column="1" Classes="card" Margin="16,0,0,0" HorizontalAlignment="Stretch">
|
||||||
|
<DockPanel>
|
||||||
|
|
||||||
|
<TextBlock DockPanel.Dock="Top" Classes="h2" Text="Data items to monitor"
|
||||||
|
Margin="0,0,0,8" />
|
||||||
|
|
||||||
|
<!-- Controls row -->
|
||||||
|
<StackPanel DockPanel.Dock="Top" Orientation="Horizontal" Spacing="8" Margin="0,0,0,8">
|
||||||
|
<Button Content="Load available items"
|
||||||
|
Command="{Binding LoadItemsCommand}" />
|
||||||
|
<Button Content="Select all"
|
||||||
|
Command="{Binding SelectAllCommand}" />
|
||||||
|
<Button Content="Select none"
|
||||||
|
Command="{Binding SelectNoneCommand}" />
|
||||||
|
<ProgressBar IsIndeterminate="True"
|
||||||
|
IsVisible="{Binding IsProbing}"
|
||||||
|
Width="120" VerticalAlignment="Center" />
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
|
<!-- Status message -->
|
||||||
|
<TextBlock DockPanel.Dock="Top" Classes="subtle"
|
||||||
|
Text="{Binding ItemsStatus}"
|
||||||
|
IsVisible="{Binding HasItemsStatus}"
|
||||||
|
TextWrapping="Wrap" Margin="0,0,0,8" />
|
||||||
|
|
||||||
|
<!-- Column header -->
|
||||||
|
<Border DockPanel.Dock="Top"
|
||||||
|
BorderThickness="0,0,0,1"
|
||||||
|
BorderBrush="{DynamicResource CardBorderBrush}"
|
||||||
|
Padding="0,0,0,4" Margin="0,0,0,4">
|
||||||
|
<Grid ColumnDefinitions="Auto,2*,1.2*,1.2*,1*" Margin="0,0,8,0">
|
||||||
|
<TextBlock Grid.Column="0" Text="" Width="28" />
|
||||||
|
<TextBlock Grid.Column="1" Classes="fieldLabel" Text="Name" />
|
||||||
|
<TextBlock Grid.Column="2" Classes="fieldLabel" Text="Type" />
|
||||||
|
<TextBlock Grid.Column="3" Classes="fieldLabel" Text="Category" />
|
||||||
|
<TextBlock Grid.Column="4" Classes="fieldLabel" Text="Units" />
|
||||||
|
</Grid>
|
||||||
|
</Border>
|
||||||
|
|
||||||
|
<!-- Scrollable checklist (fills remaining height) -->
|
||||||
|
<ScrollViewer>
|
||||||
|
<ItemsControl ItemsSource="{Binding AvailableItems}">
|
||||||
|
<ItemsControl.ItemTemplate>
|
||||||
|
<DataTemplate x:DataType="vm:SelectableDataItemViewModel">
|
||||||
|
<Grid ColumnDefinitions="Auto,2*,1.2*,1.2*,1*" Margin="0,3">
|
||||||
|
<CheckBox Grid.Column="0" Width="28"
|
||||||
|
IsChecked="{Binding IsSelected}"
|
||||||
|
VerticalAlignment="Center" />
|
||||||
|
<StackPanel Grid.Column="1" VerticalAlignment="Center">
|
||||||
|
<TextBlock Text="{Binding Name}" FontWeight="SemiBold" TextWrapping="Wrap" />
|
||||||
|
<TextBlock Text="{Binding Id}" Classes="subtle" FontSize="11" TextWrapping="Wrap" />
|
||||||
|
</StackPanel>
|
||||||
|
<TextBlock Grid.Column="2" Text="{Binding Type}" VerticalAlignment="Center" TextWrapping="Wrap" />
|
||||||
|
<TextBlock Grid.Column="3" Text="{Binding Category}" VerticalAlignment="Center" TextWrapping="Wrap" />
|
||||||
|
<TextBlock Grid.Column="4" Text="{Binding Units}" VerticalAlignment="Center" TextWrapping="Wrap" />
|
||||||
|
</Grid>
|
||||||
|
</DataTemplate>
|
||||||
|
</ItemsControl.ItemTemplate>
|
||||||
|
</ItemsControl>
|
||||||
|
</ScrollViewer>
|
||||||
|
|
||||||
|
</DockPanel>
|
||||||
|
</Border>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
<!-- Footer: validation hint + action bar, full width -->
|
||||||
|
<StackPanel Grid.Row="2" Spacing="0">
|
||||||
|
<!-- Inline validation hint -->
|
||||||
|
<TextBlock Text="{Binding ValidationError}"
|
||||||
|
IsVisible="{Binding HasValidationError}"
|
||||||
|
Foreground="{DynamicResource DangerBrush}"
|
||||||
|
TextWrapping="Wrap"
|
||||||
|
Margin="0,12,0,0" />
|
||||||
|
|
||||||
|
<!-- Action bar -->
|
||||||
|
<StackPanel Orientation="Horizontal" Spacing="12" Margin="0,16,0,0">
|
||||||
|
<Button Classes="accent" Content="Save" Command="{Binding SaveCommand}" IsDefault="True" />
|
||||||
|
<Button Content="Cancel" Command="{Binding CancelCommand}" />
|
||||||
|
</StackPanel>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
<!-- Inline validation hint -->
|
</Grid>
|
||||||
<TextBlock DockPanel.Dock="Bottom"
|
|
||||||
Text="{Binding ValidationError}"
|
|
||||||
IsVisible="{Binding HasValidationError}"
|
|
||||||
Foreground="{DynamicResource DangerBrush}"
|
|
||||||
TextWrapping="Wrap"
|
|
||||||
Margin="0,12,0,0" />
|
|
||||||
|
|
||||||
<!-- Form -->
|
|
||||||
<Border DockPanel.Dock="Top" Classes="card" MaxWidth="480" HorizontalAlignment="Left">
|
|
||||||
<StackPanel Spacing="12">
|
|
||||||
|
|
||||||
<StackPanel Spacing="4">
|
|
||||||
<TextBlock Classes="fieldLabel" Text="Name" />
|
|
||||||
<TextBox Text="{Binding Name}" Watermark="Machine name" />
|
|
||||||
</StackPanel>
|
|
||||||
|
|
||||||
<StackPanel Spacing="4">
|
|
||||||
<TextBlock Classes="fieldLabel" Text="Protocol" />
|
|
||||||
<ComboBox ItemsSource="{Binding AvailableProtocols}"
|
|
||||||
SelectedItem="{Binding SelectedProtocol}"
|
|
||||||
HorizontalAlignment="Stretch"
|
|
||||||
PlaceholderText="Select a protocol" />
|
|
||||||
</StackPanel>
|
|
||||||
|
|
||||||
<StackPanel Spacing="4">
|
|
||||||
<TextBlock Classes="fieldLabel" Text="Agent URL" />
|
|
||||||
<TextBox Text="{Binding AgentUrl}" Watermark="http://host:5000" />
|
|
||||||
</StackPanel>
|
|
||||||
|
|
||||||
<StackPanel Spacing="4">
|
|
||||||
<TextBlock Classes="fieldLabel" Text="Poll Interval (seconds)" />
|
|
||||||
<TextBox Text="{Binding PollIntervalSeconds}" Width="120" HorizontalAlignment="Left" />
|
|
||||||
</StackPanel>
|
|
||||||
|
|
||||||
</StackPanel>
|
|
||||||
</Border>
|
|
||||||
|
|
||||||
<!-- Data items to monitor (fills remaining space) -->
|
|
||||||
<Border Classes="card" Margin="0,16,0,0" MaxWidth="640" HorizontalAlignment="Left">
|
|
||||||
<DockPanel>
|
|
||||||
|
|
||||||
<TextBlock DockPanel.Dock="Top" Classes="h2" Text="Data items to monitor"
|
|
||||||
Margin="0,0,0,8" />
|
|
||||||
|
|
||||||
<!-- Controls row -->
|
|
||||||
<StackPanel DockPanel.Dock="Top" Orientation="Horizontal" Spacing="8" Margin="0,0,0,8">
|
|
||||||
<Button Content="Load available items"
|
|
||||||
Command="{Binding LoadItemsCommand}" />
|
|
||||||
<Button Content="Select all"
|
|
||||||
Command="{Binding SelectAllCommand}" />
|
|
||||||
<Button Content="Select none"
|
|
||||||
Command="{Binding SelectNoneCommand}" />
|
|
||||||
<ProgressBar IsIndeterminate="True"
|
|
||||||
IsVisible="{Binding IsProbing}"
|
|
||||||
Width="120" VerticalAlignment="Center" />
|
|
||||||
</StackPanel>
|
|
||||||
|
|
||||||
<!-- Status message -->
|
|
||||||
<TextBlock DockPanel.Dock="Top" Classes="subtle"
|
|
||||||
Text="{Binding ItemsStatus}"
|
|
||||||
IsVisible="{Binding HasItemsStatus}"
|
|
||||||
TextWrapping="Wrap" Margin="0,0,0,8" />
|
|
||||||
|
|
||||||
<!-- Column header -->
|
|
||||||
<Border DockPanel.Dock="Top"
|
|
||||||
BorderThickness="0,0,0,1"
|
|
||||||
BorderBrush="{DynamicResource CardBorderBrush}"
|
|
||||||
Padding="0,0,0,4" Margin="0,0,0,4">
|
|
||||||
<Grid ColumnDefinitions="Auto,2*,1.2*,1.2*,1*" Margin="0,0,8,0">
|
|
||||||
<TextBlock Grid.Column="0" Text="" Width="28" />
|
|
||||||
<TextBlock Grid.Column="1" Classes="fieldLabel" Text="Name" />
|
|
||||||
<TextBlock Grid.Column="2" Classes="fieldLabel" Text="Type" />
|
|
||||||
<TextBlock Grid.Column="3" Classes="fieldLabel" Text="Category" />
|
|
||||||
<TextBlock Grid.Column="4" Classes="fieldLabel" Text="Units" />
|
|
||||||
</Grid>
|
|
||||||
</Border>
|
|
||||||
|
|
||||||
<!-- Scrollable checklist -->
|
|
||||||
<ScrollViewer MaxHeight="320">
|
|
||||||
<ItemsControl ItemsSource="{Binding AvailableItems}">
|
|
||||||
<ItemsControl.ItemTemplate>
|
|
||||||
<DataTemplate x:DataType="vm:SelectableDataItemViewModel">
|
|
||||||
<Grid ColumnDefinitions="Auto,2*,1.2*,1.2*,1*" Margin="0,3">
|
|
||||||
<CheckBox Grid.Column="0" Width="28"
|
|
||||||
IsChecked="{Binding IsSelected}"
|
|
||||||
VerticalAlignment="Center" />
|
|
||||||
<StackPanel Grid.Column="1" VerticalAlignment="Center">
|
|
||||||
<TextBlock Text="{Binding Name}" FontWeight="SemiBold" TextWrapping="Wrap" />
|
|
||||||
<TextBlock Text="{Binding Id}" Classes="subtle" FontSize="11" TextWrapping="Wrap" />
|
|
||||||
</StackPanel>
|
|
||||||
<TextBlock Grid.Column="2" Text="{Binding Type}" VerticalAlignment="Center" TextWrapping="Wrap" />
|
|
||||||
<TextBlock Grid.Column="3" Text="{Binding Category}" VerticalAlignment="Center" TextWrapping="Wrap" />
|
|
||||||
<TextBlock Grid.Column="4" Text="{Binding Units}" VerticalAlignment="Center" TextWrapping="Wrap" />
|
|
||||||
</Grid>
|
|
||||||
</DataTemplate>
|
|
||||||
</ItemsControl.ItemTemplate>
|
|
||||||
</ItemsControl>
|
|
||||||
</ScrollViewer>
|
|
||||||
|
|
||||||
</DockPanel>
|
|
||||||
</Border>
|
|
||||||
</DockPanel>
|
|
||||||
</UserControl>
|
</UserControl>
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue