Skip to content

Commit f636b9a

Browse files
committed
Worked on explorer window
1 parent f84d62a commit f636b9a

File tree

1 file changed

+223
-101
lines changed

1 file changed

+223
-101
lines changed

Main/MainWindow.xaml

Lines changed: 223 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -13,113 +13,235 @@
1313
<local:MainWindowViewModel/>
1414
</Window.DataContext>
1515

16-
<!--Sets the background-->
17-
<Controls:MetroWindow.Background>
18-
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
19-
<GradientStop Color="#1E2931" Offset="0.0" />
20-
<GradientStop Color="#384D5A" Offset="1.0" />
16+
<!--Applies the gradient background-->
17+
<Window.Background>
18+
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
19+
<GradientStop Color="#1E2931" Offset="0.0"/>
20+
<GradientStop Color="#384D5A" Offset="1.0"/>
2121
</LinearGradientBrush>
22-
</Controls:MetroWindow.Background>
22+
</Window.Background>
23+
24+
<!--GRID EXPLORER WINDOW-->
2325
<Grid>
24-
<Grid>
25-
<Grid.ColumnDefinitions>
26-
<ColumnDefinition Width="200" MinWidth="100"/>
27-
<ColumnDefinition Width="100*"/>
28-
</Grid.ColumnDefinitions>
29-
<Grid Grid.Column="0">
30-
<Grid.RowDefinitions>
31-
<RowDefinition Height="110"/>
32-
<RowDefinition Height="32"/>
33-
<RowDefinition/>
34-
</Grid.RowDefinitions>
26+
<Grid.ColumnDefinitions>
27+
<ColumnDefinition Width="300" MinWidth="100"/>
28+
<ColumnDefinition Width="100*"/>
29+
</Grid.ColumnDefinitions>
3530

36-
<StackPanel Grid.Row="0" Background="Red">
37-
<TextBlock Text="User Picture and name. (dropdown when clicked on the picture to show a button to open the settings window)" TextWrapping="Wrap"/>
38-
</StackPanel>
39-
<StackPanel Grid.Row="1" Background="Yellow">
40-
<TextBlock Text="Search bar"/>
31+
<Grid Grid.Column="0" Background="#1E2931">
32+
<Grid.RowDefinitions>
33+
<RowDefinition Height="auto"/>
34+
<RowDefinition Height="auto"/>
35+
<RowDefinition/>
36+
</Grid.RowDefinitions>
37+
38+
<!--USER-->
39+
<Border Grid.Row="0" Background="Transparent" Padding="0,50">
40+
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
41+
<TextBlock
42+
Text="PPHere"
43+
VerticalAlignment="Center"
44+
45+
FontSize="21"
46+
FontFamily="{StaticResource Lato}"
47+
FontWeight="Regular"
48+
Foreground="White"/>
49+
<TextBlock
50+
Text="Hi, nameHere"
51+
VerticalAlignment="Center"
52+
53+
FontSize="21"
54+
FontFamily="{StaticResource Lato}"
55+
FontWeight="Regular"
56+
Foreground="White"
57+
58+
Opacity="0.5"/>
4159
</StackPanel>
60+
</Border>
4261

43-
<ListBox x:Name="DriveListBox" ItemsSource="{Binding DriveList}" SelectedItem="{Binding SelectedDriveFolder}" Background="Transparent" Grid.Row="2" BorderThickness="0">
44-
<!--Styles the listbox containing the drives.-->
45-
<ListBox.ItemContainerStyle>
46-
<Style TargetType="ListBoxItem">
47-
<Setter Property="TextBlock.Foreground" Value="white"/>
48-
<Setter Property="Background" Value="Transparent" />
49-
<Setter Property="Margin" Value="0,0,0,0" />
50-
<Setter Property="FontSize" Value="15"/>
51-
<Setter Property="TextBlock.Foreground" Value="white"/>
52-
</Style>
53-
</ListBox.ItemContainerStyle>
54-
<ListBox.Resources>
55-
<local:MainWindowViewModel x:Key="converter"/>
56-
</ListBox.Resources>
57-
<i:Interaction.Triggers>
58-
<i:EventTrigger SourceName="DriveListBox" EventName="MouseLeftButtonUp">
59-
<i:InvokeCommandAction Command="{Binding DataContext.GetChildrenFomDriveCommand, RelativeSource={RelativeSource AncestorType={x:Type ListBox}}}"/>
60-
</i:EventTrigger>
61-
</i:Interaction.Triggers>
62-
<ListBox.ItemTemplate>
63-
<DataTemplate>
64-
<!--<StackPanel >-->
65-
<StackPanel x:Name="DrivesStackPanel" Background="{Binding Path=RemoteItem, Converter={StaticResource converter}}">
66-
<Grid >
67-
<Grid.ColumnDefinitions>
68-
<ColumnDefinition Width="150"/>
69-
<ColumnDefinition Width="*"/>
70-
<ColumnDefinition Width="20"/>
71-
</Grid.ColumnDefinitions>
72-
<TextBlock x:Name="DriveName" Grid.Column="0" HorizontalAlignment="Left" Background="Transparent" Text="{Binding Name}"/>
73-
<TextBlock x:Name="DriveChildCount" Grid.Column="2" HorizontalAlignment="Right" Background="Transparent" TextAlignment="Right" Text="{Binding Folder.ChildCount}"/>
74-
</Grid>
62+
<!--SEARCH INPUT-->
63+
<!--<StackPanel
64+
Grid.Row="1"
65+
Background="Yellow">
66+
<TextBlock Text="Search bar"/>
67+
</StackPanel>-->
7568

76-
</StackPanel>
77-
<!--</StackPanel>-->
78-
</DataTemplate>
79-
</ListBox.ItemTemplate>
80-
</ListBox>
81-
<Button Command="{Binding LogoutCommand}" Grid.Row="2" Height="40" VerticalAlignment="Bottom" Content="Logout"></Button>
82-
</Grid>
83-
<Grid Grid.Column="1">
84-
<Grid.RowDefinitions>
85-
<RowDefinition Height="50"/>
86-
<RowDefinition Height="30"/>
87-
<RowDefinition Height="30" />
88-
<RowDefinition Height="85*" />
89-
</Grid.RowDefinitions>
90-
<Rectangle Grid.Row="0" Fill="Gray"/>
91-
<StackPanel Grid.Row="0" Background="Gray">
92-
<TextBlock Text="Idk what needs to go here."/>
93-
</StackPanel>
94-
<Rectangle Grid.Row="1" Fill="Purple"/>
95-
<StackPanel Grid.Row="1" Background="Purple">
96-
<TextBlock Text="The titles of the rows for example. 'Name', 'Contents' and 'Size'"/>
97-
</StackPanel>
98-
<Rectangle Grid.Row="2" Fill="Orange"/>
99-
<StackPanel Grid.Row="2" Background="Orange">
100-
<TextBlock Text="The position where the element goes that brings the user back to the parent folder."/>
101-
</StackPanel>
102-
<ListBox x:Name="ExplorerListBox" ItemsSource="{Binding ExplorerItemsList}" SelectedItem="{Binding SelectedExplorerItem}" Background="Transparent" Grid.Row="3" HorizontalAlignment="Stretch">
103-
<ListBox.Resources>
104-
<!--Make the listbox items transparent.-->
105-
<Style TargetType="{x:Type ListBoxItem}">
106-
<Setter Property="Background" Value="Transparent" />
107-
<Setter Property="Margin" Value="0" />
108-
<Setter Property="TextBlock.Foreground" Value="white"/>
109-
</Style>
110-
</ListBox.Resources>
111-
<ListBox.ItemTemplate>
112-
<DataTemplate>
113-
<StackPanel x:Name="FolderStackPanel" Background="Transparent" Orientation="Horizontal" HorizontalAlignment="Stretch">
114-
<StackPanel.InputBindings>
115-
<MouseBinding MouseAction="LeftDoubleClick" Command="{Binding DataContext.GetChildrenFomItemCommand, RelativeSource={RelativeSource AncestorType={x:Type ListBox}}}"/>
116-
</StackPanel.InputBindings>
117-
<TextBlock x:Name="ExplorerItem" Background="Transparent" Text="{Binding Name}"/>
118-
</StackPanel>
119-
</DataTemplate>
120-
</ListBox.ItemTemplate>
121-
</ListBox>
122-
</Grid>
69+
<TextBox
70+
Text="Search..."
71+
Grid.Row="1"
72+
73+
FontSize="21"
74+
FontFamily="{StaticResource Lato}"
75+
FontWeight="Regular"
76+
Foreground="White"
77+
78+
Background="Transparent"
79+
BorderBrush="#FFFFFF"
80+
BorderThickness="2"
81+
Padding="20, 15, 15, 15"
82+
Margin="0, 0, 0, 50"
83+
Opacity="0.2">
84+
85+
<!--Text="{Binding SearchText, UpdateSourceTrigger=PropertyChanged}"-->
86+
</TextBox>
87+
88+
<!--CATEGORY LIST-->
89+
<ListBox
90+
x:Name="DriveListBox"
91+
Grid.Row="2"
92+
93+
Background="Transparent"
94+
BorderThickness="0"
95+
96+
ItemsSource="{Binding DriveList}"
97+
SelectedItem="{Binding SelectedDriveFolder}">
98+
<!--Styles the listbox containing the drives.-->
99+
<ListBox.ItemContainerStyle>
100+
<Style TargetType="ListBoxItem">
101+
<Setter Property="Background" Value="Transparent"/>
102+
103+
<Setter Property="FontSize" Value="16"/>
104+
<Setter Property="FontFamily" Value="{StaticResource Lato}"/>
105+
<Setter Property="FontWeight" Value="Regular"/>
106+
<Setter Property="Foreground" Value="white"/>
107+
<Setter Property="Padding" Value="0"/>
108+
</Style>
109+
</ListBox.ItemContainerStyle>
110+
111+
<ListBox.Resources>
112+
<local:MainWindowViewModel x:Key="converter"/>
113+
</ListBox.Resources>
114+
115+
<i:Interaction.Triggers>
116+
<i:EventTrigger SourceName="DriveListBox" EventName="MouseLeftButtonUp">
117+
<i:InvokeCommandAction Command="{Binding DataContext.GetChildrenFomDriveCommand, RelativeSource={RelativeSource AncestorType={x:Type ListBox}}}"/>
118+
</i:EventTrigger>
119+
</i:Interaction.Triggers>
120+
121+
<ListBox.ItemTemplate>
122+
<DataTemplate>
123+
<StackPanel x:Name="DrivesStackPanel" Background="{Binding Path=RemoteItem, Converter={StaticResource converter}}">
124+
<Grid >
125+
<Grid.ColumnDefinitions>
126+
<ColumnDefinition Width="auto"/>
127+
<ColumnDefinition Width="*" MaxWidth="200"/>
128+
<ColumnDefinition Width="*"/>
129+
</Grid.ColumnDefinitions>
130+
131+
<Border Grid.Column="0" Height="50" Margin="0, 0, 20, 0">
132+
<Border.Style>
133+
<Style TargetType="Border">
134+
<Setter Property="BorderBrush" Value="Transparent"/>
135+
<Setter Property="BorderThickness" Value="2"/>
136+
<Style.Triggers>
137+
<DataTrigger Binding="{Binding IsSelected, RelativeSource={RelativeSource AncestorType=ListBoxItem}}" Value="True">
138+
<Setter Property="BorderBrush" Value="#1D8C72"/>
139+
</DataTrigger>
140+
</Style.Triggers>
141+
</Style>
142+
</Border.Style>
143+
</Border>
144+
145+
<TextBlock x:Name="DriveName" Grid.Column="1" HorizontalAlignment="Left" VerticalAlignment="Center" Background="Transparent" Text="{Binding Name}">
146+
<TextBlock.Style>
147+
<Style TargetType="TextBlock">
148+
<Setter Property="Opacity" Value="0.25"/>
149+
<Style.Triggers>
150+
<DataTrigger Binding="{Binding IsSelected, RelativeSource={RelativeSource AncestorType=ListBoxItem}}" Value="True">
151+
<Setter Property="Opacity" Value="1"/>
152+
</DataTrigger>
153+
</Style.Triggers>
154+
</Style>
155+
</TextBlock.Style>
156+
</TextBlock>
157+
158+
<TextBlock x:Name="DriveChildCount" Grid.Column="2" HorizontalAlignment="Right" VerticalAlignment="Center" Background="Transparent" TextAlignment="Right" Padding="0, 0, 10, 0" Text="{Binding Folder.ChildCount}">
159+
<TextBlock.Style>
160+
<Style TargetType="TextBlock">
161+
<Setter Property="Opacity" Value="0.25"/>
162+
<Style.Triggers>
163+
<DataTrigger Binding="{Binding IsSelected, RelativeSource={RelativeSource AncestorType=ListBoxItem}}" Value="True">
164+
<Setter Property="Opacity" Value="1"/>
165+
</DataTrigger>
166+
</Style.Triggers>
167+
</Style>
168+
</TextBlock.Style>
169+
</TextBlock>
170+
</Grid>
171+
</StackPanel>
172+
</DataTemplate>
173+
</ListBox.ItemTemplate>
174+
</ListBox>
175+
<!-- LOGOUT BUTTON -->
176+
<Button Command="{Binding LogoutCommand}" Grid.Row="2" Height="40" VerticalAlignment="Bottom" Content="Logout"></Button>
177+
</Grid>
178+
179+
<Grid Grid.Column="1">
180+
<Grid.RowDefinitions>
181+
<RowDefinition Height="auto"/>
182+
<RowDefinition Height="30"/>
183+
<RowDefinition Height="30" />
184+
<RowDefinition Height="85*"/>
185+
</Grid.RowDefinitions>
186+
187+
<StackPanel Grid.Row="0" Background="Transparent">
188+
<TextBlock
189+
x:Name="DriveName"
190+
Text="{Binding SelectedDriveFolder.Name}"
191+
192+
FontSize="34"
193+
FontFamily="{StaticResource Lato}"
194+
FontWeight="Regular"
195+
Foreground="White"
196+
197+
Padding="60, 30"/>
198+
</StackPanel>
199+
200+
<StackPanel Grid.Row="1" Background="Purple">
201+
<TextBlock Text="The titles of the rows for example. 'Name', 'Contents' and 'Size'"/>
202+
</StackPanel>
203+
204+
<StackPanel Grid.Row="2" Background="Orange">
205+
<TextBlock Text="The position where the element goes that brings the user back to the parent folder."/>
206+
</StackPanel>
207+
208+
<ListBox x:Name="ExplorerListBox" ItemsSource="{Binding ExplorerItemsList}" SelectedItem="{Binding SelectedExplorerItem}" Background="Transparent" Grid.Row="3" HorizontalAlignment="Stretch">
209+
<!--Styles the listbox containing the drives.-->
210+
<ListBox.ItemContainerStyle>
211+
<Style TargetType="ListBoxItem">
212+
<Setter Property="Background" Value="Transparent"/>
213+
214+
<Setter Property="FontSize" Value="16"/>
215+
<Setter Property="FontFamily" Value="{StaticResource Lato}"/>
216+
<Setter Property="FontWeight" Value="Regular"/>
217+
<Setter Property="Foreground" Value="white"/>
218+
<Setter Property="Padding" Value="0"/>
219+
<Setter Property="HorizontalAlignment" Value="Stretch"/>
220+
</Style>
221+
</ListBox.ItemContainerStyle>
222+
223+
<ListBox.Resources>
224+
<!--Make the listbox items transparent.-->
225+
<Style TargetType="{x:Type ListBoxItem}">
226+
<Setter Property="Background" Value="Transparent" />
227+
<Setter Property="Margin" Value="0" />
228+
<Setter Property="TextBlock.Foreground" Value="white"/>
229+
</Style>
230+
</ListBox.Resources>
231+
232+
<ListBox.ItemTemplate>
233+
<DataTemplate>
234+
<StackPanel x:Name="FolderStackPanel" Background="Transparent" Orientation="Horizontal" HorizontalAlignment="Stretch" Height="50">
235+
<StackPanel.InputBindings>
236+
<MouseBinding MouseAction="LeftDoubleClick" Command="{Binding DataContext.GetChildrenFomItemCommand, RelativeSource={RelativeSource AncestorType={x:Type ListBox}}}"/>
237+
</StackPanel.InputBindings>
238+
<Border BorderThickness="0, 0, 0, 2" BorderBrush="#3A454E">
239+
<TextBlock x:Name="ExplorerItem" Text="{Binding Name}" VerticalAlignment="Center" Background="Red" Padding="40, 15, 15, 15"/>
240+
</Border>
241+
</StackPanel>
242+
</DataTemplate>
243+
</ListBox.ItemTemplate>
244+
</ListBox>
123245
</Grid>
124246
</Grid>
125247
</Controls:MetroWindow>

0 commit comments

Comments
 (0)