Skip to content

Commit fd22144

Browse files
committed
BROKEN: Added Commands to Project Mumbai
1 parent 91da481 commit fd22144

19 files changed

+561
-1796
lines changed

Files UWP/App.xaml.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ public App()
6060

6161
}
6262
public static Filesystem.ItemViewModel ViewModel = new Filesystem.ItemViewModel();
63+
public static Interacts.Home.HomeItemsState HomeItems { get; set; } = new Interacts.Home.HomeItemsState();
64+
public static Interacts.Share.ShareItemsState ShareItems { get; set; } = new Interacts.Share.ShareItemsState();
65+
public static Interacts.Layout.LayoutItemsState LayoutItems { get; set; } = new Interacts.Layout.LayoutItemsState();
6366
public static DisplayedPathText PathText { get; set; } = new DisplayedPathText();
6467

6568
/// <summary>

Files UWP/FilesUWP.csproj

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,10 @@
119119
</Compile>
120120
<Compile Include="Interacts\Interaction.cs" />
121121
<Compile Include="Interacts\ItemInteractions.cs" />
122+
<Compile Include="Interacts\RibbonActions\Home.cs" />
123+
<Compile Include="Interacts\RibbonActions\Layout.cs" />
124+
<Compile Include="Interacts\RibbonActions\Share.cs" />
122125
<Compile Include="LocationsList.cs" />
123-
<Compile Include="MainPage.xaml.cs">
124-
<DependentUpon>MainPage.xaml</DependentUpon>
125-
</Compile>
126126
<Compile Include="Navigation\ArrayDiag.cs" />
127127
<Compile Include="Navigation\BackState.cs" />
128128
<Compile Include="Navigation\ForwardState.cs" />
@@ -189,10 +189,6 @@
189189
<SubType>Designer</SubType>
190190
<Generator>MSBuild:Compile</Generator>
191191
</Page>
192-
<Page Include="MainPage.xaml">
193-
<Generator>MSBuild:Compile</Generator>
194-
<SubType>Designer</SubType>
195-
</Page>
196192
<Page Include="PhotoAlbum.xaml">
197193
<SubType>Designer</SubType>
198194
<Generator>MSBuild:Compile</Generator>
@@ -259,6 +255,7 @@
259255
<Name>Windows Desktop Extensions for the UWP</Name>
260256
</SDKReference>
261257
</ItemGroup>
258+
<ItemGroup />
262259
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '14.0' ">
263260
<VisualStudioVersion>14.0</VisualStudioVersion>
264261
</PropertyGroup>

Files UWP/Filesystem/ItemViewModel.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -116,25 +116,25 @@ public async void AddItemsToCollectionAsync(string path, Page currentPage)
116116
switch (Universal.path)
117117
{
118118
case "Desktop":
119-
Universal.path = MainPage.DesktopPath;
119+
Universal.path = ProHome.DesktopPath;
120120
break;
121121
case "Downloads":
122-
Universal.path = MainPage.DownloadsPath;
122+
Universal.path = ProHome.DownloadsPath;
123123
break;
124124
case "Documents":
125-
Universal.path = MainPage.DocumentsPath;
125+
Universal.path = ProHome.DocumentsPath;
126126
break;
127127
case "Pictures":
128-
Universal.path = MainPage.PicturesPath;
128+
Universal.path = ProHome.PicturesPath;
129129
break;
130130
case "Music":
131-
Universal.path = MainPage.MusicPath;
131+
Universal.path = ProHome.MusicPath;
132132
break;
133133
case "Videos":
134-
Universal.path = MainPage.VideosPath;
134+
Universal.path = ProHome.VideosPath;
135135
break;
136136
case "OneDrive":
137-
Universal.path = MainPage.OneDrivePath;
137+
Universal.path = ProHome.OneDrivePath;
138138
break;
139139
}
140140

@@ -254,7 +254,7 @@ public async void AddItemsToCollectionAsync(string path, Page currentPage)
254254
Frame rootFrame = Window.Current.Content as Frame;
255255
MessageDialog driveGone = new MessageDialog(e.Message, "Drive Unplugged");
256256
await driveGone.ShowAsync();
257-
rootFrame.Navigate(typeof(MainPage), new SuppressNavigationTransitionInfo());
257+
rootFrame.Navigate(typeof(ProHome), new SuppressNavigationTransitionInfo());
258258
return;
259259
}
260260

Files UWP/GenericFileBrowser.xaml.cs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,6 @@ public GenericFileBrowser()
6060
CutItem.Click += Interaction.CutItem_Click;
6161
CopyItem.Click += Interaction.CopyItem_ClickAsync;
6262
AllView.RightTapped += Interaction.AllView_RightTapped;
63-
//Back.Click += NavigationActions.Back_Click;
64-
//Forward.Click += NavigationActions.Forward_Click;
65-
//Refresh.Click += NavigationActions.Refresh_Click;
66-
//AddItem.Click += AddItem_ClickAsync;
6763
AllView.DoubleTapped += Interaction.List_ItemClick;
6864
//Clipboard.ContentChanged += Clipboard_ContentChanged;
6965
//AddItemBox = AddDialog;
@@ -114,6 +110,10 @@ protected override void OnNavigatedTo(NavigationEventArgs eventArgs)
114110
var parameters = (string)eventArgs.Parameter;
115111
App.ViewModel.CancelLoadAndClearFiles();
116112
App.ViewModel.Universal.path = parameters;
113+
ProHome.BackButton.Click += NavigationActions.Back_Click;
114+
ProHome.ForwardButton.Click += NavigationActions.Forward_Click;
115+
ProHome.RefreshButton.Click += NavigationActions.Refresh_Click;
116+
ProHome.AddItemButton.Click += AddItem_ClickAsync;
117117
App.ViewModel.AddItemsToCollectionAsync(App.ViewModel.Universal.path, GenericItemView);
118118
if (parameters.Equals(Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory)))
119119
{
@@ -306,7 +306,14 @@ private void GenericItemView_PointerReleased(object sender, Windows.UI.Xaml.Inpu
306306

307307
private void AllView_SelectionChanged(object sender, SelectionChangedEventArgs e)
308308
{
309+
309310
AllView.CommitEdit();
311+
if(e.AddedItems.Count > 0)
312+
{
313+
App.HomeItems.isEnabled = true;
314+
App.ShareItems.isEnabled = true;
315+
316+
}
310317
}
311318

312319
private void NameDialog_Loaded(object sender, RoutedEventArgs e)

Files UWP/Interacts/Interaction.cs

Lines changed: 80 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -161,112 +161,114 @@ public static async void List_ItemClick(object sender, DoubleTappedRoutedEventAr
161161
if (clickedOnItem.FilePath == Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory))
162162
{
163163
App.PathText.Text = "Desktop";
164-
foreach (Microsoft.UI.Xaml.Controls.NavigationViewItemBase NavItemChoice in MainPage.nv.MenuItems)
165-
{
166-
if (NavItemChoice is Microsoft.UI.Xaml.Controls.NavigationViewItem && NavItemChoice.Name.ToString() == "DesktopIC")
167-
{
168-
MainPage.Select.itemSelected = NavItemChoice;
169-
break;
170-
}
171-
}
172-
MainPage.accessibleContentFrame.Navigate(typeof(GenericFileBrowser), YourHome.DesktopPath, new SuppressNavigationTransitionInfo());
173-
MainPage.accessibleAutoSuggestBox.PlaceholderText = "Search Desktop";
164+
//foreach (Microsoft.UI.Xaml.Controls.NavigationViewItemBase NavItemChoice in MainPage.nv.MenuItems)
165+
//{
166+
// if (NavItemChoice is Microsoft.UI.Xaml.Controls.NavigationViewItem && NavItemChoice.Name.ToString() == "DesktopIC")
167+
// {
168+
// MainPage.Select.itemSelected = NavItemChoice;
169+
// break;
170+
// }
171+
//}
172+
ProHome.locationsList.SelectedIndex = 1;
173+
ProHome.accessibleContentFrame.Navigate(typeof(PhotoAlbum), YourHome.DesktopPath, new SuppressNavigationTransitionInfo());
174174
}
175175
else if (clickedOnItem.FilePath == Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments))
176176
{
177177
App.PathText.Text = "Documents";
178-
foreach (Microsoft.UI.Xaml.Controls.NavigationViewItemBase NavItemChoice in MainPage.nv.MenuItems)
179-
{
180-
if (NavItemChoice is Microsoft.UI.Xaml.Controls.NavigationViewItem && NavItemChoice.Name.ToString() == "DocumentsIC")
181-
{
182-
MainPage.Select.itemSelected = NavItemChoice;
183-
break;
184-
}
185-
}
186-
MainPage.accessibleContentFrame.Navigate(typeof(GenericFileBrowser), YourHome.DocumentsPath, new SuppressNavigationTransitionInfo());
187-
MainPage.accessibleAutoSuggestBox.PlaceholderText = "Search Documents";
178+
//foreach (Microsoft.UI.Xaml.Controls.NavigationViewItemBase NavItemChoice in MainPage.nv.MenuItems)
179+
//{
180+
// if (NavItemChoice is Microsoft.UI.Xaml.Controls.NavigationViewItem && NavItemChoice.Name.ToString() == "DocumentsIC")
181+
// {
182+
// MainPage.Select.itemSelected = NavItemChoice;
183+
// break;
184+
// }
185+
//}
186+
ProHome.locationsList.SelectedIndex = 3;
187+
ProHome.accessibleContentFrame.Navigate(typeof(PhotoAlbum), YourHome.DocumentsPath, new SuppressNavigationTransitionInfo());
188188
}
189189
else if (clickedOnItem.FilePath == (Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) + @"\Downloads"))
190190
{
191191
App.PathText.Text = "Downloads";
192-
foreach (Microsoft.UI.Xaml.Controls.NavigationViewItemBase NavItemChoice in MainPage.nv.MenuItems)
193-
{
194-
if (NavItemChoice is Microsoft.UI.Xaml.Controls.NavigationViewItem && NavItemChoice.Name.ToString() == "DownloadsIC")
195-
{
196-
MainPage.Select.itemSelected = NavItemChoice;
197-
break;
198-
}
199-
}
200-
MainPage.accessibleContentFrame.Navigate(typeof(GenericFileBrowser), YourHome.DownloadsPath, new SuppressNavigationTransitionInfo());
201-
MainPage.accessibleAutoSuggestBox.PlaceholderText = "Search Downloads";
192+
//foreach (Microsoft.UI.Xaml.Controls.NavigationViewItemBase NavItemChoice in MainPage.nv.MenuItems)
193+
//{
194+
// if (NavItemChoice is Microsoft.UI.Xaml.Controls.NavigationViewItem && NavItemChoice.Name.ToString() == "DownloadsIC")
195+
// {
196+
// MainPage.Select.itemSelected = NavItemChoice;
197+
// break;
198+
// }
199+
//}
200+
ProHome.locationsList.SelectedIndex = 2;
201+
ProHome.accessibleContentFrame.Navigate(typeof(PhotoAlbum), YourHome.DownloadsPath, new SuppressNavigationTransitionInfo());
202202
}
203203
else if (clickedOnItem.FilePath == Environment.GetFolderPath(Environment.SpecialFolder.MyPictures))
204204
{
205-
foreach (Microsoft.UI.Xaml.Controls.NavigationViewItemBase NavItemChoice in MainPage.nv.MenuItems)
206-
{
207-
if (NavItemChoice is Microsoft.UI.Xaml.Controls.NavigationViewItem && NavItemChoice.Name.ToString() == "PicturesIC")
208-
{
209-
MainPage.Select.itemSelected = NavItemChoice;
210-
break;
211-
}
212-
}
213-
MainPage.accessibleContentFrame.Navigate(typeof(PhotoAlbum), YourHome.PicturesPath, new SuppressNavigationTransitionInfo());
214-
MainPage.accessibleAutoSuggestBox.PlaceholderText = "Search Pictures";
205+
//foreach (Microsoft.UI.Xaml.Controls.NavigationViewItemBase NavItemChoice in MainPage.nv.MenuItems)
206+
//{
207+
// if (NavItemChoice is Microsoft.UI.Xaml.Controls.NavigationViewItem && NavItemChoice.Name.ToString() == "PicturesIC")
208+
// {
209+
// MainPage.Select.itemSelected = NavItemChoice;
210+
// break;
211+
// }
212+
//}
213+
ProHome.accessibleContentFrame.Navigate(typeof(PhotoAlbum), YourHome.PicturesPath, new SuppressNavigationTransitionInfo());
214+
ProHome.locationsList.SelectedIndex = 4;
215215
App.PathText.Text = "Pictures";
216216
}
217217
else if (clickedOnItem.FilePath == Environment.GetFolderPath(Environment.SpecialFolder.MyMusic))
218218
{
219219
App.PathText.Text = "Music";
220-
foreach (Microsoft.UI.Xaml.Controls.NavigationViewItemBase NavItemChoice in MainPage.nv.MenuItems)
221-
{
222-
if (NavItemChoice is Microsoft.UI.Xaml.Controls.NavigationViewItem && NavItemChoice.Name.ToString() == "MusicIC")
223-
{
224-
MainPage.Select.itemSelected = NavItemChoice;
225-
break;
226-
}
227-
}
228-
MainPage.accessibleContentFrame.Navigate(typeof(GenericFileBrowser), YourHome.MusicPath, new SuppressNavigationTransitionInfo());
229-
MainPage.accessibleAutoSuggestBox.PlaceholderText = "Search Music";
220+
//foreach (Microsoft.UI.Xaml.Controls.NavigationViewItemBase NavItemChoice in MainPage.nv.MenuItems)
221+
//{
222+
// if (NavItemChoice is Microsoft.UI.Xaml.Controls.NavigationViewItem && NavItemChoice.Name.ToString() == "MusicIC")
223+
// {
224+
// MainPage.Select.itemSelected = NavItemChoice;
225+
// break;
226+
// }
227+
//}
228+
ProHome.locationsList.SelectedIndex = 5;
229+
ProHome.accessibleContentFrame.Navigate(typeof(PhotoAlbum), YourHome.MusicPath, new SuppressNavigationTransitionInfo());
230230
}
231231
else if (clickedOnItem.FilePath == (Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) + @"\OneDrive"))
232232
{
233233
App.PathText.Text = "OneDrive";
234-
foreach (Microsoft.UI.Xaml.Controls.NavigationViewItemBase NavItemChoice in MainPage.nv.MenuItems)
235-
{
236-
if (NavItemChoice is Microsoft.UI.Xaml.Controls.NavigationViewItem && NavItemChoice.Name.ToString() == "OneD_IC")
237-
{
238-
MainPage.Select.itemSelected = NavItemChoice;
239-
break;
240-
}
241-
}
242-
MainPage.accessibleContentFrame.Navigate(typeof(GenericFileBrowser), YourHome.OneDrivePath, new SuppressNavigationTransitionInfo());
243-
MainPage.accessibleAutoSuggestBox.PlaceholderText = "Search OneDrive";
234+
//foreach (Microsoft.UI.Xaml.Controls.NavigationViewItemBase NavItemChoice in MainPage.nv.MenuItems)
235+
//{
236+
// if (NavItemChoice is Microsoft.UI.Xaml.Controls.NavigationViewItem && NavItemChoice.Name.ToString() == "OneD_IC")
237+
// {
238+
// MainPage.Select.itemSelected = NavItemChoice;
239+
// break;
240+
// }
241+
//}
242+
ProHome.drivesList.SelectedIndex = 1;
243+
ProHome.accessibleContentFrame.Navigate(typeof(PhotoAlbum), YourHome.OneDrivePath, new SuppressNavigationTransitionInfo());
244244
}
245245
else if (clickedOnItem.FilePath == Environment.GetFolderPath(Environment.SpecialFolder.MyVideos))
246246
{
247247
App.PathText.Text = "Videos";
248-
foreach (Microsoft.UI.Xaml.Controls.NavigationViewItemBase NavItemChoice in MainPage.nv.MenuItems)
249-
{
250-
if (NavItemChoice is Microsoft.UI.Xaml.Controls.NavigationViewItem && NavItemChoice.Name.ToString() == "VideosIC")
251-
{
252-
MainPage.Select.itemSelected = NavItemChoice;
253-
break;
254-
}
255-
}
256-
MainPage.accessibleContentFrame.Navigate(typeof(GenericFileBrowser), YourHome.VideosPath, new SuppressNavigationTransitionInfo());
257-
MainPage.accessibleAutoSuggestBox.PlaceholderText = "Search Videos";
248+
//foreach (Microsoft.UI.Xaml.Controls.NavigationViewItemBase NavItemChoice in MainPage.nv.MenuItems)
249+
//{
250+
// if (NavItemChoice is Microsoft.UI.Xaml.Controls.NavigationViewItem && NavItemChoice.Name.ToString() == "VideosIC")
251+
// {
252+
// MainPage.Select.itemSelected = NavItemChoice;
253+
// break;
254+
// }
255+
//}
256+
ProHome.drivesList.SelectedIndex = 6;
257+
ProHome.accessibleContentFrame.Navigate(typeof(PhotoAlbum), YourHome.VideosPath, new SuppressNavigationTransitionInfo());
258258
}
259259
else
260260
{
261+
ProHome.drivesList.SelectedIndex = 0;
261262
App.PathText.Text = clickedOnItem.FilePath;
262-
foreach (Microsoft.UI.Xaml.Controls.NavigationViewItemBase NavItemChoice in MainPage.nv.MenuItems)
263-
{
264-
if (NavItemChoice is Microsoft.UI.Xaml.Controls.NavigationViewItem && NavItemChoice.Name.ToString() == "LocD_IC")
265-
{
266-
MainPage.Select.itemSelected = NavItemChoice;
267-
break;
268-
}
269-
}
263+
//foreach (Microsoft.UI.Xaml.Controls.NavigationViewItemBase NavItemChoice in MainPage.nv.MenuItems)
264+
//{
265+
// if (NavItemChoice is Microsoft.UI.Xaml.Controls.NavigationViewItem && NavItemChoice.Name.ToString() == "LocD_IC")
266+
// {
267+
// MainPage.Select.itemSelected = NavItemChoice;
268+
// break;
269+
// }
270+
//}
271+
270272
App.ViewModel.AddItemsToCollectionAsync(clickedOnItem.FilePath, PhotoAlbum.PAPageName);
271273
}
272274
}

0 commit comments

Comments
 (0)