diff --git a/VECTO3GUI2020/Resources/Templates/ErrorTemplates.xaml b/VECTO3GUI2020/Resources/Templates/ErrorTemplates.xaml index 52b5e05bc231e372f69c23b87b291383e8116d4c..3cb32aaf620dbea6ac40973811900255e45cc23f 100644 --- a/VECTO3GUI2020/Resources/Templates/ErrorTemplates.xaml +++ b/VECTO3GUI2020/Resources/Templates/ErrorTemplates.xaml @@ -5,7 +5,7 @@ <ControlTemplate x:Key="multistageParameterControlErrorTemplate"> <Grid> <AdornedElementPlaceholder></AdornedElementPlaceholder> - <TextBlock Text="!" Height="Auto" FontWeight="ExtraBold" Foreground="OrangeRed" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="4"></TextBlock> + <TextBlock Text="!" Height="Auto" FontWeight="ExtraBold" Foreground="OrangeRed" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0 0 -10 0"></TextBlock> </Grid> </ControlTemplate> diff --git a/VECTO3GUI2020/Views/Multistage/CustomControls/MultistageParameterCheckBoxView.xaml b/VECTO3GUI2020/Views/Multistage/CustomControls/MultistageParameterCheckBoxView.xaml index a10a243e68b4fb48af4ca8d94f855a88368285b8..08282aadb40ed4c467e1203e425d931f7078a23d 100644 --- a/VECTO3GUI2020/Views/Multistage/CustomControls/MultistageParameterCheckBoxView.xaml +++ b/VECTO3GUI2020/Views/Multistage/CustomControls/MultistageParameterCheckBoxView.xaml @@ -7,27 +7,29 @@ mc:Ignorable="d" d:DesignHeight="450" d:DesignWidth="800"> <Grid> - <Grid> + <UniformGrid Rows="1" Margin="0 0 10 2"> + <!--<Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="4*" SharedSizeGroup="W"/> <ColumnDefinition Width="1*" SharedSizeGroup="N"/> <ColumnDefinition Width="4*" SharedSizeGroup="W"/> <ColumnDefinition Width="4*" SharedSizeGroup="W"/> <ColumnDefinition Width="1*" SharedSizeGroup="N"/> - </Grid.ColumnDefinitions> - - <Label x:Name="label3"> + </Grid.ColumnDefinitions>--> + <DockPanel Margin="5 0 "> + <Label x:Name="label3"> <PriorityBinding> <Binding Path="Label" Converter="{StaticResource NullToUnsetValue}"></Binding> <Binding Path="GeneratedLabelText"></Binding> </PriorityBinding> </Label> - <CheckBox Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center" Name="CheckBoxCheckBox" + <CheckBox Grid.Column="1" HorizontalAlignment="Right" VerticalAlignment="Center" Name="CheckBoxCheckBox" Visibility="{Binding ShowCheckBox, Converter={StaticResource BooleanToVisibilityConverter}}" IsChecked="{Binding EditingEnabled, Mode=TwoWay}" /> + </DockPanel> <CheckBox x:Name="checkBox" Grid.Column="2" VerticalAlignment="Center" HorizontalAlignment="Center" IsTabStop="False" IsChecked="{Binding Path=PreviousContent, @@ -41,10 +43,6 @@ UpdateSourceTrigger=PropertyChanged}"> </CheckBox> - <!--<Label x:Name="label4" Grid.Column="4" - Content="{Binding DummyContent, Converter={StaticResource SIToUnitStringConverter}}"> - </Label>--> - </Grid> - + </UniformGrid> </Grid> </UserControl> diff --git a/VECTO3GUI2020/Views/Multistage/CustomControls/MultistageParameterComboBoxView.xaml b/VECTO3GUI2020/Views/Multistage/CustomControls/MultistageParameterComboBoxView.xaml index f9cd78e85b89989bf8459d383c49dd73d452821b..10606ac8fa814e460d177da8a4a3c573f9501863 100644 --- a/VECTO3GUI2020/Views/Multistage/CustomControls/MultistageParameterComboBoxView.xaml +++ b/VECTO3GUI2020/Views/Multistage/CustomControls/MultistageParameterComboBoxView.xaml @@ -6,30 +6,37 @@ xmlns:local="clr-namespace:VECTO3GUI2020.Views.Multistage.CustomControls" xmlns:helper="clr-namespace:VECTO3GUI2020.Helper" mc:Ignorable="d" - d:DesignHeight="450" d:DesignWidth="800" d:DataContext="{d:DesignInstance helper:MultistageParameterViewModel }"> + d:DesignHeight="450" d:DesignWidth="800" d:DataContext="{d:DesignInstance helper:MultistageParameterViewModel }" x:Name="ComboboxView"> <Grid> - <Grid> + <!--<Grid> <Grid.ColumnDefinitions> - <ColumnDefinition Width="4*" SharedSizeGroup="W"/> + --><!--<ColumnDefinition Width="4*" SharedSizeGroup="W"/> <ColumnDefinition Width="1*" SharedSizeGroup="N"/> <ColumnDefinition Width="4*" SharedSizeGroup="W"/> <ColumnDefinition Width="4*" SharedSizeGroup="W"/> - <ColumnDefinition Width="1*" SharedSizeGroup="N"/> - </Grid.ColumnDefinitions> + <ColumnDefinition Width="1*" SharedSizeGroup="N"/>--><!-- + <ColumnDefinition SharedSizeGroup=""></ColumnDefinition> + <ColumnDefinition SharedSizeGroup=""></ColumnDefinition> + <ColumnDefinition SharedSizeGroup=""></ColumnDefinition> + <ColumnDefinition SharedSizeGroup=""></ColumnDefinition> + <ColumnDefinition SharedSizeGroup=""></ColumnDefinition> + </Grid.ColumnDefinitions>--> - <Label x:Name="label1"> + <UniformGrid Rows="1" Margin="0 0 10 2"> + <DockPanel Margin="5 0"> + <Label x:Name="label1" DockPanel.Dock="Left"> <PriorityBinding> <Binding Path="Label" Converter="{StaticResource NullToUnsetValue}"></Binding> <!--<Binding Path="GeneratedLabelText"></Binding>--> </PriorityBinding> </Label> - <CheckBox Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center" Name="CheckBoxCombo" + <CheckBox DockPanel.Dock="Right" HorizontalAlignment="Right" VerticalAlignment="Center" Name="CheckBoxCombo" Visibility="{Binding ShowCheckBox, Converter={StaticResource BooleanToVisibilityConverter}}" IsChecked="{Binding EditingEnabled, Mode=TwoWay}" Checked="CheckBoxCombo_OnChecked"/> - - <ComboBox x:Name="comboBox" Grid.Column="2" HorizontalAlignment="Stretch" VerticalAlignment="Center" Margin="2 0 2 0" IsTabStop="False" + </DockPanel> + <ComboBox x:Name="comboBox" HorizontalAlignment="Stretch" VerticalAlignment="Center" Margin="2 0 2 0" IsTabStop="False" Visibility="{Binding Optional, Converter={StaticResource BooleanToVisibilityConverter}}" IsHitTestVisible="False" Focusable="False" IsEditable="False" SelectedValue="{Binding PreviousContent, Mode=TwoWay}" @@ -41,30 +48,35 @@ </ComboBox.ItemTemplate> </ComboBox> - <ComboBox x:Name="comboBoxCurrent" Grid.Column="3" HorizontalAlignment="Stretch" VerticalAlignment="Center" Margin="2 0 2 0" - SelectedValue="{Binding CurrentContent, - Mode=TwoWay, - ValidatesOnExceptions=True, - ValidatesOnDataErrors=True, - UpdateSourceTrigger=PropertyChanged}" - IsEnabled="{Binding ValueFieldIsEditable}" - IsEditable="False"> - <ComboBox.ItemsSource> - <PriorityBinding> - <Binding Path="AllowedItems" Converter="{StaticResource NullToUnsetValue}" UpdateSourceTrigger="PropertyChanged"/> - <Binding Path="GeneratedListItems" UpdateSourceTrigger="PropertyChanged"/> - </PriorityBinding> - </ComboBox.ItemsSource> - <ComboBox.ItemTemplate> - <DataTemplate> - <TextBlock x:Name="textBlock" Text="{Binding Converter={StaticResource EnumConverter}}" /> - </DataTemplate> - </ComboBox.ItemTemplate> - </ComboBox> + <DockPanel LastChildFill="True"> + <Label DockPanel.Dock="Right" x:Name="label2" Grid.Column="4" + Content="{Binding DummyContent, Converter={StaticResource SIToUnitStringConverter}}"> + </Label> + <ComboBox DockPanel.Dock="Left" x:Name="comboBoxCurrent" HorizontalAlignment="Stretch" VerticalAlignment="Center" Margin="2 0 2 0" + SelectedValue="{Binding CurrentContent, + Mode=TwoWay, + ValidatesOnExceptions=True, + ValidatesOnDataErrors=True, + UpdateSourceTrigger=PropertyChanged}" + IsEnabled="{Binding ValueFieldIsEditable}" + IsEditable="False"> + <ComboBox.ItemsSource> + <PriorityBinding> + <Binding Path="AllowedItems" Converter="{StaticResource NullToUnsetValue}" UpdateSourceTrigger="PropertyChanged"/> + <Binding Path="GeneratedListItems" UpdateSourceTrigger="PropertyChanged"/> + </PriorityBinding> + </ComboBox.ItemsSource> + <ComboBox.ItemTemplate> + <DataTemplate> + <TextBlock x:Name="textBlock" Text="{Binding Converter={StaticResource EnumConverter}}" /> + </DataTemplate> + </ComboBox.ItemTemplate> + </ComboBox> - <Label x:Name="label2" Grid.Column="4" - Content="{Binding DummyContent, Converter={StaticResource SIToUnitStringConverter}}"> - </Label> - </Grid> + + </DockPanel> + </UniformGrid> </Grid> + + <!--</Grid>--> </UserControl> diff --git a/VECTO3GUI2020/Views/Multistage/CustomControls/MultistageParameterComboBoxView.xaml.cs b/VECTO3GUI2020/Views/Multistage/CustomControls/MultistageParameterComboBoxView.xaml.cs index 16b02b44c4a8589d0e37456e9d1b280a3d1b985b..16f4c32de7f7901d47cf3c8c30d0b667f73574d2 100644 --- a/VECTO3GUI2020/Views/Multistage/CustomControls/MultistageParameterComboBoxView.xaml.cs +++ b/VECTO3GUI2020/Views/Multistage/CustomControls/MultistageParameterComboBoxView.xaml.cs @@ -20,7 +20,53 @@ namespace VECTO3GUI2020.Views.Multistage.CustomControls /// </summary> public partial class MultistageParameterComboBoxView : UserControl { - public MultistageParameterComboBoxView() + public static readonly DependencyProperty SharedSizeGroupLabelColumnProperty = DependencyProperty.Register( + "SharedSizeGroupLabelColumn", typeof(string), typeof(MultistageParameterComboBoxView), new PropertyMetadata(default(string))); + + //public string SharedSizeGroupLabelColumn + //{ + // get { return (string)GetValue(SharedSizeGroupLabelColumnProperty); } + // set { SetValue(SharedSizeGroupLabelColumnProperty, value); } + //} + + //public static readonly DependencyProperty SharedSizeGroupCheckboxColumnProperty = DependencyProperty.Register( + // "SharedSizeGroupCheckboxColumn", typeof(string), typeof(MultistageParameterComboBoxView), new PropertyMetadata(default(string))); + + //public string SharedSizeGroupCheckboxColumn + //{ + // get { return (string)GetValue(SharedSizeGroupCheckboxColumnProperty); } + // set { SetValue(SharedSizeGroupCheckboxColumnProperty, value); } + //} + + //public static readonly DependencyProperty SharedSizeGroupConsolidatedColumnProperty = DependencyProperty.Register( + // "SharedSizeGroupConsolidatedColumn", typeof(string), typeof(MultistageParameterComboBoxView), new PropertyMetadata(default(string))); + + //public string SharedSizeGroupConsolidatedColumn + //{ + // get { return (string)GetValue(SharedSizeGroupConsolidatedColumnProperty); } + // set { SetValue(SharedSizeGroupConsolidatedColumnProperty, value); } + //} + + //public static readonly DependencyProperty SharedSizeGroupContentColumnProperty = DependencyProperty.Register( + // "SharedSizeGroupContentColumn", typeof(string), typeof(MultistageParameterComboBoxView), new PropertyMetadata(default(string))); + + //public string SharedSizeGroupContentColumn + //{ + // get { return (string)GetValue(SharedSizeGroupContentColumnProperty); } + // set { SetValue(SharedSizeGroupContentColumnProperty, value); } + //} + + //public static readonly DependencyProperty SharedSizeGroupUnitColumnProperty = DependencyProperty.Register( + // "SharedSizeGroupUnitColumn", typeof(string), typeof(MultistageParameterComboBoxView), new PropertyMetadata(default(string))); + + //public string SharedSizeGroupUnitColumn + //{ + // get { return (string)GetValue(SharedSizeGroupUnitColumnProperty); } + // set { SetValue(SharedSizeGroupUnitColumnProperty, value); } + //} + + + public MultistageParameterComboBoxView() { InitializeComponent(); } diff --git a/VECTO3GUI2020/Views/Multistage/CustomControls/MultistageParameterTextView.xaml b/VECTO3GUI2020/Views/Multistage/CustomControls/MultistageParameterTextView.xaml index a6027864ec4393aa6775a26bd3a4fa2b02345286..67bba1d5e8f6ad9eeb7a5dd18cce77b480c96bc1 100644 --- a/VECTO3GUI2020/Views/Multistage/CustomControls/MultistageParameterTextView.xaml +++ b/VECTO3GUI2020/Views/Multistage/CustomControls/MultistageParameterTextView.xaml @@ -8,27 +8,29 @@ mc:Ignorable="d" d:DesignHeight="450" d:DesignWidth="800"> <Grid> - <Grid> + <UniformGrid Rows="1" Margin="0 0 10 2"> + <!--<Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="4*" SharedSizeGroup="W"/> <ColumnDefinition Width="1*" SharedSizeGroup="N"/> <ColumnDefinition Width="4*" SharedSizeGroup="W"/> <ColumnDefinition Width="4*" SharedSizeGroup="W"/> <ColumnDefinition Width="1*" SharedSizeGroup="N"/> - </Grid.ColumnDefinitions> + </Grid.ColumnDefinitions>--> - <Label x:Name="label" > + <DockPanel Margin="5 0"> + <Label x:Name="label" DockPanel.Dock="Left" > <PriorityBinding> <Binding Path="Label" Converter="{StaticResource NullToUnsetValue}"></Binding> <!--<Binding Path="GeneratedLabelText"></Binding>--> </PriorityBinding> </Label> - <CheckBox Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center" Name="EditingEnabledCheckBox" + <CheckBox DockPanel.Dock="Right" Grid.Column="1" HorizontalAlignment="Right" VerticalAlignment="Center" Name="EditingEnabledCheckBox" Visibility="{Binding ShowCheckBox, Converter={StaticResource BooleanToVisibilityConverter}}" IsChecked="{Binding EditingEnabled, Mode=TwoWay}"/> - + </DockPanel> <TextBox x:Name="textBox" Grid.Column="2" VerticalAlignment="Center" Margin="2 0 2 0" IsReadOnly="True" IsTabStop="False" Text="{Binding Path=PreviousContent, Converter={StaticResource SIValueToStringConverter}}" @@ -37,18 +39,21 @@ Visibility="{Binding Optional, Converter={StaticResource BooleanToVisibilityConverter}, UpdateSourceTrigger=PropertyChanged}"/> - <TextBox Grid.Column="3" Name ="TextBoxContent" VerticalAlignment="Center" Margin="2 0 2 0" - Text="{Binding CurrentContent, Mode=TwoWay, + <DockPanel> + <Label DockPanel.Dock="Right" Grid.Column="4" x:Name="AutoUnitLabel" + Content="{Binding DummyContent, Converter={StaticResource SIToUnitStringConverter}}"> + </Label> + <TextBox DockPanel.Dock="Left" Grid.Column="3" Name ="TextBoxContent" VerticalAlignment="Center" Margin="2 0 2 0" + Text="{Binding CurrentContent, Mode=TwoWay, Converter={StaticResource SIValueToStringConverter}, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True, ValidatesOnExceptions=True}" - Style="{DynamicResource TextBoxStyle1}" - IsReadOnly="{Binding + Style="{DynamicResource TextBoxStyle1}" + IsReadOnly="{Binding Path=EditingEnabled, Converter={StaticResource InvertBoolConverter}}" MouseDoubleClick="Control_OnMouseDoubleClick"/> - <Label Grid.Column="4" x:Name="AutoUnitLabel" - Content="{Binding DummyContent, Converter={StaticResource SIToUnitStringConverter}}"> - </Label> - </Grid> + + </DockPanel> + </UniformGrid> </Grid> </UserControl>