diff --git a/CampusAppWP8/CampusAppWP8/Pages/Campusmap/RoomListPage.xaml b/CampusAppWP8/CampusAppWP8/Pages/Campusmap/RoomListPage.xaml index 12d47a20..ac0bb7cd 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Campusmap/RoomListPage.xaml +++ b/CampusAppWP8/CampusAppWP8/Pages/Campusmap/RoomListPage.xaml @@ -14,7 +14,8 @@ Foreground="{StaticResource PhoneForegroundBrush}" SupportedOrientations="Portrait" Orientation="Portrait" mc:Ignorable="d" - shell:SystemTray.IsVisible="True"> + shell:SystemTray.IsVisible="True" + x:Name="root"> @@ -26,34 +27,43 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CampusAppWP8/CampusAppWP8/Pages/Campusmap/RoomListPage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/Campusmap/RoomListPage.xaml.cs index da9c7fce..69fb12ef 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Campusmap/RoomListPage.xaml.cs +++ b/CampusAppWP8/CampusAppWP8/Pages/Campusmap/RoomListPage.xaml.cs @@ -8,6 +8,7 @@ //----------------------------------------------------------------------- namespace CampusAppWP8.Pages.Campusmap { + using System; using System.Collections.Generic; using System.Linq; using System.Windows; @@ -23,6 +24,7 @@ namespace CampusAppWP8.Pages.Campusmap using CampusAppWPortalLib8.Model.Campusmap.Pin; using CampusAppWPortalLib8.Model.Utility; using Microsoft.Phone.Controls; + using Microsoft.Phone.Shell; using CampusAppWPortalLib8.Model.GeoDb; /// Class of the RoomListPage. @@ -49,8 +51,7 @@ namespace CampusAppWP8.Pages.Campusmap /// The offset point. private MapPoint offsetPoint; - /// The layer list picker. - private ListPickerItemListModel layerListPicker; + private string selectedLayer = string.Empty; #endregion @@ -65,6 +66,20 @@ namespace CampusAppWP8.Pages.Campusmap #endregion + private string SelectedLayer + { + get + { + return this.selectedLayer; + } + + set + { + this.selectedLayer = value; + this.LayerTag.Text = value; + } + } + #region Method #region protected @@ -122,12 +137,12 @@ namespace CampusAppWP8.Pages.Campusmap string layerKey = this.building.GetLayerKey(NavigationContext.QueryString[Constants.ParamRoomId]); if (layerKey != null) { - this.Layer.SelectedIndex = this.layerListPicker.GetIndexOrDefault(layerKey); + this.SelectedLayer = layerKey; this.ShowCurrentRoom(NavigationContext.QueryString[Constants.ParamRoomId]); } } - this.ShowLayerPlaces(((ListPickerItemModel)this.Layer.SelectedItem).Value); + this.ShowLayerPlaces((this.selectedLayer.Length > 0) ? this.selectedLayer : (this.ApplicationBar.MenuItems[0] as ApplicationBarMenuItem).Text); } else { @@ -269,14 +284,19 @@ namespace CampusAppWP8.Pages.Campusmap /// Stubbfel, 14.10.2013. private void CreateLayerListPicker() { - this.layerListPicker = new ListPickerItemListModel(); + this.ApplicationBar.MenuItems.Clear(); foreach (string layername in this.building.Layers.Keys) { - this.layerListPicker.AddItem(layername, layername); + ApplicationBarMenuItem newMenuItem = new ApplicationBarMenuItem(layername); + newMenuItem.Click += this.OnMenuItemClicked; + this.ApplicationBar.MenuItems.Add(newMenuItem); } - this.Layer.ItemsSource = this.layerListPicker.List; + if (this.ApplicationBar.MenuItems.Count > 0) + { + this.SelectedLayer = (this.ApplicationBar.MenuItems[0] as ApplicationBarMenuItem).Text; + } } /// Shows the layer places. @@ -360,13 +380,13 @@ namespace CampusAppWP8.Pages.Campusmap Canvas.SetZIndex(this.imgMap, 0); } - /// Event handler. Called by Layer for selection changed events. - /// Stubbfel, 14.10.2013. - /// Source of the event. - /// Selection changed event information. - private void Layer_SelectionChanged(object sender, SelectionChangedEventArgs e) + private void OnMenuItemClicked(object sender, System.EventArgs e) { - this.ShowLayerPlaces(((ListPickerItemModel)this.Layer.SelectedItem).Value); + if (this.SelectedLayer.Equals((sender as ApplicationBarMenuItem).Text) == false) + { + this.SelectedLayer = (sender as ApplicationBarMenuItem).Text; + this.ShowLayerPlaces((sender as ApplicationBarMenuItem).Text); + } } /// Clears the map described by removeTags. @@ -400,6 +420,28 @@ namespace CampusAppWP8.Pages.Campusmap #endregion + /// Event handler. Called by ZoomIn for tap events. + /// Fiedler, 15.11.2013. + /// Source of the event. + /// Gesture event information. + private void ZoomIn_Tap(object sender, System.Windows.Input.GestureEventArgs e) + { + //throw new NotImplementedException("TODO"); + (this.MapCanvas.RenderTransform as ScaleTransform).ScaleX *= 1.5; + (this.MapCanvas.RenderTransform as ScaleTransform).ScaleY *= 1.5; + } + + /// Event handler. Called by ZoomOut for tap events. + /// Fiedler, 15.11.2013. + /// Source of the event. + /// Gesture event information. + private void ZoomOut_Tap(object sender, System.Windows.Input.GestureEventArgs e) + { + //throw new NotImplementedException("TODO"); + (this.MapCanvas.RenderTransform as ScaleTransform).ScaleX /= 1.5; + (this.MapCanvas.RenderTransform as ScaleTransform).ScaleY /= 1.5; + } + #endregion } } \ No newline at end of file