Commit 0bda7b65 authored by shubham's avatar shubham

Started the dashboard page, added in the modules. Now adding in the page animations.

parent 0cb4cb15
<Page x:Class="Personal_Insight.Pages.Dashboard"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
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:local="clr-namespace:Personal_Insight.Pages"
xmlns:local="clr-namespace:Personal_Insight"
xmlns:pageTransitions="clr-namespace:WpfPageTransitions;assembly=WpfPageTransitions"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800"
Title="Dashboard">
d:DesignHeight="1080" d:DesignWidth="1920"
Title="Personal Insight Dashboard"
TextElement.Foreground="{DynamicResource MaterialDesignBody}"
TextElement.FontWeight="Regular"
TextElement.FontSize="13"
TextOptions.TextFormattingMode="Ideal"
TextOptions.TextRenderingMode="Auto"
FontFamily="{DynamicResource MaterialDesignFont}">
<Page.Background>
<LinearGradientBrush EndPoint="0.5,1" MappingMode="RelativeToBoundingBox" StartPoint="0.75,0">
<GradientStop Color="{DynamicResource Color2}" Offset="0"/>
<GradientStop Color="{DynamicResource Color1}" Offset="1" FrameworkElement.FlowDirection="LeftToRight"/>
</LinearGradientBrush>
</Page.Background>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid Grid.Row="2">
<ListView x:Name="listBox" ScrollViewer.HorizontalScrollBarVisibility="Disabled" Margin="25" HorizontalAlignment="Center" VerticalAlignment="Center" Background="#00FAFAFA">
<ListView.ItemTemplate>
<DataTemplate>
<Border BorderThickness="1" CornerRadius="10">
<Border.Background>
<SolidColorBrush Color="{DynamicResource Color2}"/>
</Border.Background>
<Border.BorderBrush>
<SolidColorBrush Color="{DynamicResource Color2}"/>
</Border.BorderBrush>
<StackPanel Orientation="Vertical" Width="300" Height="100" HorizontalAlignment="Center" VerticalAlignment="Center">
<Image Source="{Binding ImageResource}" Width="32" Height="32" Margin="0,18,0,9" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<Label Content="{Binding ProductName}" Foreground="White" Width="Auto" HorizontalAlignment="Center" VerticalAlignment="Center" HorizontalContentAlignment="Center" Height="Auto">
</Label>
</StackPanel>
</Border>
</DataTemplate>
</ListView.ItemTemplate>
<ListView.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel IsItemsHost="True" Orientation="Horizontal" />
</ItemsPanelTemplate>
</ListView.ItemsPanel>
</ListView>
</Grid>
<TextBlock Margin="0,50" TextWrapping="Wrap" Text="Personal Insight - Dashboard" FontSize="48" TextAlignment="Center" HorizontalAlignment="Center" Foreground="#DDFFFFFF" FontFamily="Microsoft YaHei UI Light" VerticalAlignment="Top"/>
<Separator Grid.Row="1" Height="2" Background="#7FA0A0A0"/>
</Grid>
</Page>
using System;
using Personal_Insight.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
......@@ -20,9 +21,20 @@ namespace Personal_Insight.Pages
/// </summary>
public partial class Dashboard : Page
{
public Dashboard()
private List<GoogleProductModel> googleProductList;
public Dashboard(List<GoogleProductModel> googleProductList)
{
InitializeComponent();
this.googleProductList = googleProductList;
initData();
}
private void initData()
{
listBox.ItemsSource = googleProductList;
}
}
}
......@@ -48,10 +48,7 @@
<WrapPanel Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Center">
<WrapPanel.Background>
<LinearGradientBrush EndPoint="0.5,1" MappingMode="RelativeToBoundingBox" StartPoint="0.75,0">
<GradientStop Color="#FF203340" Offset="0"/>
<GradientStop Color="{DynamicResource {x:Static SystemColors.DesktopColorKey}}" FrameworkElement.FlowDirection="LeftToRight" Offset="1"/>
</LinearGradientBrush>
<SolidColorBrush Color="#FF191F23"/>
</WrapPanel.Background>
<ScrollViewer HorizontalAlignment="Center" Margin="0" VerticalAlignment="Center" CanContentScroll="False" Grid.Row="1" HorizontalScrollBarVisibility="Auto" Padding="50">
<StackPanel x:Name="sp">
......
......@@ -47,7 +47,7 @@
<Button Content="Select folder" Height="Auto" Margin="20,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Center" Padding="50,15" Click="btnClick_openFile" Grid.Column="1"/>
</Grid>
<ListView x:Name="listView" Margin="0,25,0,0" Background="#FF646464" Padding="50" Grid.Row="2" HorizontalAlignment="Center">
<ListView x:Name="listView" Margin="0,25,0,0" Background="#FF646464" Padding="50" Grid.Row="2" HorizontalAlignment="Center" SelectionMode="Single" IsTextSearchEnabled="False">
<ListView.ItemTemplate>
<DataTemplate>
......
......@@ -84,8 +84,7 @@ namespace Personal_Insight
if (res == CommonFileDialogResult.Ok)
{
String path = dialog.FileName;
int start = path.Length - 7;
String takeoutCheck = path.Substring(start);
String takeoutCheck = getProductName(path);
if (takeoutCheck.Equals("Takeout"))
{
......@@ -115,10 +114,10 @@ namespace Personal_Insight
/*Product path*/ dir,
/*Product imgr*/ GoogleProductsList.LoadImage(getProductName(dir)),
/*Product obj */ GoogleProductsList.ProductObject ));
isPopulated = true;
}
listView.ItemsSource = googleProductList;
isPopulated = true;
}
/*
......
......@@ -13,8 +13,7 @@
TextElement.FontSize="13"
TextOptions.TextFormattingMode="Ideal"
TextOptions.TextRenderingMode="Auto"
FontFamily="{DynamicResource MaterialDesignFont}"
Loaded="Window_ContentRendered">
FontFamily="{DynamicResource MaterialDesignFont}">
<Page.Background>
<LinearGradientBrush EndPoint="0.5,1" MappingMode="RelativeToBoundingBox" StartPoint="0.75,0">
......@@ -51,8 +50,8 @@
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Button Content="BACK" Height="50" Margin="0" Background="#FF2D7874" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="22" FontFamily="Segoe UI" Padding="0" Width="200"/>
<Button x:Name="btn_next" Content="NEXT" Height="50" Margin="0" Width="200" Background="#FF2D7874" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="22" FontFamily="Segoe UI" Grid.Column="1" Padding="0"/>
<Button x:Name="btn_back" Content="BACK" Height="50" Margin="0" Background="#FF2D7874" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="22" FontFamily="Segoe UI" Padding="0" Width="200" Click="BtnClick_back" IsEnabled="False"/>
<Button x:Name="btn_next" Content="NEXT" Height="50" Margin="0" Width="200" Background="#FF2D7874" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="22" FontFamily="Segoe UI" Grid.Column="1" Padding="0" Click="BtnClick_next" IsEnabled="False"/>
</Grid>
</Grid>
......
......@@ -30,6 +30,18 @@ namespace Personal_Insight.Pages
DataContext = this;
this.googleProductList = googleProductList;
InitializeComponent();
ConsoleLogText = "Starting takeout scan...\n\n";
btn_back.IsEnabled = false;
btn_next.IsEnabled = false;
BackgroundWorker worker = new BackgroundWorker();
worker.WorkerReportsProgress = true;
worker.DoWork += worker_DoWork;
worker.ProgressChanged += worker_ProgressChanged;
worker.RunWorkerAsync();
}
......@@ -47,16 +59,39 @@ namespace Personal_Insight.Pages
}
}
private void Window_ContentRendered(object sender, EventArgs e)
private void BtnClick_back(object sender, RoutedEventArgs e)
{
ConsoleLogText = "Starting takeout scan...\n\n";
if (NavigationService.CanGoBack)
{
NavigationService.GoBack();
}
else
{
IntroPage_4 page4 = new IntroPage_4();
NavigationService.Navigate(page4);
}
BackgroundWorker worker = new BackgroundWorker();
worker.WorkerReportsProgress = true;
worker.DoWork += worker_DoWork;
worker.ProgressChanged += worker_ProgressChanged;
}
worker.RunWorkerAsync();
private void BtnClick_next(object sender, RoutedEventArgs e)
{
if (NavigationService.CanGoForward)
{
NavigationService.GoForward();
}
else
{
Dashboard page5 = new Dashboard(googleProductList);
NavigationService.Navigate(page5);
}
/*DashboardWindow dashboardWindow = new DashboardWindow();
dashboardWindow.Show();
Window parentWindow = Window.GetWindow(this);
parentWindow.Close();*/
}
private void worker_DoWork(object sender, DoWorkEventArgs e)
......@@ -71,7 +106,7 @@ namespace Personal_Insight.Pages
}
watch.Stop();
enterLog("Elapsed Time: " + watch.ElapsedMilliseconds + "ms");
enterLog("Elapsed Time: " + (watch.ElapsedMilliseconds/1000.0) + " seconds");
}
......@@ -101,6 +136,8 @@ namespace Personal_Insight.Pages
progressBar.Foreground = Brushes.Green;
progressBar.Background = Brushes.Green;
enterLog("Scan complete. Click 'Next' to continue.\n");
btn_back.IsEnabled = true;
btn_next.IsEnabled = true;
}
}
......
......@@ -315,6 +315,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Windows\DashboardWindow.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Windows\MainWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
......@@ -359,6 +363,9 @@
<Compile Include="Pages\IntroPage_5.xaml.cs">
<DependentUpon>IntroPage_5.xaml</DependentUpon>
</Compile>
<Compile Include="Windows\DashboardWindow.xaml.cs">
<DependentUpon>DashboardWindow.xaml</DependentUpon>
</Compile>
<Compile Include="Windows\MainWindow.xaml.cs">
<DependentUpon>MainWindow.xaml</DependentUpon>
<SubType>Code</SubType>
......
<Window x:Class="Personal_Insight.Windows.DashboardWindow"
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:Personal_Insight"
mc:Ignorable="d"
Title="Personal Insight Dashboard"
Left="0"
Top="0"
Width="{Binding Source={x:Static SystemParameters.WorkArea}, Path=Width}"
Height="{Binding Source={x:Static SystemParameters.WorkArea}, Path=Height}"
WindowState="Maximized"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
TextElement.Foreground="{DynamicResource MaterialDesignBody}"
TextElement.FontWeight="Regular"
TextElement.FontSize="13"
TextOptions.TextFormattingMode="Ideal"
TextOptions.TextRenderingMode="Auto"
FontFamily="{DynamicResource MaterialDesignFont}" Background="#FF303030"
>
<Frame Source="/Personal Insight;component/Pages/Dashboard.xaml" NavigationUIVisibility ="Hidden"/>
</Window>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
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 Personal_Insight.Windows
{
/// <summary>
/// Interaction logic for DashboardWindow.xaml
/// </summary>
public partial class DashboardWindow : Window
{
public DashboardWindow()
{
InitializeComponent();
}
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment