Skip to content

Commit 127b7d8

Browse files
committed
Resolve merge conflict for csproj file
2 parents b4e8fa7 + 019f079 commit 127b7d8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+5281
-4088
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>netcoreapp3.0</TargetFramework>
6+
<RuntimeIdentifiers>win-x64;win-x86;win-arm;win-arm64</RuntimeIdentifiers>
7+
</PropertyGroup>
8+
9+
<ItemGroup>
10+
<Reference Include="Windows">
11+
<HintPath>..\..\..\..\..\..\Program Files (x86)\Windows Kits\10\UnionMetadata\10.0.17763.0\Windows.winmd</HintPath>
12+
<IsWinMDFile>true</IsWinMDFile>
13+
</Reference>
14+
</ItemGroup>
15+
16+
</Project>

Launcher/Program.cs renamed to ExecutableLauncher/Program.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,22 @@
22
using System.Diagnostics;
33
using Windows.Storage;
44

5-
namespace Launcher
5+
namespace ExecutableLauncher
66
{
77
internal class Program
88
{
99
private static void Main(string[] args)
1010
{
1111
try
1212
{
13-
var executable = (string) ApplicationData.Current.LocalSettings.Values["Application"];
13+
var executable = (string)ApplicationData.Current.LocalSettings.Values["Application"];
1414
Process.Start(executable);
1515
}
16-
catch (Exception e)
16+
catch (System.ComponentModel.Win32Exception e)
1717
{
18+
Console.WriteLine("While most executables work now, UWP restrictions still prevent the execution of this file");
1819
Console.WriteLine(e.Message);
20+
Console.WriteLine(e.StackTrace);
1921
Console.ReadLine();
2022
}
2123
}

Files UWP/AddItem.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
</Grid>
1919
<Grid Name="SelectionListContent" HorizontalAlignment="Stretch">
2020
<StackPanel>
21-
<ListView IsItemClickEnabled="True" ItemClick="ListView_ItemClick" ItemsSource="{x:Bind local:AddItem.AddItemsList}">
21+
<ListView Name="AddItemsListView" IsItemClickEnabled="True" ItemClick="ListView_ItemClick" ItemsSource="{x:Bind local:AddItem.AddItemsList}">
2222
<ListView.ItemTemplate>
2323
<DataTemplate>
2424
<Grid Height="50">

Files UWP/AddItem.xaml.cs

Lines changed: 54 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,38 @@
66
using Files.Filesystem;
77
using System.Collections.ObjectModel;
88
using System.Threading.Tasks;
9+
using Microsoft.Toolkit.Uwp.UI.Controls;
10+
using Windows.UI.Xaml.Navigation;
911

1012
namespace Files
1113
{
1214

1315
public sealed partial class AddItem : Page
1416
{
17+
public ListView addItemsChoices;
18+
public ItemViewModel<AddItem> instanceViewModel;
1519
public AddItem()
1620
{
1721
this.InitializeComponent();
22+
23+
addItemsChoices = AddItemsListView;
1824
AddItemsToList();
1925
}
2026

27+
protected override void OnNavigatedTo(NavigationEventArgs eventArgs)
28+
{
29+
base.OnNavigatedTo(eventArgs);
30+
var parameters = eventArgs.Parameter;
31+
if (parameters.GetType() == typeof(GenericFileBrowser))
32+
{
33+
instanceViewModel = new ItemViewModel<AddItem>();
34+
}
35+
else if (parameters.GetType() == typeof(PhotoAlbum))
36+
{
37+
instanceViewModel = new ItemViewModel<AddItem>();
38+
}
39+
}
40+
2141
public static List<AddListItem> AddItemsList = new List<AddListItem>();
2242

2343
public static void AddItemsToList()
@@ -29,41 +49,62 @@ public static void AddItemsToList()
2949

3050
}
3151

32-
52+
public T GetCurrentSelectedTabInstance<T>()
53+
{
54+
Frame rootFrame = Window.Current.Content as Frame;
55+
var instanceTabsView = rootFrame.Content as InstanceTabsView;
56+
var selectedTabContent = ((instanceTabsView.tabView.SelectedItem as TabViewItem).Content as Grid);
57+
foreach (UIElement uiElement in selectedTabContent.Children)
58+
{
59+
if (uiElement.GetType() == typeof(Frame))
60+
{
61+
return (T)((uiElement as Frame).Content);
62+
}
63+
}
64+
return default;
65+
}
3366
private async void ListView_ItemClick(object sender, ItemClickEventArgs e)
3467
{
35-
36-
GenericFileBrowser.AddItemBox.Hide();
37-
var currentPath = App.ViewModel.Universal.path;
68+
var TabInstance = GetCurrentSelectedTabInstance<ProHome>();
69+
TabInstance.AddItemBox.Hide();
70+
string currentPath = null;
71+
if (TabInstance.accessibleContentFrame.SourcePageType == typeof(GenericFileBrowser))
72+
{
73+
currentPath = (TabInstance.accessibleContentFrame.Content as GenericFileBrowser).instanceViewModel.Universal.path;
74+
}
75+
else if (TabInstance.accessibleContentFrame.SourcePageType == typeof(PhotoAlbum))
76+
{
77+
currentPath = (TabInstance.accessibleContentFrame.Content as PhotoAlbum).instanceViewModel.Universal.path;
78+
}
3879
StorageFolder folderToCreateItem = await StorageFolder.GetFolderFromPathAsync(currentPath);
3980
if ((e.ClickedItem as AddListItem).Header == "Folder")
4081
{
41-
await GenericFileBrowser.NameBox.ShowAsync();
42-
var userInput = GenericFileBrowser.inputForRename;
82+
await TabInstance.NameBox.ShowAsync();
83+
var userInput = TabInstance.inputForRename;
4384
if (userInput != null)
4485
{
4586
var folder = await folderToCreateItem.CreateFolderAsync(userInput, CreationCollisionOption.FailIfExists);
46-
App.ViewModel.AddFileOrFolder(new ListedItem(folder.FolderRelativeId){ FileName = userInput, FileDateReal = DateTimeOffset.Now, EmptyImgVis = Visibility.Collapsed, FolderImg = Visibility.Visible, FileIconVis = Visibility.Collapsed, FileType = "Folder", FileImg = null, FilePath = (App.ViewModel.Universal.path + "\\" + userInput) });
87+
instanceViewModel.AddFileOrFolder(new ListedItem(folder.FolderRelativeId){ FileName = userInput, FileDateReal = DateTimeOffset.Now, EmptyImgVis = Visibility.Collapsed, FolderImg = Visibility.Visible, FileIconVis = Visibility.Collapsed, FileType = "Folder", FileImg = null, FilePath = (instanceViewModel.Universal.path + "\\" + userInput) });
4788
}
4889
}
4990
else if ((e.ClickedItem as AddListItem).Header == "Text Document")
5091
{
51-
await GenericFileBrowser.NameBox.ShowAsync();
52-
var userInput = GenericFileBrowser.inputForRename;
92+
await TabInstance.NameBox.ShowAsync();
93+
var userInput = TabInstance.inputForRename;
5394
if (userInput != null)
5495
{
5596
var folder = await folderToCreateItem.CreateFileAsync(userInput + ".txt", CreationCollisionOption.FailIfExists);
56-
App.ViewModel.AddFileOrFolder(new ListedItem(folder.FolderRelativeId) { FileName = userInput, FileDateReal = DateTimeOffset.Now, EmptyImgVis = Visibility.Visible, FolderImg = Visibility.Collapsed, FileIconVis = Visibility.Collapsed, FileType = "Text Document", FileImg = null, FilePath = (App.ViewModel.Universal.path + "\\" + userInput + ".txt"), DotFileExtension = ".txt" });
97+
instanceViewModel.AddFileOrFolder(new ListedItem(folder.FolderRelativeId) { FileName = userInput, FileDateReal = DateTimeOffset.Now, EmptyImgVis = Visibility.Visible, FolderImg = Visibility.Collapsed, FileIconVis = Visibility.Collapsed, FileType = "Text Document", FileImg = null, FilePath = (instanceViewModel.Universal.path + "\\" + userInput + ".txt"), DotFileExtension = ".txt" });
5798
}
5899
}
59100
else if ((e.ClickedItem as AddListItem).Header == "Bitmap Image")
60101
{
61-
await GenericFileBrowser.NameBox.ShowAsync();
62-
var userInput = GenericFileBrowser.inputForRename;
102+
await GetCurrentSelectedTabInstance<ProHome>().NameBox.ShowAsync();
103+
var userInput = GetCurrentSelectedTabInstance<ProHome>().inputForRename;
63104
if (userInput != null)
64105
{
65106
var folder = await folderToCreateItem.CreateFileAsync(userInput + ".bmp", CreationCollisionOption.FailIfExists);
66-
App.ViewModel.AddFileOrFolder(new ListedItem(folder.FolderRelativeId) { FileName = userInput, FileDateReal = DateTimeOffset.Now, EmptyImgVis = Visibility.Visible, FolderImg = Visibility.Collapsed, FileIconVis = Visibility.Collapsed, FileType = "BMP File", FileImg = null, FilePath = (App.ViewModel.Universal.path + "\\" + userInput + ".bmp"), DotFileExtension = ".bmp" });
107+
instanceViewModel.AddFileOrFolder(new ListedItem(folder.FolderRelativeId) { FileName = userInput, FileDateReal = DateTimeOffset.Now, EmptyImgVis = Visibility.Visible, FolderImg = Visibility.Collapsed, FileIconVis = Visibility.Collapsed, FileType = "BMP File", FileImg = null, FilePath = (instanceViewModel.Universal.path + "\\" + userInput + ".bmp"), DotFileExtension = ".bmp" });
67108
}
68109
}
69110
}

Files UWP/App.xaml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,29 @@
33
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
44
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
55
<Application.Resources>
6-
76
<ResourceDictionary>
87
<ResourceDictionary.MergedDictionaries>
9-
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls"/>
8+
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls"/>
109
<ResourceDictionary>
1110
<ResourceDictionary.ThemeDictionaries>
1211
<ResourceDictionary x:Key="Default">
1312
<AcrylicBrush x:Key="NavigationViewDefaultPaneBackground" BackgroundSource="Backdrop" FallbackColor="#eaeaea" TintColor="LightSlateGray" TintOpacity="0.6"/>
14-
<AcrylicBrush x:Key="NavigationViewTopPaneBackground" FallbackColor="#eaeaea" BackgroundSource="HostBackdrop" TintOpacity="0.8" TintColor="White"/>
13+
<SolidColorBrush x:Key="NavigationViewTopPaneBackground" Color="White"/>
1514
<AcrylicBrush x:Key="NavigationViewExpandedPaneBackground" BackgroundSource="HostBackdrop" TintOpacity="0.6" TintColor="White" FallbackColor="#eaeaea"/>
1615
<SolidColorBrush x:Key="UnmodifiedSystemPageColor" Color="White"/>
1716
<SolidColorBrush x:Key="YourHomeCardBackgroundColor" Color="#f4f4f4"/>
1817

1918
</ResourceDictionary>
2019
<ResourceDictionary x:Key="Light">
2120
<AcrylicBrush x:Key="NavigationViewDefaultPaneBackground" FallbackColor="#eaeaea" BackgroundSource="Backdrop" TintColor="LightSlateGray" TintOpacity="0.6"/>
22-
<AcrylicBrush x:Key="NavigationViewTopPaneBackground" BackgroundSource="HostBackdrop" TintOpacity="0.8" TintColor="White" FallbackColor="#eaeaea"/>
21+
<SolidColorBrush x:Key="NavigationViewTopPaneBackground" Color="White"/>
2322
<AcrylicBrush x:Key="NavigationViewExpandedPaneBackground" BackgroundSource="HostBackdrop" TintOpacity="0.6" TintColor="White" FallbackColor="#eaeaea"/>
2423
<SolidColorBrush x:Key="UnmodifiedSystemPageColor" Color="White"/>
2524
<SolidColorBrush x:Key="YourHomeCardBackgroundColor" Color="#f4f4f4"/>
2625
</ResourceDictionary>
2726
<ResourceDictionary x:Key="Dark">
2827
<AcrylicBrush x:Key="NavigationViewDefaultPaneBackground" BackgroundSource="Backdrop" TintColor="Black" TintOpacity="0.6"/>
29-
<AcrylicBrush x:Key="NavigationViewTopPaneBackground" BackgroundSource="HostBackdrop" TintOpacity="0.8" TintColor="Black"/>
28+
<SolidColorBrush x:Key="NavigationViewTopPaneBackground" Color="#191919"/>
3029
<AcrylicBrush x:Key="NavigationViewExpandedPaneBackground" BackgroundSource="HostBackdrop" TintOpacity="0.6" TintColor="Black"/>
3130
<SolidColorBrush x:Key="ApplicationPageBackgroundThemeBrush" Color="#191919"/>
3231
<SolidColorBrush x:Key="UnmodifiedSystemPageColor" Color="Black"/>

Files UWP/App.xaml.cs

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
1-
using Files.Navigation;
1+
using Files.Interacts;
2+
using Files.Navigation;
23
using System;
34
using System.Diagnostics;
45
using System.Threading;
56
using Windows.ApplicationModel;
67
using Windows.ApplicationModel.Activation;
8+
using Windows.ApplicationModel.DataTransfer;
79
using Windows.Storage;
810
using Windows.UI;
911
using Windows.UI.Xaml;
1012
using Windows.UI.Xaml.Controls;
13+
using Windows.UI.Xaml.Media.Animation;
1114
using Windows.UI.Xaml.Navigation;
1215

1316
namespace Files
@@ -18,6 +21,7 @@ public App()
1821
{
1922
this.InitializeComponent();
2023
this.Suspending += OnSuspending;
24+
this.UnhandledException += App_UnhandledException;
2125
Windows.Storage.ApplicationDataContainer localSettings = Windows.Storage.ApplicationData.Current.LocalSettings;
2226

2327
if (localSettings.Values["theme"] != null)
@@ -57,18 +61,27 @@ public App()
5761
this.RequestedTheme = SettingsPages.Personalization.TV.ThemeValue;
5862
Debug.WriteLine("!!Requested Theme!!" + RequestedTheme.ToString());
5963

64+
6065

6166
}
62-
public static Filesystem.ItemViewModel ViewModel = new Filesystem.ItemViewModel();
63-
public static DisplayedPathText PathText { get; set; } = new DisplayedPathText();
6467

68+
private void App_UnhandledException(object sender, Windows.UI.Xaml.UnhandledExceptionEventArgs e)
69+
{
70+
e.Handled = true;
71+
Frame rootFrame = Window.Current.Content as Frame;
72+
rootFrame.Navigate(typeof(UnhandledExceptionDisplay), e.Exception);
73+
}
74+
75+
public static PasteState PS { get; set; } = new PasteState();
6576
/// <summary>
6677
/// Invoked when the application is launched normally by the end user. Other entry points
6778
/// will be used such as when the application is launched to open a specific file.
6879
/// </summary>
6980
/// <param name="e">Details about the launch request and process.</param>
7081
protected override void OnLaunched(LaunchActivatedEventArgs e)
7182
{
83+
bool canEnablePrelaunch = Windows.Foundation.Metadata.ApiInformation.IsMethodPresent("Windows.ApplicationModel.Core.CoreApplication", "EnablePrelaunch");
84+
7285
Frame rootFrame = Window.Current.Content as Frame;
7386

7487
// Do not repeat app initialization when the Window already has content,
@@ -91,13 +104,18 @@ protected override void OnLaunched(LaunchActivatedEventArgs e)
91104

92105
if (e.PrelaunchActivated == false)
93106
{
107+
if (canEnablePrelaunch)
108+
{
109+
TryEnablePrelaunch();
110+
}
111+
94112
if (rootFrame.Content == null)
95113
{
96114

97115
// When the navigation stack isn't restored navigate to the first page,
98116
// configuring the new page by passing required information as a navigation
99117
// parameter
100-
rootFrame.Navigate(typeof(MainPage), e.Arguments);
118+
rootFrame.Navigate(typeof(InstanceTabsView), e.Arguments, new SuppressNavigationTransitionInfo());
101119

102120

103121
}
@@ -107,6 +125,10 @@ protected override void OnLaunched(LaunchActivatedEventArgs e)
107125
}
108126
}
109127

128+
private void TryEnablePrelaunch()
129+
{
130+
Windows.ApplicationModel.Core.CoreApplication.EnablePrelaunch(true);
131+
}
110132
/// <summary>
111133
/// Invoked when Navigation to a certain page fails
112134
/// </summary>
-202 KB
Binary file not shown.
-212 KB
Binary file not shown.
-157 KB
Binary file not shown.
-209 KB
Binary file not shown.

0 commit comments

Comments
 (0)