-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathModBar.xaml
More file actions
110 lines (110 loc) · 6.69 KB
/
ModBar.xaml
File metadata and controls
110 lines (110 loc) · 6.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<UserControl x:Class="ModShardLauncher.Controls.ModBar"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:controls="clr-namespace:ModShardLauncher.Controls"
xmlns:main="clr-namespace:ModShardLauncher"
mc:Ignorable="d"
d:DesignHeight="112" d:DesignWidth="800"
MaxHeight="112" MaxWidth="800"
d:DataContext="{d:DesignInstance main:ModFile}">
<Grid Background="#1B1926">
<Grid.Resources>
<controls:ByteArrayToImageSourceConverter x:Key="converter"/>
</Grid.Resources>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Grid HorizontalAlignment="Left" Width="112" Grid.Column="0">
<Border Width="80" Height="80" VerticalAlignment="Top"
HorizontalAlignment="Left" Margin="16,16,0,0"
Background="#2C2D39">
<Image x:Name="ModIcon" Width="80" Height="80" Stretch="Fill"
RenderOptions.BitmapScalingMode="NearestNeighbor"
Source="{Binding Icon, Converter={StaticResource converter}}"/>
</Border>
<Image Source="/Resources/Sprites/mod_icon_fore.png"
RenderOptions.BitmapScalingMode="NearestNeighbor"/>
</Grid>
<Grid HorizontalAlignment="Right" MaxWidth="688" Grid.Column="1">
<Border HorizontalAlignment="Left" VerticalAlignment="Top"
Height="6" IsEnabled="False" Margin="20,38,20,0" Width="Auto">
<Image Source="/Resources/Sprites/splitter.png" Stretch="Fill"
RenderOptions.BitmapScalingMode="NearestNeighbor"
RenderOptions.ClearTypeHint="Enabled"/>
</Border>
<Label Name="ModName" HorizontalAlignment="Left"
Margin="16,14,0,0" VerticalAlignment="Top"
Content="{Binding instance.Name}" Foreground="White"
FontSize="15" Style="{StaticResource xFont}"/>
<Label Name="ModAuthor" HorizontalAlignment="Right"
Margin="0,14,16,0" VerticalAlignment="Top"
Content="{Binding instance.Author}" Foreground="White"
FontSize="15" Style="{StaticResource xFont}"/>
<TextBlock x:Name="ModDescription" HorizontalAlignment="Left"
Margin="32,56,0,0" VerticalAlignment="Top"
Foreground="#9D9A9A" FontSize="10" Style="{StaticResource sFont}"
Width="320" MaxHeight="36"
TextWrapping="Wrap" Text="{Binding instance.Description}"/>
<GridSplitter Width="2" Height="48" HorizontalAlignment="Center" VerticalAlignment="Bottom"
Margin="12" Background="#33323F"/>
<CheckBox HorizontalAlignment="Right" Margin="0,32,128,0" Content="{DynamicResource Enable}"
FontFamily="{StaticResource ssFont}" Foreground="#FFFFFF" IsChecked="{Binding Enabled, Mode=TwoWay}">
<CheckBox.Style>
<Style TargetType="CheckBox">
<Setter Property="IsChecked" Value="False"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="CheckBox">
<DockPanel Background="{TemplateBinding Background}"
LastChildFill="False" Width="{TemplateBinding Width}"
RenderOptions.BitmapScalingMode="NearestNeighbor">
<Image Margin="2,0,4,2" DockPanel.Dock="Left" Height="25" Width="25"
x:Name="_img" Stretch="Fill" Source="/Resources/Sprites/checkbox_0.png"/>
<TextBlock DockPanel.Dock="Left" Foreground="{TemplateBinding Foreground}"
Margin="2,0,0,0" VerticalAlignment="Center"
Text="{TemplateBinding Content}"/>
</DockPanel>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="True">
<Setter TargetName="_img" Property="Source" Value="/Resources/Sprites/checkbox_1.png"/>
</Trigger>
<Trigger Property="IsChecked" Value="{x:Null}">
<Setter TargetName="_img" Property="Source" Value="/Resources/Sprites/checkbox_2.png"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</CheckBox.Style>
</CheckBox>
<Label Name="ModVersion" HorizontalAlignment="Right"
Margin="0,0,12,4" VerticalAlignment="Bottom"
Foreground="#95796A" FontSize="8" Opacity="0.7">
<TextBlock Style="{StaticResource sFont}">
<Run Text="{DynamicResource ModVersion}"/>
<Run Text=":"/>
<Run Text="{Binding instance.Version, Mode=OneWay}"/>
</TextBlock>
</Label>
<Label Name="GameVersion" HorizontalAlignment="Right"
Margin="0,0,160,4" VerticalAlignment="Bottom"
Foreground="#95796A" FontSize="8" Opacity="0.7">
<TextBlock Style="{StaticResource sFont}">
<Run Text="{DynamicResource GameVersion}"/>
<Run Text=":"/>
<Run Text="{Binding Version, Mode=OneWay}"/>
</TextBlock>
</Label>
<Border BorderBrush="#43424D" BorderThickness="4"/>
<Border BorderBrush="#2C2D39" BorderThickness="3"/>
<Border BorderBrush="#43424D" BorderThickness="2"/>
<Border BorderBrush="#1B1926" BorderThickness="1"/>
</Grid>
</Grid>
</UserControl>