From 1b59fcbada9e1251fe6eeb8b8522a23498ad6942 Mon Sep 17 00:00:00 2001 From: "harald.martini@student.tugraz.at" <harald.martini@student.tugraz.at> Date: Tue, 15 Jun 2021 09:53:25 +0200 Subject: [PATCH] Updated Settings View --- .../Resources/Icons/FolderClosed_16x.xaml | 20 ++++ VECTO3GUI2020/Resources/Icons/drawables.xaml | 20 ++++ VECTO3GUI2020/VECTO3GUI2020.csproj | 4 + .../Multistage/CustomControls/FilePicker.xaml | 10 +- .../CustomControls/FilePicker.xaml.cs | 9 ++ VECTO3GUI2020/Views/SettingsView.xaml | 110 ++++++++++-------- 6 files changed, 124 insertions(+), 49 deletions(-) create mode 100644 VECTO3GUI2020/Resources/Icons/FolderClosed_16x.xaml diff --git a/VECTO3GUI2020/Resources/Icons/FolderClosed_16x.xaml b/VECTO3GUI2020/Resources/Icons/FolderClosed_16x.xaml new file mode 100644 index 0000000000..3d162d6e29 --- /dev/null +++ b/VECTO3GUI2020/Resources/Icons/FolderClosed_16x.xaml @@ -0,0 +1,20 @@ +<!-- This file was generated by the AiToXaml tool.--> +<!-- Tool Version: 14.0.22307.0 --> +<Viewbox Width="16" Height="16" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"> + <Rectangle Width="16" Height="16"> + <Rectangle.Fill> + <DrawingBrush> + <DrawingBrush.Drawing> + <DrawingGroup> + <DrawingGroup.Children> + <GeometryDrawing Brush="#00FFFFFF" Geometry="F1M0,0L16,0 16,16 0,16z" /> + <GeometryDrawing Brush="#FFF6F6F6" Geometry="F1M1.5,1L9.61,1 10.61,3 13.496,3C14.323,3,14.996,3.673,14.996,4.5L14.996,12.5C14.996,13.327,14.323,14,13.496,14L1.5,14C0.673,14,0,13.327,0,12.5L0,2.5C0,1.673,0.673,1,1.5,1" /> + <GeometryDrawing Brush="#FFEFEFF0" Geometry="F1M1.9998,3.0004L1.9998,4.0004 8.8738,4.0004 8.3738,3.0004z" /> + <GeometryDrawing Brush="#FFDBB679" Geometry="F1M2,3L8.374,3 8.874,4 2,4z M13.496,4L10,4 9.992,4 8.992,2 1.5,2C1.225,2,1,2.224,1,2.5L1,12.5C1,12.776,1.225,13,1.5,13L13.496,13C13.773,13,13.996,12.776,13.996,12.5L13.996,4.5C13.996,4.224,13.773,4,13.496,4" /> + </DrawingGroup.Children> + </DrawingGroup> + </DrawingBrush.Drawing> + </DrawingBrush> + </Rectangle.Fill> + </Rectangle> +</Viewbox> \ No newline at end of file diff --git a/VECTO3GUI2020/Resources/Icons/drawables.xaml b/VECTO3GUI2020/Resources/Icons/drawables.xaml index 2d2c760217..268ae2eb99 100644 --- a/VECTO3GUI2020/Resources/Icons/drawables.xaml +++ b/VECTO3GUI2020/Resources/Icons/drawables.xaml @@ -66,4 +66,24 @@ </Rectangle> </Viewbox> </DataTemplate> + <DataTemplate x:Key="FolderIcon"> + <Viewbox Width="16" Height="16" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"> + <Rectangle Width="16" Height="16"> + <Rectangle.Fill> + <DrawingBrush> + <DrawingBrush.Drawing> + <DrawingGroup> + <DrawingGroup.Children> + <GeometryDrawing Brush="#00FFFFFF" Geometry="F1M0,0L16,0 16,16 0,16z" /> + <GeometryDrawing Brush="#FFF6F6F6" Geometry="F1M1.5,1L9.61,1 10.61,3 13.496,3C14.323,3,14.996,3.673,14.996,4.5L14.996,12.5C14.996,13.327,14.323,14,13.496,14L1.5,14C0.673,14,0,13.327,0,12.5L0,2.5C0,1.673,0.673,1,1.5,1" /> + <GeometryDrawing Brush="#FFEFEFF0" Geometry="F1M1.9998,3.0004L1.9998,4.0004 8.8738,4.0004 8.3738,3.0004z" /> + <GeometryDrawing Brush="#FFDBB679" Geometry="F1M2,3L8.374,3 8.874,4 2,4z M13.496,4L10,4 9.992,4 8.992,2 1.5,2C1.225,2,1,2.224,1,2.5L1,12.5C1,12.776,1.225,13,1.5,13L13.496,13C13.773,13,13.996,12.776,13.996,12.5L13.996,4.5C13.996,4.224,13.773,4,13.496,4" /> + </DrawingGroup.Children> + </DrawingGroup> + </DrawingBrush.Drawing> + </DrawingBrush> + </Rectangle.Fill> + </Rectangle> + </Viewbox> + </DataTemplate> </ResourceDictionary> \ No newline at end of file diff --git a/VECTO3GUI2020/VECTO3GUI2020.csproj b/VECTO3GUI2020/VECTO3GUI2020.csproj index de299422c7..9de0c0a0c3 100644 --- a/VECTO3GUI2020/VECTO3GUI2020.csproj +++ b/VECTO3GUI2020/VECTO3GUI2020.csproj @@ -479,6 +479,10 @@ <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> </Page> + <Page Include="Resources\Icons\FolderClosed_16x.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> <Page Include="Resources\Icons\Trash_16x.xaml"> <Generator>MSBuild:Compile</Generator> <SubType>Designer</SubType> diff --git a/VECTO3GUI2020/Views/Multistage/CustomControls/FilePicker.xaml b/VECTO3GUI2020/Views/Multistage/CustomControls/FilePicker.xaml index 614ebbf578..31afd99805 100644 --- a/VECTO3GUI2020/Views/Multistage/CustomControls/FilePicker.xaml +++ b/VECTO3GUI2020/Views/Multistage/CustomControls/FilePicker.xaml @@ -17,9 +17,15 @@ <TextBox x:Name="textBox" VerticalContentAlignment="Center" Padding="4" Margin = "0 0 0 0" IsReadOnly="True" Text="{Binding Text, ElementName=filepickercustomcontrol}" HorizontalAlignment="Stretch" TextWrapping="Wrap" Style="{DynamicResource TextBoxStyle1}"/> - <Button x:Name="button" Padding="4" Margin="4 0 0 0" Grid.Column="1" ContentTemplate="{DynamicResource AddDocumentIcon}" + <Button x:Name="button" Padding="4" Margin="4 0 0 0" Grid.Column="1" Command="{Binding Command, ElementName=filepickercustomcontrol}" Style="{DynamicResource FilePickerButtonStyle}"> - + <Button.ContentTemplate> + <Binding Path="ButtonContentTemplate" ElementName="filepickercustomcontrol" Converter="{StaticResource NullToUnsetValue}"> + <Binding.FallbackValue> + <StaticResource ResourceKey="AddDocumentIcon"></StaticResource> + </Binding.FallbackValue> + </Binding> + </Button.ContentTemplate> </Button> </Grid> </UserControl> diff --git a/VECTO3GUI2020/Views/Multistage/CustomControls/FilePicker.xaml.cs b/VECTO3GUI2020/Views/Multistage/CustomControls/FilePicker.xaml.cs index 8fe20e0357..6c7de5effe 100644 --- a/VECTO3GUI2020/Views/Multistage/CustomControls/FilePicker.xaml.cs +++ b/VECTO3GUI2020/Views/Multistage/CustomControls/FilePicker.xaml.cs @@ -20,6 +20,15 @@ namespace VECTO3GUI2020.Views.Multistage.CustomControls /// </summary> public partial class FilePicker : UserControl { + public static readonly DependencyProperty ButtonContentTemplateProperty = DependencyProperty.Register( + "ButtonContentTemplate", typeof(DataTemplate), typeof(FilePicker), new PropertyMetadata(default(DataTemplate))); + + public DataTemplate ButtonContentTemplate + { + get { return (DataTemplate)GetValue(ButtonContentTemplateProperty); } + set { SetValue(ButtonContentTemplateProperty, value); } + } + public static readonly DependencyProperty CommandProperty = DependencyProperty.Register( "Command", typeof(ICommand), typeof(FilePicker), new PropertyMetadata(default(ICommand))); diff --git a/VECTO3GUI2020/Views/SettingsView.xaml b/VECTO3GUI2020/Views/SettingsView.xaml index 225d950648..f6579754ed 100644 --- a/VECTO3GUI2020/Views/SettingsView.xaml +++ b/VECTO3GUI2020/Views/SettingsView.xaml @@ -6,7 +6,7 @@ xmlns:local="clr-namespace:VECTO3GUI2020.Views" xmlns:customControls="clr-namespace:VECTO3GUI2020.Views.Multistage.CustomControls" xmlns:implementation="clr-namespace:VECTO3GUI2020.ViewModel.Implementation" - mc:Ignorable="d" Height="450" Width="800" d:DataContext="{d:DesignInstance implementation:SettingsViewModel }"> + mc:Ignorable="d" d:DataContext="{d:DesignInstance implementation:SettingsViewModel }"> <UserControl.Resources> <Style TargetType="Label"> <Setter Property="Margin" Value="4 4 4 4"></Setter> @@ -20,66 +20,82 @@ </UserControl.Resources> <Grid> - <DockPanel LastChildFill="False"> - <Grid DockPanel.Dock="Top"> + <DockPanel VerticalAlignment="Stretch" LastChildFill="False"> + <Label DockPanel.Dock="Top" Style="{StaticResource LabelStyle1}">File I/O</Label> + <Border DockPanel.Dock="Top" BorderBrush="{StaticResource ButtonHighlightColor}" BorderThickness="1"> + <Grid DockPanel.Dock="Top" IsSharedSizeScope="True" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"> <Grid.ColumnDefinitions> - <ColumnDefinition Width="1*"/> - <ColumnDefinition Width="1*"></ColumnDefinition> - <ColumnDefinition Width="1*"></ColumnDefinition> - <ColumnDefinition Width="1*"></ColumnDefinition> + <ColumnDefinition Width="Auto"/> + <ColumnDefinition Width="Auto"/> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition Height="Auto"></RowDefinition> <RowDefinition Height="Auto"></RowDefinition> - <RowDefinition Height="30"></RowDefinition> - <RowDefinition Height="30"></RowDefinition> - <RowDefinition Height="30"></RowDefinition> </Grid.RowDefinitions> - - - <Label Grid.Row="0" Grid.Column="0" DockPanel.Dock="Left">Default Path</Label> - <customControls:FilePicker Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="3" DockPanel.Dock="Right" - Text="{Binding DefaultFilePath}" - HorizontalAlignment="Stretch" Command="{Binding ChangeFilePath}"/> - - <Label Grid.Row="1" Grid.Column="0" DockPanel.Dock="Left">Default Path</Label> - <Grid Grid.Row="1" Grid.Column="1" Margin="4" VerticalAlignment="Stretch" Grid.ColumnSpan="3" DockPanel.Dock="Right"> - <Grid.RowDefinitions> - <RowDefinition></RowDefinition> - </Grid.RowDefinitions> + + <Label Grid.Row="0" Grid.Column="0" DockPanel.Dock="Left">Default Input Path</Label> + <customControls:FilePicker Grid.Row="0" + Grid.Column="1" + DockPanel.Dock="Right" + Text="{Binding DefaultFilePath}" + HorizontalAlignment="Stretch" Command="{Binding ChangeFilePath}" + ButtonContentTemplate="{DynamicResource FolderIcon}"/> + + + <Label Grid.Column="0" Grid.Row="1">Default Output Path</Label> + <customControls:FilePicker Grid.Row="1" + Grid.Column="1" + Text="{Binding DefaultOutputPath}" + Command="{Binding ChangeOutputPath}" + ButtonContentTemplate="{DynamicResource FolderIcon}"/> + </Grid> + </Border> + <Border BorderBrush="{DynamicResource ButtonHighlightColor}" BorderThickness="1" DockPanel.Dock="Top"> + <StackPanel> + + <Label DockPanel.Dock="Top" Style="{DynamicResource LabelStyle1}">Simulation Settings</Label> + + <Grid> <Grid.ColumnDefinitions> - <ColumnDefinition></ColumnDefinition> - <ColumnDefinition Width="30px"></ColumnDefinition> + <ColumnDefinition Width="2*"/> + <ColumnDefinition Width="1*"/> + <ColumnDefinition Width="2*"/> + <ColumnDefinition Width="1*"/> </Grid.ColumnDefinitions> - <TextBox x:Name="textBox" VerticalContentAlignment="Center" Padding="4" Margin = "0 0 0 0" IsReadOnly="false" - Text="{Binding DefaultOutputPath}" HorizontalAlignment="Stretch" TextWrapping="Wrap" - Style="{DynamicResource TextBoxStyle1}"/> - <Button x:Name="button" Padding="4" Margin="4 0 0 0" Grid.Column="1" ContentTemplate="{DynamicResource AddDocumentIcon}" - Command="{Binding ChangeOutputPath}" Style="{DynamicResource FilePickerButtonStyle}"> + <Grid.RowDefinitions> + <RowDefinition Height="Auto"/> + <RowDefinition Height="Auto"/> + <RowDefinition Height="Auto"/> + </Grid.RowDefinitions> + <Label Grid.Row="0" Grid.Column="0">Serialize Vecto Run Data</Label> + <CheckBox Grid.Row="0" Grid.Column="1" IsChecked="{Binding SerializeVectoRunData}"></CheckBox> + + <Label Grid.Row="1" Grid.Column="2">Write Modal Results</Label> + <CheckBox Grid.Row="1" Grid.Column="3" IsChecked="{Binding WriteModalResults}"></CheckBox> + + <Label Grid.Row="2" Grid.Column="0">Validate</Label> + <CheckBox Grid.Row="2" Grid.Column="1" IsChecked="{Binding Validate}"></CheckBox> + + <Label Grid.Row="0" Grid.Column="2">Actual Modal Data</Label> + <CheckBox Grid.Row="0" Grid.Column="3" IsChecked="{Binding ActualModalData}"></CheckBox> + + <Label Grid.Row="1" Grid.Column="0">ModalResults1Hz</Label> + <CheckBox Grid.Row="1" Grid.Column="1" IsChecked="{Binding ModalResults1Hz}"></CheckBox> + + - </Button> - </Grid> - <!--<customControls:FilePicker Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="3" DockPanel.Dock="Right" - Text="{Binding DefaultOutputPath}" - HorizontalAlignment="Stretch" Command="{Binding ChangeOutputPath}"/>--> + </Grid> - <Label Grid.Row="2" Grid.Column="0">Serialize Vecto Run Data</Label> - <CheckBox Grid.Row="2" Grid.Column="1" IsChecked="{Binding SerializeVectoRunData}"></CheckBox> + </StackPanel> + </Border> - <Label Grid.Row="3" Grid.Column="2">Write Modal Results</Label> - <CheckBox Grid.Row="3" Grid.Column="3" IsChecked="{Binding WriteModalResults}"></CheckBox> - <Label Grid.Row="3" Grid.Column="0">Validate</Label> - <CheckBox Grid.Row="3" Grid.Column="1" IsChecked="{Binding Validate}"></CheckBox> - <Label Grid.Row="4" Grid.Column="2">Actual Modal Data</Label> - <CheckBox Grid.Row="4" Grid.Column="3" IsChecked="{Binding ActualModalData}"></CheckBox> - <Label Grid.Row="4" Grid.Column="0">ModalResults1Hz</Label> - <CheckBox Grid.Row="4" Grid.Column="1" IsChecked="{Binding ModalResults1Hz}"></CheckBox> - </Grid> - <!--<DockPanel DockPanel.Dock="Bottom" LastChildFill="False"> + + <!--</Grid>--> + <DockPanel DockPanel.Dock="Bottom" LastChildFill="False"> <Button DockPanel.Dock="Right" Width="100" Command="{Binding CloseWindowCommand}" @@ -87,7 +103,7 @@ Style="{DynamicResource MultiStageButtonStyle1}" Margin="4" Padding="4">Close</Button> - </DockPanel>--> + </DockPanel> </DockPanel> </Grid> </UserControl> -- GitLab