Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge #18

Merged
merged 24 commits into from
Mar 16, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add dummy MenuBar to FileManagerPage, WorkbenchPage. Minor tweaks.
  • Loading branch information
tajbender committed Mar 11, 2023
commit 81e004437f2832fc9ef5c722aa612eac6691a576
28 changes: 11 additions & 17 deletions src/electrifier/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,30 +116,20 @@ public App()
services.Configure<LocalSettingsOptions>(context.Configuration.GetSection(nameof(LocalSettingsOptions)));
}).Build();



GetService<IAppNotificationService>()?
.Initialize();

UnhandledException += App_UnhandledException;
}

private void App_StartAppCenter()
{
AppCenter.Start("{ TODO:Your_app_secret_here }", typeof(Analytics), typeof(Crashes));
}
/// <summary>
///
/// </summary>
/// <param name="sender"></param>
/// <param name="args"></param>
//private void App_StartAppCenter()
//{
// AppCenter.Start("{ TODO:Your_app_secret_here }", typeof(Analytics), typeof(Crashes));
//}


private void App_UnhandledException(object sender, Microsoft.UI.Xaml.UnhandledExceptionEventArgs args)
{
if (args is null)
{
throw new ArgumentNullException(nameof(args));
}

App_UnhandledException(sender, args, false);
}

Expand Down Expand Up @@ -215,12 +205,16 @@ private async void ShowDialog_Click(object sender, RoutedEventArgs e)
}
catch (Exception ex)
{
ex.ToString();
var innerExceptionStr = ex.ToString();


// TODO: Log inner exception
}
finally
{
if (args is not null)
{
args.Handled = true;
//args.Handled = !itIsComplicated;
}
}
Expand Down
136 changes: 83 additions & 53 deletions src/electrifier/Views/FileManagerPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,72 +9,102 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">

<Grid
x:Name="ContentArea">
<StackPanel
Orientation="Vertical">
<MenuBar>
<MenuBarItem
IsEnabled="False"
Title="File">
<MenuFlyoutItem
Text="New" />
<MenuFlyoutItem
Text="Open..." />
</MenuBarItem>
<MenuBarItem
IsEnabled="False"
Title="Edit">
<MenuFlyoutItem
Text="Undo" />
<MenuFlyoutItem
Text="Cut" />
<MenuFlyoutItem
Text="Copy" />
<MenuFlyoutItem
Text="Paste" />
</MenuBarItem>
<MenuBarItem
IsEnabled="False"
Title="Help">
<MenuFlyoutItem
Text="About" />
</MenuBarItem>
</MenuBar>
<Grid>
<Grid.Resources>
<DataTemplate
x:DataType="local:DosShellItem"
x:Key="ImageGridViewItemTemplate">
<Grid
Height="150"
Width="150"
Margin="3">
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition
Height="45" />
</Grid.RowDefinitions>

<Grid.Resources>
<DataTemplate
x:DataType="local:DosShellItem"
x:Key="ImageGridViewItemTemplate">
<Grid
Height="150"
Width="150"
Margin="3">
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition
Height="45" />
</Grid.RowDefinitions>

<!--Source="{x:Bind ShellIcon}"-->
<!--<BitmapIcon
<!--Source="{x:Bind ShellIcon}"-->
<!--<BitmapIcon
Grid.Row="0"
x:Name="ItemImage"
UriSource="ms-appx:///Assets/Assets\Square44x44Logo.scale-200.png"

/>-->
<!-- TODO: Check <BitmapIcon UriSource="ms-appx:///Assets/globe.png"/> -->

<!-- W:\git-projects\tajbender\electrifier-v1.23\branch main\electrifier-v1.23\src\electrifier\Assets\Views\Workbench\Shell32 Desfualt Folder.ico -->
<!-- TODO: Check <BitmapIcon UriSource="ms-appx:///Assets/globe.png"/> -->

<ImageIcon
x:Name="ImageGridView_ItemTemplate_DefaultFolderIcon"
Visibility="{x:Bind IsFolder}"
Source="..\Assets\Views\Workbench\Shell32 Default Folder.ico"
Grid.Row="0" />
<!-- W:\git-projects\tajbender\electrifier-v1.23\branch main\electrifier-v1.23\src\electrifier\Assets\Views\Workbench\Shell32 Desfualt Folder.ico -->

<ImageIcon
x:Name="ImageGridView_ItemTemplate_DefaultFileIcon"
Visibility="{x:Bind IsFile}"
Source="..\Assets\Views\Workbench\Shell32 Default unknown File.ico"
Grid.Row="0" />
<ImageIcon
x:Name="ImageGridView_ItemTemplate_DefaultFolderIcon"
Visibility="{x:Bind IsFolder}"
Source="..\Assets\Views\Workbench\Shell32 Default Folder.ico"
Grid.Row="0" />

<TextBlock
Grid.Row="1"
Text="{x:Bind FileName}"
HorizontalAlignment="Left"
FontSize="12"
Style="{StaticResource SubtitleTextBlockStyle}" />
</Grid>
</DataTemplate>
<ImageIcon
x:Name="ImageGridView_ItemTemplate_DefaultFileIcon"
Visibility="{x:Bind IsFile}"
Source="..\Assets\Views\Workbench\Shell32 Default unknown File.ico"
Grid.Row="0" />

<Style
x:Key="ImageGridViewItemContainerStyle"
TargetType="GridViewItem">
<Setter
Property="Margin"
Value="3" />
</Style>
</Grid.Resources>
<TextBlock
Grid.Row="1"
Text="{x:Bind FileName}"
HorizontalAlignment="Left"
FontSize="12"
Style="{StaticResource SubtitleTextBlockStyle}" />
</Grid>
</DataTemplate>

<GridView
x:Name="ImageGridView"
ItemTemplate="{StaticResource ImageGridViewItemTemplate}"
ItemsSource="{x:Bind ShellItems}"
ItemContainerStyle="{StaticResource ImageGridViewItemContainerStyle}"
ContainerContentChanging="ImageGridView_ContainerContentChanging">
</GridView>
<Style
x:Key="ImageGridViewItemContainerStyle"
TargetType="GridViewItem">
<Setter
Property="Margin"
Value="3" />
</Style>
</Grid.Resources>

<GridView
x:Name="ImageGridView"
ItemTemplate="{StaticResource ImageGridViewItemTemplate}"
ItemsSource="{x:Bind ShellItems}"
ItemContainerStyle="{StaticResource ImageGridViewItemContainerStyle}"
ContainerContentChanging="ImageGridView_ContainerContentChanging">
</GridView>
</Grid>
</StackPanel>
</Grid>
</Page>
8 changes: 5 additions & 3 deletions src/electrifier/Views/ShellPage.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Net;
using System.Diagnostics;
using System.Net;
using electrifier.Contracts.Services;
using electrifier.Helpers;
using electrifier.ViewModels;
Expand Down Expand Up @@ -56,7 +57,7 @@ public ShellPage(ShellViewModel viewModel)
ThisComputerName = $"This PC: { GetThisComputerName() }"; // TODO: i18n
}

private void OnLoaded(object sender, Microsoft.UI.Xaml.RoutedEventArgs e)
private void OnLoaded(object sender, RoutedEventArgs e)
{
TitleBarHelper.UpdateTitleBar(RequestedTheme);

Expand All @@ -68,7 +69,7 @@ private void MainWindow_Activated(object sender, WindowActivatedEventArgs args)
{
var resource = args.WindowActivationState == WindowActivationState.Deactivated ? "WindowCaptionForegroundDisabled" : "WindowCaptionForeground";

AppTitleBarText.Foreground = (SolidColorBrush)App.Current.Resources[resource];
AppTitleBarText.Foreground = (SolidColorBrush)Application.Current.Resources[resource];
}

private void NavigationViewControl_DisplayModeChanged(NavigationView sender, NavigationViewDisplayModeChangedEventArgs args)
Expand Down Expand Up @@ -100,6 +101,7 @@ private static void OnKeyboardAcceleratorInvoked(KeyboardAccelerator sender, Key
{
var navigationService = App.GetService<INavigationService>();

Debug.Assert(navigationService != null, nameof(navigationService) + " != null");
var result = navigationService.GoBack();

args.Handled = result;
Expand Down
89 changes: 57 additions & 32 deletions src/electrifier/Views/WorkbenchPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">

xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:viewModels="using:electrifier.ViewModels">
<Grid
x:Name="ContentArea">
<Grid.Background>
Expand All @@ -20,16 +20,62 @@
</Grid.Background>
<StackPanel
Orientation="Vertical">
<MenuBar>
<MenuBarItem
IsEnabled="False"
Title="File">
<MenuFlyoutItem
Text="New" />
<MenuFlyoutItem
Text="Open..." />
<MenuFlyoutItem
Text="Save" />
<MenuFlyoutItem
Text="Exit" />
</MenuBarItem>

<MenuBarItem
IsEnabled="False"
Title="Edit">
<MenuFlyoutItem
Text="Undo" />
<MenuFlyoutItem
Text="Cut" />
<MenuFlyoutItem
Text="Copy" />
<MenuFlyoutItem
Text="Paste" />
</MenuBarItem>
<MenuBarItem
IsEnabled="True"
Title="Collaborate">
<MenuFlyoutItem
Text="Connect..." />
<MenuFlyoutItem
Text="Disconnect" />




</MenuBarItem>

<MenuBarItem
IsEnabled="False"
Title="Help">
<MenuFlyoutItem
Text="About" />
</MenuBarItem>
</MenuBar>
<InfoBar
Name="ApacheLicenseInfoBar"
x:Uid="ApacheLicenseInfoBar"
Name="WarrantyDisclaimerInfoBar"
IsOpen="True"
Severity="{x:Bind InfoBarSeverity}"
Title="Caution! This Is Alpha!">
<InfoBar.ActionButton>
<HyperlinkButton
Content="Take care! This is a debug build, that will contain errors and untested functionality."
HorizontalAlignment="Center" />
HorizontalAlignment="Center"
NavigateUri="https://github.com/electrifier/electrifier/wiki/Debug-Builds" />
</InfoBar.ActionButton>
<Grid>
<Grid.RowDefinitions>
Expand Down Expand Up @@ -72,43 +118,22 @@
</Grid.ColumnDefinitions>
<CheckBox
Grid.Column="0"
IsEnabled="False"
HorizontalAlignment="Left">
I understood the consequences of using beta software.
I understand the consequences of using beta software.
</CheckBox>
<Button
Grid.Column="1"
IsEnabled="False"
HorizontalAlignment="Right">
Got it. Thanks for briefing!
</Button>
</Grid>
</Grid>
</InfoBar>
<BreadcrumbBar
x:Name="TopBreadcrumbBar" />
<VariableSizedWrapGrid
Orientation="Horizontal"
MaximumRowsOrColumns="3"
ItemHeight="44"
ItemWidth="44">
<Rectangle
Fill="Red" />
<Rectangle
Fill="Blue"
Height="80"
VariableSizedWrapGrid.RowSpan="2" />
<Rectangle
Fill="Green"
Width="80"
VariableSizedWrapGrid.ColumnSpan="2" />
<Rectangle
Fill="Yellow"
Height="80"
Width="80"
VariableSizedWrapGrid.RowSpan="2"
VariableSizedWrapGrid.ColumnSpan="2" />
</VariableSizedWrapGrid>

<PersonPicture
ProfilePicture="https://docs.microsoft.com/windows/uwp/contacts-and-calendar/images/shoulder-tap-static-payload.png" />



</StackPanel>
</Grid>
Expand Down
Loading