-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMainWindow.xaml
148 lines (142 loc) · 10.4 KB
/
MainWindow.xaml
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
<Window x:Name="mainWindow" x:Class="ToSAddonManager.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:ToSAddonManager"
mc:Ignorable="d"
Title="ToS Addon Manager" Height="650" Width="1191.646" WindowStartupLocation="CenterScreen" Loaded="MainWindow_Loaded" Closing="MainWindow_Closing" Icon="{DynamicResource ProgramIcon}">
<Window.Resources>
<DataTemplate x:Key="storedTemplate">
<Border Background="{Binding installStatusColor}" BorderBrush="Black" BorderThickness="1" Margin="5" CornerRadius="5">
<Grid Width="350" Height="150" Margin="10">
<Grid.RowDefinitions>
<RowDefinition Height="60"/>
<RowDefinition Height="10"/>
<RowDefinition/>
</Grid.RowDefinitions>
<StackPanel Orientation="Horizontal" Grid.Row="0">
<TextBlock Text="{Binding name}" FontWeight="Bold" FontSize="14"/>
<TextBlock Text="{Binding author}" FontSize="10" Margin="3,3,0,0"/>
</StackPanel>
<Label Content="{Binding authorRepoUri}" Margin="-5,13,0,0" FontSize="14"/>
<StackPanel Orientation="Horizontal" Margin="0,40,0,0">
<TextBlock Text="{Binding availableVersion}" FontSize="10"/>
<TextBlock Text="{Binding installedVersion}" FontSize="10" Margin="5,0,0,0"/>
</StackPanel>
<Separator Grid.Row="1" />
<TextBlock Text="{Binding description}" Margin="0,0,0,0" FontSize="12" TextWrapping="Wrap" Grid.Row="2"/>
<Border x:Name="controlBoxBorder" BorderBrush="Black" BorderThickness="1" Margin="0" CornerRadius="5" Grid.Row="2" Panel.ZIndex="1" Background="White" VerticalAlignment="Bottom" HorizontalAlignment="Center" Width="345" Height="0">
<Grid x:Name="controlBox" Background="White" HorizontalAlignment="Center">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Image x:Name="controlBoxInfo" Source="{StaticResource infoIcon}" Height="35" Grid.Column="0" MouseDown="mouseClickInfoAction" Margin="5,0,5,0"/>
<Image x:Name="controlBoxInstall" Source="{StaticResource installIcon}" Height="35" Grid.Column="1" MouseDown="mouseClickInstallAction" Visibility="{Binding allowInstall}" Margin="5,0,5,0"/>
<Image x:Name="controlBoxDelete" Source="{StaticResource deleteIcon}" Height="35" Grid.Column="2" MouseDown="mouseClickUninstallAction" Visibility="{Binding allowDelete}" Margin="5,0,5,0"/>
</Grid>
</Border>
</Grid>
<Border.Effect>
<DropShadowEffect ShadowDepth="5" Opacity=".25"/>
</Border.Effect>
</Border>
<DataTemplate.Triggers>
<EventTrigger RoutedEvent="MouseEnter">
<EventTrigger.Actions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetName="controlBoxBorder" Storyboard.TargetProperty="Height" From="0" To="50" Duration="0:0:.2"/>
<DoubleAnimation Storyboard.TargetName="controlBoxInstall" Storyboard.TargetProperty="Height" From="0" To="35" Duration="0:0:.2"/>
<DoubleAnimation Storyboard.TargetName="controlBoxInfo" Storyboard.TargetProperty="Height" From="0" To="35" Duration="0:0:.2"/>
<DoubleAnimation Storyboard.TargetName="controlBoxDelete" Storyboard.TargetProperty="Height" From="0" To="35" Duration="0:0:.2"/>
</Storyboard>
</BeginStoryboard>
</EventTrigger.Actions>
</EventTrigger>
<EventTrigger RoutedEvent="MouseLeave">
<EventTrigger.Actions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetName="controlBoxBorder" Storyboard.TargetProperty="Height" From="50.0" To="0.0" Duration="0:0:.1"/>
</Storyboard>
</BeginStoryboard>
</EventTrigger.Actions>
</EventTrigger>
</DataTemplate.Triggers>
</DataTemplate>
</Window.Resources>
<DockPanel x:Name="dockPanel">
<Menu Background="{x:Null}" DockPanel.Dock="Top" VerticalAlignment="Top">
<MenuItem Header="_File" InputGestureText="Alt+F" FontSize="18">
<MenuItem x:Name="MenuItemSelectToSDir" Header="_Select ToS Install Directory" Click="MenuItemSelectToSDir_Click"/>
<Separator/>
<MenuItem x:Name="CheckForUpdates" Header="_Check For Program Updates" Click="checkForUpdates"/>
<MenuItem x:Name="AllowAutoCheck" Header="_Allow Automatic Program Update Check" IsCheckable="True" Click="allowAutomaticUpdatesCheckChanged"/>
<Separator/>
<MenuItem x:Name="MenuItemExitButton" Header="E_xit" Click="exitButtonClicked"/>
</MenuItem>
<MenuItem Header="_Addons" InputGestureText="Alt+A" FontSize="18">
<MenuItem x:Name="MenuItemUpdateCache" Header="_Update Repo Cache" Click="MenuItemUpdateCache_Click"/>
<MenuItem x:Name="MenuItemUpdateDeps" Header="U_pdate Dependencies" Click="MenuItemUpdateDeps_Click"/>
<Separator/>
<MenuItem x:Name="FindExistingAddons" Header="_Find Existing Addons" Click="FindExistingAddons_Click"/>
</MenuItem>
</Menu>
<Grid DockPanel.Dock="Top" HorizontalAlignment="Right" Width="485" Margin="0,0,10,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="80"/>
<ColumnDefinition Width="75"/>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="110"/>
<ColumnDefinition Width="120"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<TextBlock x:Name="filterTextBlock" Text="Filter: " FontWeight="Bold" FontSize="18" Grid.Column="0" Grid.Row="0" HorizontalAlignment="Right" Margin="0,0,10,0"/>
<TextBox x:Name="filterTB" Height="30" VerticalAlignment="Top" KeyDown="filterTBKeyDownHandler" FontSize="18" HorizontalAlignment="Right" Width="405" Grid.Column="1" Grid.Row="0" Grid.ColumnSpan="4"/>
<RadioButton x:Name="filterGroupAll" GroupName="filterGroup" Content="All" FontSize="18" IsChecked="True" VerticalContentAlignment="Center" Checked="FilterGroupCheckChanged" Grid.Column="1" Grid.Row="1"/>
<RadioButton x:Name="filterGroupInstalled" GroupName="filterGroup" Content="Installed" FontSize="18" VerticalContentAlignment="Center" Checked="FilterGroupCheckChanged" Grid.Column="2" Grid.Row="1"/>
<RadioButton x:Name="filterGroupUpdatable" GroupName="filterGroup" Content="Updatable" FontSize="18" VerticalContentAlignment="Center" Checked="FilterGroupCheckChanged" Grid.Column="3" Grid.Row="1"/>
<RadioButton x:Name="filterGroupWhatsNew" GroupName="filterGroup" Content="What's New" FontSize="18" VerticalContentAlignment="Center" Checked="FilterGroupCheckChanged" Grid.Column="4" Grid.Row="1"/>
<Separator Grid.Column="1" Grid.Row="2" Grid.ColumnSpan="4"/>
<TextBlock x:Name="sortTextBlock" Text="Sort: " VerticalAlignment="Top" FontSize="18" FontWeight="Bold" HorizontalAlignment="Right" Width="48" Margin="0,0,10,0" Grid.Column="0" Grid.Row="3"/>
<RadioButton x:Name="sortGroupAddonName" GroupName="sortGroup" Content="Name" FontSize="18" IsChecked="True" VerticalContentAlignment="Center" Checked="FilterGroupCheckChanged" Grid.Column="1" Grid.Row="3"/>
<RadioButton x:Name="sortGroupAuthorName" GroupName="sortGroup" Content="Author" FontSize="18" VerticalContentAlignment="Center" Checked="FilterGroupCheckChanged" Grid.Column="2" Grid.Row="3"/>
<RadioButton x:Name="sortGroupUpdatedDate" GroupName="sortGroup" Content="Updated" FontSize="18" VerticalContentAlignment="Center" Checked="FilterGroupCheckChanged" Grid.Column="3" Grid.Row="3"/>
</Grid>
<StatusBar x:Name="statusBar1" Height="35" Background="{x:Null}" BorderBrush="Black" DockPanel.Dock="Bottom">
<TextBlock x:Name="statusBar1TextBlock" FontSize="14" Margin="5,0,0,0"/>
</StatusBar>
<TabControl x:Name="repoTabs" SelectionChanged="RepoTabs_SelectionChanged">
<TabItem Header="iToS" FontSize="18">
<ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto">
<ItemsControl x:Name="iToSIC" ItemTemplate="{DynamicResource storedTemplate}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
</ItemsControl>
</ScrollViewer>
</TabItem>
<TabItem Header="jToS" FontSize="18">
<ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto">
<ItemsControl x:Name="jToSIC" ItemTemplate="{DynamicResource storedTemplate}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
</ItemsControl>
</ScrollViewer>
</TabItem>
</TabControl>
</DockPanel>
</Window>