Skip to content

Commit c2b69a3

Browse files
committed
Re-enable card press
1 parent 5c437db commit c2b69a3

File tree

4 files changed

+73
-36
lines changed

4 files changed

+73
-36
lines changed

Files UWP/FilesUWP.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<DefaultLanguage>en-US</DefaultLanguage>
1313
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
1414
<TargetPlatformVersion Condition=" '$(TargetPlatformVersion)' == '' ">10.0.18342.0</TargetPlatformVersion>
15-
<TargetPlatformMinVersion>10.0.18342.0</TargetPlatformMinVersion>
15+
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
1616
<MinimumVisualStudioVersion>14</MinimumVisualStudioVersion>
1717
<FileAlignment>512</FileAlignment>
1818
<ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>

Files UWP/YourHome.xaml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -403,11 +403,7 @@
403403

404404
<controls:DropShadowPanel Style="{StaticResource DropShadowPanelStyle1}" PointerEntered="DropShadowPanel_PointerEntered" PointerExited="DropShadowPanel_PointerExited" OffsetX="0" OffsetY="5.00" ShadowOpacity="0" Padding="0,0,-4,0" BlurRadius="10" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch" HorizontalAlignment="Stretch" Margin="0,0,0,0" VerticalAlignment="Stretch">
405405
<Grid >
406-
<Button Background="{ThemeResource YourHomeCardBackgroundColor}" Style="{StaticResource ButtonRevealStyle}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" CornerRadius="5">
407-
<!--<Button.Fill>
408-
--><!--<ImageBrush Stretch="UniformToFill" ImageSource="{Binding ImageSource}"/>--><!--
409-
<SolidColorBrush Color="{StaticResource SystemChromeMediumColor}" />
410-
</Button.Fill>-->
406+
<Button Tag="{Binding Icon}" IsTapEnabled="True" Tapped="Button_Tapped" Background="{ThemeResource YourHomeCardBackgroundColor}" Style="{StaticResource ButtonRevealStyle}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" CornerRadius="5">
411407
<TextBlock Canvas.ZIndex="5" Foreground="{ThemeResource SystemControlForegroundAccentBrush}" FontFamily="Segoe MDL2 Assets" FontSize="58" Text="{Binding Icon}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
412408
</Button>
413409
</Grid>

Files UWP/YourHome.xaml.cs

Lines changed: 70 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -26,35 +26,6 @@ public YourHome()
2626
InitializeComponent();
2727
Locations.ItemLoader.itemsAdded.Clear();
2828
Locations.ItemLoader.DisplayItems();
29-
SizeChanged += YourHome_SizeChanged;
30-
var bounds = ApplicationView.GetForCurrentView().VisibleBounds;
31-
var scaleFactor = DisplayInformation.GetForCurrentView().RawPixelsPerViewPixel;
32-
var size = new Size(Convert.ToInt32(bounds.Width * scaleFactor), Convert.ToInt32(bounds.Height * scaleFactor));
33-
// If width is between 1 - 800
34-
if (bounds.Width >= 1 && bounds.Width <= 800)
35-
{
36-
37-
}
38-
else if (bounds.Width > 800 && bounds.Width <= 1024)
39-
{
40-
41-
}
42-
}
43-
44-
private void YourHome_SizeChanged(object sender, SizeChangedEventArgs e)
45-
{
46-
var bounds = ApplicationView.GetForCurrentView().VisibleBounds;
47-
var scaleFactor = DisplayInformation.GetForCurrentView().RawPixelsPerViewPixel;
48-
var size = new Size(Convert.ToInt32(bounds.Width * scaleFactor), Convert.ToInt32(bounds.Height * scaleFactor));
49-
// If width is between 1 - 800
50-
if (bounds.Width >= 1 && bounds.Width <= 800)
51-
{
52-
53-
}
54-
else if (bounds.Width > 800 && bounds.Width <= 1024)
55-
{
56-
57-
}
5829
}
5930

6031
private void CardPressed(object sender, ItemClickEventArgs e)
@@ -138,5 +109,75 @@ private void DropShadowPanel_PointerExited(object sender, Windows.UI.Xaml.Input.
138109
{
139110
(sender as DropShadowPanel).ShadowOpacity = 0.00;
140111
}
112+
113+
private void Button_Tapped(object sender, Windows.UI.Xaml.Input.TappedRoutedEventArgs e)
114+
{
115+
var clickedButton = sender as Button;
116+
if(clickedButton.Tag.ToString() == "\xE896") // Downloads
117+
{
118+
foreach (Microsoft.UI.Xaml.Controls.NavigationViewItemBase NavItemChoice in MainPage.nv.MenuItems)
119+
{
120+
if (NavItemChoice is Microsoft.UI.Xaml.Controls.NavigationViewItem && NavItemChoice.Name.ToString() == "DownloadsIC")
121+
{
122+
MainPage.Select.itemSelected = NavItemChoice;
123+
break;
124+
}
125+
}
126+
App.ViewModel.TextState.isVisible = Visibility.Collapsed;
127+
MainPage.accessibleContentFrame.Navigate(typeof(GenericFileBrowser), DownloadsPath);
128+
}
129+
else if(clickedButton.Tag.ToString() == "\xE8A5") // Documents
130+
{
131+
foreach (Microsoft.UI.Xaml.Controls.NavigationViewItemBase NavItemChoice in MainPage.nv.MenuItems)
132+
{
133+
if (NavItemChoice is Microsoft.UI.Xaml.Controls.NavigationViewItem && NavItemChoice.Name.ToString() == "DocumentsIC")
134+
{
135+
MainPage.Select.itemSelected = NavItemChoice;
136+
break;
137+
}
138+
}
139+
App.ViewModel.TextState.isVisible = Visibility.Collapsed;
140+
MainPage.accessibleContentFrame.Navigate(typeof(GenericFileBrowser), DocumentsPath);
141+
}
142+
else if(clickedButton.Tag.ToString() == "\xEB9F") // Pictures
143+
{
144+
foreach (Microsoft.UI.Xaml.Controls.NavigationViewItemBase NavItemChoice in MainPage.nv.MenuItems)
145+
{
146+
if (NavItemChoice is Microsoft.UI.Xaml.Controls.NavigationViewItem && NavItemChoice.Name.ToString() == "PicturesIC")
147+
{
148+
MainPage.Select.itemSelected = NavItemChoice;
149+
break;
150+
}
151+
}
152+
App.ViewModel.TextState.isVisible = Visibility.Collapsed;
153+
MainPage.accessibleContentFrame.Navigate(typeof(PhotoAlbum), PicturesPath);
154+
}
155+
else if(clickedButton.Tag.ToString() == "\xEC4F") // Music
156+
{
157+
foreach (Microsoft.UI.Xaml.Controls.NavigationViewItemBase NavItemChoice in MainPage.nv.MenuItems)
158+
{
159+
if (NavItemChoice is Microsoft.UI.Xaml.Controls.NavigationViewItem && NavItemChoice.Name.ToString() == "MusicIC")
160+
{
161+
MainPage.Select.itemSelected = NavItemChoice;
162+
break;
163+
}
164+
}
165+
App.ViewModel.TextState.isVisible = Visibility.Collapsed;
166+
MainPage.accessibleContentFrame.Navigate(typeof(GenericFileBrowser), MusicPath);
167+
}
168+
else if(clickedButton.Tag.ToString() == "\xE8B2") // Videos
169+
{
170+
foreach (Microsoft.UI.Xaml.Controls.NavigationViewItemBase NavItemChoice in MainPage.nv.MenuItems)
171+
{
172+
if (NavItemChoice is Microsoft.UI.Xaml.Controls.NavigationViewItem && NavItemChoice.Name.ToString() == "VideosIC")
173+
{
174+
MainPage.Select.itemSelected = NavItemChoice;
175+
break;
176+
}
177+
}
178+
App.ViewModel.TextState.isVisible = Visibility.Collapsed;
179+
MainPage.accessibleContentFrame.Navigate(typeof(GenericFileBrowser), VideosPath);
180+
}
181+
}
141182
}
142183
}

FilesUwp.Package/FilesUwp.Package.wapproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
<PropertyGroup>
3737
<ProjectGuid>3b15596c-3db9-4b58-b4c8-442d06a8c130</ProjectGuid>
3838
<TargetPlatformVersion>10.0.18342.0</TargetPlatformVersion>
39-
<TargetPlatformMinVersion>10.0.18342.0</TargetPlatformMinVersion>
39+
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
4040
<DefaultLanguage>en-US</DefaultLanguage>
4141
<PackageCertificateKeyFile>FilesUwp.Package_TemporaryKey.pfx</PackageCertificateKeyFile>
4242
<EntryPointProjectUniqueName>..\Files UWP\FilesUWP.csproj</EntryPointProjectUniqueName>

0 commit comments

Comments
 (0)