Merge branch 'feature/#243' into develop
This commit is contained in:
@@ -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">
|
||||
|
||||
<!--LayoutRoot ist das Stammraster, in dem alle anderen Seiteninhalte platziert werden-->
|
||||
<Grid x:Name="LayoutRoot" Background="Transparent">
|
||||
@@ -26,34 +27,43 @@
|
||||
<StackPanel Grid.Row="0">
|
||||
<header:DefaultHeader Name="DefHeader" HeaderName="{Binding Path=LocalizedResources.CampusMapApp_RoomListTitle, Source={StaticResource LocalizedStrings}}"/>
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Row="1" Margin="24,0,0,0">
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.LayerListPicker_Label, Source={StaticResource LocalizedStrings}}"/>
|
||||
<!-- Listpicket of courses -->
|
||||
<toolkit:ListPicker Name="Layer" ExpansionMode="FullScreenOnly" FullModeHeader="{Binding Path=LocalizedResources.ListPickerHeader_Layer, Source={StaticResource LocalizedStrings}}" SelectionChanged="Layer_SelectionChanged" >
|
||||
<toolkit:ListPicker.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel>
|
||||
<TextBlock Text="{Binding Text}"/>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</toolkit:ListPicker.ItemTemplate>
|
||||
<toolkit:ListPicker.FullModeItemTemplate>
|
||||
<DataTemplate>
|
||||
<Border BorderBrush="{StaticResource PhoneAccentBrush}" BorderThickness="12,0,0,0" Margin="0,0,0,6">
|
||||
<TextBlock Text="{Binding Text}" Style="{StaticResource PhoneTextGroupHeaderStyle}" TextWrapping="Wrap"/>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</toolkit:ListPicker.FullModeItemTemplate>
|
||||
</toolkit:ListPicker>
|
||||
</StackPanel>
|
||||
<ViewportControl Name="VPC" Grid.Row="2" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Bounds="0,-200,720,1200" Margin="24,12,12,0" >
|
||||
<Canvas Name="MapCanvas" Height="800" Width="480" VerticalAlignment="Top" HorizontalAlignment="Left" ManipulationDelta="MapCanvas_ManipulationDelta" ManipulationStarted="MapCanvas_ManipulationStarted" ManipulationCompleted="MapCanvas_ManipulationCompleted" Margin="-188,-200,-188,-200">
|
||||
<Image Name="imgMap" Height="{Binding ImageHeigh}" Width="{Binding ImageWidth}" Source="{Binding ImageSource}" HorizontalAlignment="Left" VerticalAlignment="Top"/>
|
||||
<Canvas.RenderTransform>
|
||||
<ScaleTransform/>
|
||||
</Canvas.RenderTransform>
|
||||
</Canvas>
|
||||
</ViewportControl>
|
||||
|
||||
<Grid Grid.Row="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<TextBlock Grid.Column="0" Text="{Binding Path=LocalizedResources.LayerListPicker_Label, Source={StaticResource LocalizedStrings}}" Margin="24,0,24,0"/>
|
||||
<TextBlock x:Name="LayerTag" Grid.Column="1" Text="" HorizontalAlignment="Center" />
|
||||
</Grid>
|
||||
<Canvas Grid.Row="2" x:Name="MainCanvas" Margin="12">
|
||||
<ViewportControl Name="VPC" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Bounds="0,-200,720,1200" Width="{Binding ActualWidth, ElementName=MainCanvas, Mode=OneWay}" Height="{Binding ActualHeight, ElementName=MainCanvas, Mode=OneWay}">
|
||||
<Canvas Name="MapCanvas" Height="800" Width="480" VerticalAlignment="Top" HorizontalAlignment="Left" ManipulationDelta="MapCanvas_ManipulationDelta" ManipulationStarted="MapCanvas_ManipulationStarted" ManipulationCompleted="MapCanvas_ManipulationCompleted" Margin="-188,-200,-188,-200">
|
||||
<Image Name="imgMap" Height="{Binding ImageHeigh}" Width="{Binding ImageWidth}" Source="{Binding ImageSource}" HorizontalAlignment="Left" VerticalAlignment="Top"/>
|
||||
<Canvas.RenderTransform>
|
||||
<ScaleTransform/>
|
||||
</Canvas.RenderTransform>
|
||||
</Canvas>
|
||||
</ViewportControl>
|
||||
|
||||
<Grid x:Name="BtnGrid" Width="{Binding ActualWidth, ElementName=MainCanvas, Mode=OneWay}" Height="60">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Border Grid.Column="0" BorderThickness="2" BorderBrush="{StaticResource PhoneAccentBrush}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
|
||||
<TextBlock Text="ZoomIn" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="{StaticResource PhoneAccentBrush}" Tap="ZoomIn_Tap"/>
|
||||
</Border>
|
||||
<Border Grid.Column="1" BorderThickness="2" BorderBrush="{StaticResource PhoneAccentBrush}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
|
||||
<TextBlock Text="ZoomOut" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="{StaticResource PhoneAccentBrush}" Tap="ZoomOut_Tap"/>
|
||||
</Border>
|
||||
</Grid>
|
||||
</Canvas>
|
||||
</Grid>
|
||||
|
||||
<phone:PhoneApplicationPage.ApplicationBar>
|
||||
<shell:ApplicationBar IsVisible="True" IsMenuEnabled="True" Mode="Minimized" />
|
||||
</phone:PhoneApplicationPage.ApplicationBar>
|
||||
</phone:PhoneApplicationPage>
|
||||
@@ -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;
|
||||
|
||||
/// <summary> Class of the RoomListPage. </summary>
|
||||
@@ -49,8 +51,7 @@ namespace CampusAppWP8.Pages.Campusmap
|
||||
/// <summary> The offset point. </summary>
|
||||
private MapPoint offsetPoint;
|
||||
|
||||
/// <summary> The layer list picker. </summary>
|
||||
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
|
||||
/// <remarks> Stubbfel, 14.10.2013. </remarks>
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> Shows the layer places. </summary>
|
||||
@@ -360,13 +380,13 @@ namespace CampusAppWP8.Pages.Campusmap
|
||||
Canvas.SetZIndex(this.imgMap, 0);
|
||||
}
|
||||
|
||||
/// <summary> Event handler. Called by Layer for selection changed events. </summary>
|
||||
/// <remarks> Stubbfel, 14.10.2013. </remarks>
|
||||
/// <param name="sender"> Source of the event. </param>
|
||||
/// <param name="e"> Selection changed event information. </param>
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> Clears the map described by removeTags. </summary>
|
||||
@@ -400,6 +420,28 @@ namespace CampusAppWP8.Pages.Campusmap
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary> Event handler. Called by ZoomIn for tap events. </summary>
|
||||
/// <remarks> Fiedler, 15.11.2013. </remarks>
|
||||
/// <param name="sender"> Source of the event. </param>
|
||||
/// <param name="e"> Gesture event information. </param>
|
||||
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;
|
||||
}
|
||||
|
||||
/// <summary> Event handler. Called by ZoomOut for tap events. </summary>
|
||||
/// <remarks> Fiedler, 15.11.2013. </remarks>
|
||||
/// <param name="sender"> Source of the event. </param>
|
||||
/// <param name="e"> Gesture event information. </param>
|
||||
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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user