Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit 282acfb8 authored by Franz KOBER josef's avatar Franz KOBER josef
Browse files

minor changes of the component tabs style

parent daa1d530
No related branches found
No related tags found
No related merge requests found
......@@ -45,6 +45,7 @@
<ResourceDictionary Source="Resources/GlobalStyles.xaml"/>
<ResourceDictionary Source="Resources/StringResources.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
......
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;
using VECTO3GUI.Util;
namespace VECTO3GUI.Helper
{
public class ComponentTitleConverter : BaseConverter, IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value is Component) {
var component = (Component)value;
switch (component) {
case Component.Vehicle:
case Component.PrimaryBusVehicle:
case Component.CompleteBusVehicle:
return nameof(Component.Vehicle);
case Component.Engine:
return nameof(Component.Engine);
case Component.Gearbox:
return nameof(Component.Gearbox);
case Component.TorqueConverter:
return "Torque Converter";
case Component.Retarder:
return "Retarder";
case Component.Angledrive:
return "Angle Drive";
case Component.Axlegear:
return "Axle Gear";
case Component.PTO:
return "Power Take Off";
case Component.Airdrag:
return "Air Drag";
case Component.Axles:
return "Axle";
case Component.Auxiliaries:
case Component.BusAuxiliaries:
return "Auxiliary";
case Component.Cycle:
return nameof(Component.Cycle);
}
}
return value;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}
......@@ -9,5 +9,27 @@
<Style TargetType="{x:Type Button}" BasedOn="{StaticResource MetroButton}">
<Setter Property="mah:ControlsHelper.ContentCharacterCasing" Value="Normal"/>
<Setter Property="VerticalAlignment" Value="Center"/>
</Style>
<Style TargetType="TabControl" BasedOn="{StaticResource MetroTabControl}">
<!-- <Setter Property="BorderThickness" Value="0,1,0,0"/> -->
<!-- <Setter Property="BorderBrush" Value="Black"/> -->
<!-- <Setter Property="ClipToBounds" Value="True"></Setter> -->
</Style>
<Style TargetType="TabItem" BasedOn="{StaticResource MetroTabItem}" >
<Setter Property="ClipToBounds" Value="True"/>
<Setter Property="BorderThickness" Value="0,0,0,4"/>
<Setter Property="BorderBrush" Value="Gray"/>
<Setter Property="Margin" Value="1"/>
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="BorderBrush" Value="Black"/>
</Trigger>
</Style.Triggers>
</Style>
</ResourceDictionary>
\ No newline at end of file
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:VECTO3GUI.Resources"
xmlns:system="clr-namespace:System;assembly=mscorlib">
<system:String x:Key="close">Close</system:String>
</ResourceDictionary>
\ No newline at end of file
......@@ -154,6 +154,7 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
<Compile Include="Helper\ComponentTitleConverter.cs" />
<Compile Include="Helper\FileDialogHelper.cs" />
<Compile Include="Helper\OutputWindowHelper.cs" />
<Compile Include="Model\InterfacesImpl.cs" />
......@@ -376,6 +377,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Resources\StringResources.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Resources\ViewModelMappings.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
......
......@@ -7,6 +7,7 @@
xmlns:interfaces="clr-namespace:VECTO3GUI.ViewModel.Interfaces"
xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
xmlns:impl="clr-namespace:VECTO3GUI.ViewModel.Impl"
xmlns:helper="clr-namespace:VECTO3GUI.Helper"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
......@@ -26,7 +27,7 @@
<Grid Grid.Row="1">
<TabControl ItemsSource="{Binding Components}" x:Name="ComponentsTab" SelectedIndex="0">
<TabControl TabStripPlacement="Top" ItemsSource="{Binding Components}" x:Name="ComponentsTab" SelectedIndex="0">
<i:Interaction.Triggers>
<i:EventTrigger EventName="SelectionChanged">
......@@ -39,7 +40,7 @@
<TabControl.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding}"/>
<TextBlock Text="{Binding Converter={helper:ComponentTitleConverter}}" />
</DataTemplate>
</TabControl.ItemTemplate>
......@@ -47,7 +48,7 @@
<DataTemplate>
<ScrollViewer DockPanel.Dock="Top">
<ContentControl Content="{Binding DataContext.CurrentComponent,
RelativeSource={RelativeSource AncestorType=local:JoblistTabView}}" MinHeight="100"/>
RelativeSource={RelativeSource AncestorType=local:JoblistTabView}}" Margin="0,20,0,10"/>
</ScrollViewer>
</DataTemplate>
</TabControl.ContentTemplate>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment