Skip to content

Commit

Permalink
Added Main.xaml view
Browse files Browse the repository at this point in the history
  • Loading branch information
marcin-przywoski committed Feb 19, 2024
1 parent 066140b commit b8a05b7
Show file tree
Hide file tree
Showing 2 changed files with 108 additions and 0 deletions.
83 changes: 83 additions & 0 deletions ExportViewer.GUI/Views/Main.xaml
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}">

Check failure on line 25 in ExportViewer.GUI/Views/Main.xaml

View workflow job for this annotation

GitHub Actions / build

Cannot find the type 'vm:ChatsViewModel'. Note that type names are case sensitive. Line 25 Position 23.

Check failure on line 25 in ExportViewer.GUI/Views/Main.xaml

View workflow job for this annotation

GitHub Actions / build

Cannot find the type 'vm:ChatsViewModel'. Note that type names are case sensitive. Line 25 Position 23.
<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>
25 changes: 25 additions & 0 deletions ExportViewer.GUI/Views/Main.xaml.cs
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();
}
}
}

0 comments on commit b8a05b7

Please sign in to comment.