-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added Main.xaml view * Added Chats.xaml view * Added MainViewModel.cs * Added ChatsViewModel.cs * Added IMenuItem.cs interface for declaring which class is used for navigation within the views * Updated UtilitiesViewModel with IMenuItem interface * Changed OnStart method from async void to async Task in UtilitiesViewModel.cs * Replaced MainWindow view with Main for the startup in App.xaml.cs * Added logging to App.xaml.cs * Updated layout of Utilities.xaml view * Removed AddLogging
- Loading branch information
1 parent
066140b
commit 4c4e699
Showing
10 changed files
with
275 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace ExportViewer.GUI.Interfaces | ||
{ | ||
public interface IMenuItem | ||
{ | ||
public string Title { get; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using ExportViewer.GUI.Interfaces; | ||
|
||
namespace ExportViewer.GUI.ViewModels | ||
{ | ||
public class ChatsViewModel : IMenuItem | ||
{ | ||
public string Title => "Chats"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Collections.ObjectModel; | ||
using System.Text; | ||
using System.Windows.Controls; | ||
using CommunityToolkit.Mvvm.ComponentModel; | ||
using ExportViewer.GUI.Interfaces; | ||
|
||
namespace ExportViewer.GUI.ViewModels | ||
{ | ||
public class MainViewModel : ObservableObject | ||
{ | ||
public ObservableCollection<IMenuItem> MenuItems { get; } | ||
|
||
private object? _selectedItem; | ||
public object? SelectedItem | ||
{ | ||
get => _selectedItem; | ||
set | ||
{ | ||
if (SetProperty(ref _selectedItem , value)) | ||
{ | ||
IsMenuOpen = false; | ||
} | ||
} | ||
} | ||
|
||
private bool isMenuOpen; | ||
public bool IsMenuOpen | ||
{ | ||
get => isMenuOpen; | ||
set => SetProperty(ref isMenuOpen , value); | ||
} | ||
|
||
public MainViewModel () | ||
{ | ||
MenuItems = new ObservableCollection<IMenuItem>() | ||
{ | ||
new UtilitiesViewModel(), | ||
new ChatsViewModel() | ||
}; | ||
SelectedItem = MenuItems[0]; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<UserControl | ||
x:Class="ExportViewer.GUI.Views.Chats" | ||
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:local="clr-namespace:ExportViewer.GUI.Views" | ||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
d:DesignHeight="450" | ||
d:DesignWidth="800" | ||
mc:Ignorable="d"> | ||
<Grid> | ||
<!-- Main Grid for layout --> | ||
<Grid.ColumnDefinitions> | ||
<ColumnDefinition Width="Auto" /> | ||
<ColumnDefinition Width="*" /> | ||
</Grid.ColumnDefinitions> | ||
|
||
<!-- Chats List --> | ||
<materialDesign:Card Grid.Column="0" Margin="10"> | ||
<ListBox Name="ChatsListBox"> | ||
<!-- Example Chat Items --> | ||
<ListBoxItem>Chat 1</ListBoxItem> | ||
<ListBoxItem>Chat 2</ListBoxItem> | ||
<ListBoxItem>Chat 3</ListBoxItem> | ||
<!-- Add more chat items as needed --> | ||
</ListBox> | ||
</materialDesign:Card> | ||
|
||
<!-- Chat Content --> | ||
<materialDesign:Card Grid.Column="1" Margin="10"> | ||
<StackPanel> | ||
<!-- Header --> | ||
<TextBlock | ||
Margin="0,0,0,10" | ||
FontSize="18" | ||
FontWeight="Bold"> | ||
Chat Header | ||
</TextBlock> | ||
|
||
<!-- Chat Messages --> | ||
<ListBox Name="ChatMessagesListBox"> | ||
<!-- Example Chat Messages --> | ||
<ListBoxItem>Sender 1: Message 1</ListBoxItem> | ||
<ListBoxItem>Sender 2: Message 2</ListBoxItem> | ||
<!-- Add more chat messages as needed --> | ||
</ListBox> | ||
|
||
<!-- Message Input Box --> | ||
<TextBox Name="MessageTextBox" Margin="0,10,0,0" /> | ||
<Button Margin="0,5,0,0" Content="Send" /> | ||
</StackPanel> | ||
</materialDesign:Card> | ||
</Grid> | ||
|
||
</UserControl> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using System.Windows; | ||
using System.Windows.Controls; | ||
using System.Windows.Data; | ||
using System.Windows.Documents; | ||
using System.Windows.Input; | ||
using System.Windows.Media; | ||
using System.Windows.Media.Imaging; | ||
using System.Windows.Navigation; | ||
using System.Windows.Shapes; | ||
|
||
namespace ExportViewer.GUI.Views | ||
{ | ||
/// <summary> | ||
/// Interaction logic for Chats.xaml | ||
/// </summary> | ||
public partial class Chats : UserControl | ||
{ | ||
public Chats () | ||
{ | ||
InitializeComponent(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
<Window | ||
x:Class="ExportViewer.GUI.Views.Main" | ||
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:interfaces="clr-namespace:ExportViewer.GUI.Interfaces" | ||
xmlns:local="clr-namespace:ExportViewer.GUI.Views" | ||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:views="clr-namespace:ExportViewer.GUI.Views" | ||
xmlns:vm="clr-namespace:ExportViewer.GUI.ViewModels" | ||
Title="Facebook Export Viewer" | ||
Width="800" | ||
Height="500" | ||
MinWidth="900" | ||
MinHeight="850" | ||
d:DataContext="{d:DesignInstance Type=vm:MainViewModel}" | ||
ResizeMode="CanMinimize" | ||
mc:Ignorable="d"> | ||
<Window.Resources> | ||
<!-- This provides a link between the view models and views --> | ||
<DataTemplate DataType="{x:Type vm:UtilitiesViewModel}"> | ||
<views:Utilities /> | ||
</DataTemplate> | ||
<DataTemplate DataType="{x:Type vm:ChatsViewModel}"> | ||
<views:Chats /> | ||
</DataTemplate> | ||
</Window.Resources> | ||
<Window.DataContext> | ||
<vm:MainViewModel /> | ||
</Window.DataContext> | ||
<materialDesign:DrawerHost IsLeftDrawerOpen="{Binding IsMenuOpen}"> | ||
<materialDesign:DrawerHost.LeftDrawerContent> | ||
<DockPanel MinWidth="220"> | ||
<ToggleButton | ||
Margin="16" | ||
HorizontalAlignment="Right" | ||
DockPanel.Dock="Top" | ||
IsChecked="{Binding IsMenuOpen}" | ||
Style="{StaticResource MaterialDesignHamburgerToggleButton}" /> | ||
|
||
<ListBox | ||
Margin="0,16,0,16" | ||
ItemsSource="{Binding MenuItems}" | ||
SelectedItem="{Binding SelectedItem, UpdateSourceTrigger=PropertyChanged}" | ||
Style="{StaticResource MaterialDesignNavigationPrimaryListBox}"> | ||
<ListBox.Resources> | ||
<Style BasedOn="{StaticResource MaterialDesignScrollBarMinimal}" TargetType="ScrollBar" /> | ||
</ListBox.Resources> | ||
<ListBox.ItemTemplate> | ||
<DataTemplate DataType="interfaces:IMenuItem"> | ||
<TextBlock Margin="24,4,0,4" Text="{Binding Title}" /> | ||
</DataTemplate> | ||
</ListBox.ItemTemplate> | ||
</ListBox> | ||
</DockPanel> | ||
</materialDesign:DrawerHost.LeftDrawerContent> | ||
|
||
<DockPanel> | ||
<materialDesign:ColorZone | ||
Padding="16" | ||
materialDesign:ShadowAssist.ShadowDepth="Depth2" | ||
DockPanel.Dock="Top" | ||
Mode="PrimaryMid"> | ||
<Grid> | ||
<ToggleButton | ||
HorizontalAlignment="Left" | ||
IsChecked="{Binding IsMenuOpen}" | ||
Style="{StaticResource MaterialDesignHamburgerToggleButton}" /> | ||
|
||
<TextBlock | ||
HorizontalAlignment="Center" | ||
VerticalAlignment="Center" | ||
FontSize="22" | ||
Text="Facebook Export Viewer" /> | ||
</Grid> | ||
</materialDesign:ColorZone> | ||
|
||
<!-- The default behavior of the DockPanel is to have the last child fill the middle --> | ||
<ContentControl Content="{Binding SelectedItem}" /> | ||
</DockPanel> | ||
</materialDesign:DrawerHost> | ||
</Window> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using System.Windows; | ||
using System.Windows.Controls; | ||
using System.Windows.Data; | ||
using System.Windows.Documents; | ||
using System.Windows.Input; | ||
using System.Windows.Media; | ||
using System.Windows.Media.Imaging; | ||
using System.Windows.Shapes; | ||
|
||
namespace ExportViewer.GUI.Views | ||
{ | ||
/// <summary> | ||
/// Interaction logic for Main.xaml | ||
/// </summary> | ||
public partial class Main : Window | ||
{ | ||
public Main () | ||
{ | ||
InitializeComponent(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters