@@ -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}
0 commit comments