126 lines
6.6 KiB
XML
126 lines
6.6 KiB
XML
<Window x:Class="S7Explorer.MainWindow" 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:S7Explorer"
|
|
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit" mc:Ignorable="d" Title="S7 Project Explorer" Height="700"
|
|
Width="1000" WindowStartupLocation="CenterScreen">
|
|
|
|
<Window.Resources>
|
|
<!-- Icon Converter -->
|
|
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
|
|
|
|
<!-- HierarchicalDataTemplate for TreeView Items -->
|
|
<HierarchicalDataTemplate x:Key="ProjectItemTemplate" ItemsSource="{Binding Children}">
|
|
<StackPanel Orientation="Horizontal">
|
|
<TextBlock Text="{Binding Name}" Margin="5,0,0,0" />
|
|
</StackPanel>
|
|
</HierarchicalDataTemplate>
|
|
|
|
<!-- Log Entry Template -->
|
|
<DataTemplate x:Key="LogEntryTemplate">
|
|
<TextBlock Text="{Binding}" />
|
|
</DataTemplate>
|
|
</Window.Resources>
|
|
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="*" />
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="120" />
|
|
</Grid.RowDefinitions>
|
|
|
|
<!-- Toolbar -->
|
|
<ToolBar Grid.Row="0">
|
|
<Button Content="Load Project" Command="{Binding LoadProjectCommand}"
|
|
ToolTip="Load a Siemens S7 project file (.s7p)" Style="{StaticResource ToolbarButtonStyle}" />
|
|
<Button Content="Reload" Command="{Binding ReloadProjectCommand}" ToolTip="Reload the current project"
|
|
Style="{StaticResource ToolbarButtonStyle}" IsEnabled="{Binding IsProjectLoaded}" />
|
|
<Separator />
|
|
<Button Content="Export" Command="{Binding ExportDocumentationCommand}"
|
|
ToolTip="Export project documentation to a file" Style="{StaticResource ToolbarButtonStyle}"
|
|
IsEnabled="{Binding IsProjectLoaded}" />
|
|
<Separator />
|
|
<Label Content="Search:" VerticalAlignment="Center" />
|
|
<TextBox Width="200" Text="{Binding SearchText, UpdateSourceTrigger=PropertyChanged}"
|
|
VerticalAlignment="Center" Margin="5" />
|
|
<Button Content="Find" Command="{Binding SearchCommand}" ToolTip="Search in project"
|
|
Style="{StaticResource ToolbarButtonStyle}" IsEnabled="{Binding IsProjectLoaded}" />
|
|
<CheckBox Content="Case Sensitive" VerticalAlignment="Center" Margin="5"
|
|
IsChecked="{Binding IsCaseSensitive}" />
|
|
<CheckBox Content="Regex" VerticalAlignment="Center" Margin="5" IsChecked="{Binding UseRegex}" />
|
|
</ToolBar>
|
|
|
|
<!-- Main Content -->
|
|
<Grid Grid.Row="1">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="350" />
|
|
<ColumnDefinition Width="5" />
|
|
<ColumnDefinition Width="*" />
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<!-- Project Explorer Tree -->
|
|
<DockPanel Grid.Column="0">
|
|
<ToolBar DockPanel.Dock="Top">
|
|
<Button Content="Expand All" Command="{Binding ExpandAllCommand}" ToolTip="Expand all tree nodes"
|
|
Style="{StaticResource ToolbarButtonStyle}" IsEnabled="{Binding IsProjectLoaded}" />
|
|
<Button Content="Collapse All" Command="{Binding CollapseAllCommand}"
|
|
ToolTip="Collapse all tree nodes" Style="{StaticResource ToolbarButtonStyle}"
|
|
IsEnabled="{Binding IsProjectLoaded}" />
|
|
</ToolBar>
|
|
|
|
<TreeView ItemsSource="{Binding ProjectStructure}" ItemTemplate="{StaticResource ProjectItemTemplate}"
|
|
SelectedItemChanged="TreeView_SelectedItemChanged" VirtualizingPanel.IsVirtualizing="True"
|
|
VirtualizingPanel.VirtualizationMode="Recycling">
|
|
</TreeView>
|
|
</DockPanel>
|
|
|
|
<!-- Splitter -->
|
|
<GridSplitter Grid.Column="1" Width="5" HorizontalAlignment="Stretch" />
|
|
|
|
<!-- Property Grid -->
|
|
<xctk:PropertyGrid Grid.Column="2" SelectedObject="{Binding SelectedItemDetails}"
|
|
AutoGenerateProperties="True" IsReadOnly="True" ShowSearchBox="True" ShowSortOptions="True"
|
|
ShowTitle="True" ShowAdvancedOptions="False" />
|
|
</Grid>
|
|
|
|
<!-- Status Bar -->
|
|
<StatusBar Grid.Row="2">
|
|
<StatusBarItem>
|
|
<TextBlock Text="{Binding ProjectPath}" Style="{StaticResource StatusTextStyle}" />
|
|
</StatusBarItem>
|
|
<Separator />
|
|
<StatusBarItem>
|
|
<TextBlock Text="{Binding SelectedItem.Name, StringFormat=Selected: {0}}"
|
|
Style="{StaticResource StatusTextStyle}" />
|
|
</StatusBarItem>
|
|
<StatusBarItem HorizontalAlignment="Right">
|
|
<ProgressBar Width="100" Height="15" IsIndeterminate="{Binding IsLoading}"
|
|
Visibility="{Binding IsLoading, Converter={StaticResource BooleanToVisibilityConverter}}" />
|
|
</StatusBarItem>
|
|
</StatusBar>
|
|
|
|
<!-- Log View -->
|
|
<DockPanel Grid.Row="3">
|
|
<ToolBar DockPanel.Dock="Top">
|
|
<Label Content="Log:" VerticalAlignment="Center" />
|
|
<Button Content="Clear" Command="{Binding ClearLogCommand}" ToolTip="Clear log messages"
|
|
Style="{StaticResource ToolbarButtonStyle}" />
|
|
</ToolBar>
|
|
|
|
<ListView ItemsSource="{Binding LogEntries}" ItemTemplate="{StaticResource LogEntryTemplate}"
|
|
ScrollViewer.VerticalScrollBarVisibility="Auto" ScrollViewer.HorizontalScrollBarVisibility="Auto"
|
|
VirtualizingPanel.IsVirtualizing="True" VirtualizingPanel.VirtualizationMode="Recycling">
|
|
</ListView>
|
|
</DockPanel>
|
|
|
|
<!-- Loading Overlay -->
|
|
<Grid Grid.RowSpan="4" Visibility="{Binding IsLoading, Converter={StaticResource BooleanToVisibilityConverter}}">
|
|
<Rectangle Fill="Black" Opacity="0.3" />
|
|
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
|
|
<TextBlock Text="Loading..." FontSize="20" Foreground="White" />
|
|
<ProgressBar Width="200" Height="20" IsIndeterminate="True" Margin="0,10,0,0" />
|
|
</StackPanel>
|
|
</Grid>
|
|
</Grid>
|
|
</Window> |