diff --git a/CampusAppWP8/CampusAppWP8/App.xaml b/CampusAppWP8/CampusAppWP8/App.xaml
index a4aef1d3..282eda77 100644
--- a/CampusAppWP8/CampusAppWP8/App.xaml
+++ b/CampusAppWP8/CampusAppWP8/App.xaml
@@ -16,6 +16,7 @@
+
diff --git a/CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/departments_159.png b/CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/departments_159.png
deleted file mode 100644
index 917436d2..00000000
Binary files a/CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/departments_159.png and /dev/null differ
diff --git a/CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/events_159.png b/CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/events_159.png
new file mode 100644
index 00000000..85178e99
Binary files /dev/null and b/CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/events_159.png differ
diff --git a/CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/lehrstuehle_159.png b/CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/lehrstuehle_159.png
new file mode 100644
index 00000000..02d15bff
Binary files /dev/null and b/CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/lehrstuehle_159.png differ
diff --git a/CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/mensa_159.png b/CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/mensa_159.png
deleted file mode 100644
index 3a6abae2..00000000
Binary files a/CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/mensa_159.png and /dev/null differ
diff --git a/CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/mensaplan_159.png b/CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/mensaplan_159.png
new file mode 100644
index 00000000..fe25b542
Binary files /dev/null and b/CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/mensaplan_159.png differ
diff --git a/CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/news_159.png b/CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/news_159.png
index 2d11f51b..37bfd04b 100644
Binary files a/CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/news_159.png and b/CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/news_159.png differ
diff --git a/CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/placeinfo_159.png b/CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/placeinfo_159.png
index f95a93ca..5065137f 100644
Binary files a/CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/placeinfo_159.png and b/CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/placeinfo_159.png differ
diff --git a/CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/placeinfoacces_159.png b/CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/placeinfoacces_159.png
new file mode 100644
index 00000000..9abdc9ae
Binary files /dev/null and b/CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/placeinfoacces_159.png differ
diff --git a/CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/placeinfowc_159.png b/CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/placeinfowc_159.png
new file mode 100644
index 00000000..d0885d65
Binary files /dev/null and b/CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/placeinfowc_159.png differ
diff --git a/CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/placelab_159.png b/CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/placelab_159.png
new file mode 100644
index 00000000..39943f90
Binary files /dev/null and b/CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/placelab_159.png differ
diff --git a/CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/placesearchred_159.png b/CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/placesearchred_159.png
new file mode 100644
index 00000000..ef79139b
Binary files /dev/null and b/CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/placesearchred_159.png differ
diff --git a/CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/pos_159.png b/CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/pos_159.png
new file mode 100644
index 00000000..7c9b56cc
Binary files /dev/null and b/CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/pos_159.png differ
diff --git a/CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/student_council_159.png b/CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/student_council_159.png
index 26ab3658..998d470e 100644
Binary files a/CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/student_council_159.png and b/CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/student_council_159.png differ
diff --git a/CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/events_159.png b/CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/events_159.png
new file mode 100644
index 00000000..811253df
Binary files /dev/null and b/CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/events_159.png differ
diff --git a/CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/departments_159.png b/CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/lehrstuehle_159.png
similarity index 100%
rename from CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/departments_159.png
rename to CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/lehrstuehle_159.png
diff --git a/CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/mensa_159.png b/CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/mensa_159.png
deleted file mode 100644
index e1f15575..00000000
Binary files a/CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/mensa_159.png and /dev/null differ
diff --git a/CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/mensaplan_159.png b/CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/mensaplan_159.png
new file mode 100644
index 00000000..2327a52d
Binary files /dev/null and b/CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/mensaplan_159.png differ
diff --git a/CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/news_159.png b/CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/news_159.png
index 9d7650bd..75e64a3f 100644
Binary files a/CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/news_159.png and b/CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/news_159.png differ
diff --git a/CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/placeinfo_159.png b/CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/placeinfo_159.png
index f95a93ca..5065137f 100644
Binary files a/CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/placeinfo_159.png and b/CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/placeinfo_159.png differ
diff --git a/CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/placeinfoacces_159.png b/CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/placeinfoacces_159.png
new file mode 100644
index 00000000..a29a38f1
Binary files /dev/null and b/CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/placeinfoacces_159.png differ
diff --git a/CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/placeinfowc_159.png b/CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/placeinfowc_159.png
new file mode 100644
index 00000000..d0885d65
Binary files /dev/null and b/CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/placeinfowc_159.png differ
diff --git a/CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/placelab_159.png b/CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/placelab_159.png
new file mode 100644
index 00000000..39943f90
Binary files /dev/null and b/CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/placelab_159.png differ
diff --git a/CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/placesearchred_159.png b/CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/placesearchred_159.png
new file mode 100644
index 00000000..ef79139b
Binary files /dev/null and b/CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/placesearchred_159.png differ
diff --git a/CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/pos_159.png b/CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/pos_159.png
new file mode 100644
index 00000000..757bb58f
Binary files /dev/null and b/CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/pos_159.png differ
diff --git a/CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/student_council_159.png b/CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/student_council_159.png
index 47ed68d2..29fc275b 100644
Binary files a/CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/student_council_159.png and b/CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/student_council_159.png differ
diff --git a/CampusAppWP8/CampusAppWP8/Assets/Maps/IKMZ.png b/CampusAppWP8/CampusAppWP8/Assets/Maps/IKMZ.png
new file mode 100644
index 00000000..a65e9b28
Binary files /dev/null and b/CampusAppWP8/CampusAppWP8/Assets/Maps/IKMZ.png differ
diff --git a/CampusAppWP8/CampusAppWP8/Assets/Maps/MZG.png b/CampusAppWP8/CampusAppWP8/Assets/Maps/MZG.png
new file mode 100644
index 00000000..30e6ba8d
Binary files /dev/null and b/CampusAppWP8/CampusAppWP8/Assets/Maps/MZG.png differ
diff --git a/CampusAppWP8/CampusAppWP8/Assets/campusmap.png b/CampusAppWP8/CampusAppWP8/Assets/Maps/campusmap.png
similarity index 100%
rename from CampusAppWP8/CampusAppWP8/Assets/campusmap.png
rename to CampusAppWP8/CampusAppWP8/Assets/Maps/campusmap.png
diff --git a/CampusAppWP8/CampusAppWP8/Assets/testmap.png b/CampusAppWP8/CampusAppWP8/Assets/testmap.png
deleted file mode 100644
index a2cdfad3..00000000
Binary files a/CampusAppWP8/CampusAppWP8/Assets/testmap.png and /dev/null differ
diff --git a/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj b/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj
index f2216b62..06f8c6ff 100644
--- a/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj
+++ b/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj
@@ -113,12 +113,18 @@
+
+
+
+
+
+
@@ -132,8 +138,12 @@
+
+
+ BTUTagInfo.xaml
+
RoomListPage.xaml
@@ -156,6 +166,7 @@
+
DefaultHeader.xaml
@@ -284,6 +295,10 @@
Designer
MSBuild:Compile
+
+ Designer
+ MSBuild:Compile
+
Designer
MSBuild:Compile
@@ -427,7 +442,17 @@
PreserveNewest
-
+
+
+
+
+
+
+
+
+
+
+
@@ -446,7 +471,11 @@
+
+
+
+
@@ -458,12 +487,10 @@
-
-
@@ -476,10 +503,6 @@
-
-
-
-
@@ -487,7 +510,11 @@
+
+
+
+
@@ -505,7 +532,8 @@
-
+
+
PreserveNewest
@@ -524,6 +552,7 @@
+
Designer
@@ -572,6 +601,7 @@
CampusAppWPortalLib8
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/CampusAppWP8/CampusAppWP8/Pages/BTUTag/BTUTagInfo.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/BTUTag/BTUTagInfo.xaml.cs
new file mode 100644
index 00000000..954a455e
--- /dev/null
+++ b/CampusAppWP8/CampusAppWP8/Pages/BTUTag/BTUTagInfo.xaml.cs
@@ -0,0 +1,45 @@
+
+namespace CampusAppWP8.Pages.BTTTag
+{
+ using System;
+ using System.Windows.Navigation;
+ using CampusApp8.Model.Setting;
+ using Microsoft.Phone.Controls;
+
+ public partial class BTUTagInfo : PhoneApplicationPage
+ {
+
+ #region Member
+ private TagHandlerListPickerItemListModel taghandlerModel;
+ #endregion
+
+ #region Constructor
+
+ public BTUTagInfo()
+ {
+ InitializeComponent();
+ this.taghandlerModel = new TagHandlerListPickerItemListModel();
+ this.TagHandler.ItemsSource = this.taghandlerModel.List;
+ int tagselIndex = this.taghandlerModel.GetIndexOrDefault(Settings.AppSetting.TagDefaultHandler.ToString());
+ this.TagHandler.SelectedIndex = tagselIndex;
+ }
+
+ #endregion
+
+ #region Method
+
+ ///
+ /// Override the OnNavigatedFrom method
+ ///
+ /// Arguments of navigation
+ protected override void OnNavigatedFrom(NavigationEventArgs e)
+ {
+ if (NavigationMode.Back == e.NavigationMode)
+ {
+ Settings.AppSetting.TagDefaultHandler = (CampusAppWP8.Model.Setting.AppSettings.BTUTagDefaultHandler)Enum.Parse(typeof(CampusAppWP8.Model.Setting.AppSettings.BTUTagDefaultHandler), ((CampusAppWPortalLib8.Model.Utility.ListPickerItemModel)this.TagHandler.SelectedItem).Value);
+ }
+ }
+
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/CampusAppWP8/CampusAppWP8/Pages/Campusmap/CampusMapPage.xaml b/CampusAppWP8/CampusAppWP8/Pages/Campusmap/CampusMapPage.xaml
index 29065130..4dc52a98 100644
--- a/CampusAppWP8/CampusAppWP8/Pages/Campusmap/CampusMapPage.xaml
+++ b/CampusAppWP8/CampusAppWP8/Pages/Campusmap/CampusMapPage.xaml
@@ -8,10 +8,11 @@
xmlns:Location="clr-namespace:System.Device.Location;assembly=System.Device"
x:Class="CampusAppWP8.Pages.Campusmap.CampusMapPage"
xmlns:lui="clr-namespace:CampusAppWP8.Utility.Lui.Button"
+ xmlns:header="clr-namespace:CampusAppWP8.Utility.Lui.Header"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}"
- SupportedOrientations="PortraitOrLandscape" Orientation="Portrait"
+ SupportedOrientations="Portrait" Orientation="Portrait"
mc:Ignorable="d"
shell:SystemTray.IsVisible="True">
@@ -21,10 +22,9 @@
-
-
-
+
+
@@ -40,18 +40,16 @@
-
+
-
-
+
diff --git a/CampusAppWP8/CampusAppWP8/Pages/Campusmap/CampusMapPage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/Campusmap/CampusMapPage.xaml.cs
index 39877a04..6e076da1 100644
--- a/CampusAppWP8/CampusAppWP8/Pages/Campusmap/CampusMapPage.xaml.cs
+++ b/CampusAppWP8/CampusAppWP8/Pages/Campusmap/CampusMapPage.xaml.cs
@@ -16,7 +16,9 @@ namespace CampusAppWP8.Pages.Campusmap
using System.Threading;
using System.Windows;
using System.Windows.Controls;
+ using System.Windows.Input;
using System.Windows.Navigation;
+ using Windows.Networking.Proximity;
using CampusAppWP8.File.Places;
using CampusAppWP8.Model.Campusmap;
using CampusAppWP8.Model.GeoDb;
@@ -26,7 +28,6 @@ namespace CampusAppWP8.Pages.Campusmap
using CampusAppWP8.Utility.NDEF;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
- using Windows.Networking.Proximity;
/// Class for the campusMap page.
/// Stubbfel, 19.08.2013.
@@ -65,6 +66,8 @@ namespace CampusAppWP8.Pages.Campusmap
///
private bool buildInfoEnable;
+ private long ndefId;
+
#endregion
#region Constructor
@@ -81,12 +84,12 @@ namespace CampusAppWP8.Pages.Campusmap
if (menuItem1 != null)
{
- menuItem1.Text = AppResources.CampusMapApp_ScanQR;
+ menuItem1.Text = AppResources.App_ScanQR;
}
if (menuItem2 != null)
{
- menuItem2.Text = AppResources.CampusMapApp_ScanNfc;
+ menuItem2.Text = AppResources.App_ScanNfc;
}
if (menuItem3 != null)
@@ -117,6 +120,7 @@ namespace CampusAppWP8.Pages.Campusmap
/// Event for loading places
///
public event LoadingPlace OnLoadingPlace;
+
#endregion
#region Method
@@ -139,8 +143,17 @@ namespace CampusAppWP8.Pages.Campusmap
if (NavigationContext.QueryString.ContainsKey(Constants.ParamModelMap_SearchTermAlias))
{
string alias = NavigationContext.QueryString[Constants.ParamModelMap_SearchTermAlias];
+
this.ShowPlacesByQueryAsSearchPin(alias);
scroll = false;
+ if (Utilities.IsRoomId(alias))
+ {
+ PlaceModel place = this.file.Model.GetPlaceById(alias);
+ if (place != null)
+ {
+ this.GoToRoomList(place.ParentId, place.PlaceId);
+ }
+ }
}
else
{
@@ -156,13 +169,38 @@ namespace CampusAppWP8.Pages.Campusmap
App.SaveToIsolatedStorage(Constants.CampusMapApp_QRCodeSearchResultStorageKey, null);
string searchPid = Wp8StringManager.FilterPlaceIdinQRResultString(qrcodeResult);
+ PlaceModel place = this.file.Model.GetPlaceById(searchPid);
+
if (searchPid != null)
{
- this.ShowAllPlacesByPlaceIdAsSearchPin(searchPid);
+
+ //this.ShowAllPlacesByPlaceIdAsSearchPin(searchPid);
+ if (place.ParentId.Equals(this.campusMap.CampusId))
+ {
+ this.ShowAllPlacesByPlaceIdAsSearchPin(searchPid);
+ }
+ else
+ {
+ this.GoToRoomList(place.ParentId, place.PlaceId);
+ }
}
}
+
+ ndefId = this.device.SubscribeForMessage(Constants.NCFMessageType_NDEF, this.NDEFHandler);
}
+ ///
+ /// Methods overrides the OnNavigatedFrom-Method
+ ///
+ /// some NavigationEventArgs
+ protected override void OnNavigatedFrom(NavigationEventArgs e)
+ {
+ this.device.StopSubscribingForMessage(ndefId);
+
+ base.OnNavigatedFrom(e);
+ }
+
+
#endregion
#region private
@@ -447,8 +485,9 @@ namespace CampusAppWP8.Pages.Campusmap
private void SearchPlaceByNFC_Click(object sender, EventArgs e)
{
MessageBoxes.ShowMainModelInfoMessageBox(AppResources.ScarNfc_Search);
- this.ProgressBar.Visibility = Visibility.Visible;
- long id = this.device.SubscribeForMessage(Constants.NCFMessageType_NDEF, this.NDEFHandler);
+ this.DefHeader.ProgressVisibility = Visibility.Visible;
+ this.device.StopSubscribingForMessage(this.ndefId);
+ this.ndefId = this.device.SubscribeForMessage(Constants.NCFMessageType_NDEF, this.NDEFHandler);
}
///
@@ -481,16 +520,33 @@ namespace CampusAppWP8.Pages.Campusmap
// search for placeId
string nfcContent = ndef.GetContent();
string searchPid = Wp8StringManager.FilterPlaceIdinNFCResultString(nfcContent.Trim());
+ PlaceModel place = this.file.Model.GetPlaceById(searchPid);
+
if (searchPid != null)
{
// add pins to map
if (this.Dispatcher != null)
{
- this.Dispatcher.BeginInvoke(new Action(() => this.ShowAllPlacesByPlaceIdAsSearchPin(searchPid)));
+ if (place.ParentId.Equals(this.campusMap.CampusId))
+ {
+ this.Dispatcher.BeginInvoke(new Action(() => this.ShowAllPlacesByPlaceIdAsSearchPin(searchPid)));
+ }
+ else
+ {
+ this.Dispatcher.BeginInvoke(new Action(() => this.GoToRoomList(place.ParentId, place.PlaceId)));
+ }
}
else
{
- this.ShowAllPlacesByPlaceIdAsSearchPin(searchPid);
+ //this.ShowAllPlacesByPlaceIdAsSearchPin(searchPid);
+ if (place.ParentId.Equals(this.campusMap.CampusId))
+ {
+ this.ShowAllPlacesByPlaceIdAsSearchPin(searchPid);
+ }
+ else
+ {
+ this.GoToRoomList(place.ParentId, place.PlaceId);
+ }
}
}
else
@@ -508,12 +564,15 @@ namespace CampusAppWP8.Pages.Campusmap
if (this.Dispatcher != null)
{
- this.Dispatcher.BeginInvoke(new Action(() => this.ProgressBar.Visibility = Visibility.Collapsed));
+ this.Dispatcher.BeginInvoke(new Action(() => this.DefHeader.ProgressVisibility = Visibility.Collapsed));
}
else
{
- this.ProgressBar.Visibility = Visibility.Collapsed;
+ this.DefHeader.ProgressVisibility = Visibility.Collapsed;
}
+ ndefId = this.device.SubscribeForMessage(Constants.NCFMessageType_NDEF, this.NDEFHandler);
+
+
}
/// Searches for the first places.
@@ -589,6 +648,23 @@ namespace CampusAppWP8.Pages.Campusmap
MapScroller.UpdateLayout();
if (scroll)
{
+ if (scrollPoint.X > this.campusMap.ImageWidth)
+ {
+ scrollPoint.X = this.campusMap.ImageWidth;
+ }
+ else if (scrollPoint.X < 0)
+ {
+ scrollPoint.X = 0;
+ }
+
+ if (scrollPoint.Y > this.campusMap.ImageHeight)
+ {
+ scrollPoint.Y = this.campusMap.ImageHeight;
+ }
+ else if (scrollPoint.Y < 0)
+ {
+ scrollPoint.Y = 0;
+ }
MapScroller.ScrollToVerticalOffset(scrollPoint.Y);
MapScroller.ScrollToHorizontalOffset(scrollPoint.X);
}
@@ -608,7 +684,7 @@ namespace CampusAppWP8.Pages.Campusmap
/// (Optional) the scroll.
private void ShowCurrentPositionDispatcher(bool scroll = true)
{
- ProgressBar.Visibility = Visibility.Visible;
+ this.DefHeader.ProgressVisibility = Visibility.Visible;
Thread thread = new Thread(delegate() { this.ShowCurrentPosition(scroll); });
thread.Start();
@@ -635,11 +711,11 @@ namespace CampusAppWP8.Pages.Campusmap
{
if (this.Dispatcher != null)
{
- this.Dispatcher.BeginInvoke(new Action(() => this.ProgressBar.Visibility = Visibility.Collapsed));
+ this.Dispatcher.BeginInvoke(new Action(() => this.DefHeader.ProgressVisibility = Visibility.Collapsed));
}
else
{
- this.ProgressBar.Visibility = Visibility.Collapsed;
+ this.DefHeader.ProgressVisibility = Visibility.Collapsed;
}
}
}
@@ -651,14 +727,14 @@ namespace CampusAppWP8.Pages.Campusmap
{
string lat = App.LoadFromAppState(Constants.GeoWatch_CurrentPosition_Lat);
string log = App.LoadFromAppState(Constants.GeoWatch_CurrentPosition_Long);
- if (lat == null || log == null ||(lat.Equals("0") && log.Equals("0")))
+ if (lat == null || log == null || (lat.Equals("0") && log.Equals("0")))
{
if (Settings.AppSetting.GeoWatchEnable)
{
MessageBoxes.ShowMainModelInfoMessageBox(AppResources.MsgBox_NoLocation);
}
- this.ProgressBar.Visibility = Visibility.Collapsed;
+ this.DefHeader.ProgressVisibility = Visibility.Collapsed;
}
else
{
@@ -683,7 +759,7 @@ namespace CampusAppWP8.Pages.Campusmap
}
this.AddPin(x, y, type, scroll);
- ProgressBar.Visibility = Visibility.Collapsed;
+ this.DefHeader.ProgressVisibility = Visibility.Collapsed;
}
///
@@ -692,6 +768,11 @@ namespace CampusAppWP8.Pages.Campusmap
/// List of places
private void ShowMapInfo(List places)
{
+ if (places == null)
+ {
+ return;
+ }
+
string msgText = string.Empty;
foreach (PlaceModel place in places)
{
@@ -733,16 +814,26 @@ namespace CampusAppWP8.Pages.Campusmap
MessageBoxResult msgResult = MessageBoxes.ShowPlaceInfoOkCancelMessageBox(AppResources.MsgBox_ShowRoomList);
if (msgResult.Equals(MessageBoxResult.OK))
{
- string urlString = Constants.PathCampusmap_RoomListPage;
- urlString += "?" + Constants.ParamBuildingId + "=" + place.PlaceId;
- Uri url = new Uri(urlString as string, UriKind.Relative);
- this.NavigationService.Navigate(url);
+ this.GoToRoomList(place.PlaceId);
return;
}
}
}
}
+ private void GoToRoomList(string buildingId, string roomId = null)
+ {
+ string urlString = Constants.PathCampusmap_RoomListPage;
+ urlString += "?" + Constants.ParamBuildingId + "=" + buildingId;
+ if (roomId != null)
+ {
+ urlString += "&" + Constants.ParamRoomId + "=" + roomId;
+ }
+ Uri url = new Uri(urlString as string, UriKind.Relative);
+ this.NavigationService.Navigate(url);
+ }
+
+
///
/// Method check if a certain place has some rooms
///
@@ -761,6 +852,16 @@ namespace CampusAppWP8.Pages.Campusmap
return false;
}
+
+ private void Button_KeyDown(object sender, System.Windows.Input.KeyEventArgs e)
+ {
+ if (e.Key == Key.Enter)
+ {
+ this.SearchByText(sender, e);
+ this.MapScroller.Focus();
+ }
+
+ }
#endregion
#endregion
diff --git a/CampusAppWP8/CampusAppWP8/Pages/Campusmap/RoomListPage.xaml b/CampusAppWP8/CampusAppWP8/Pages/Campusmap/RoomListPage.xaml
index be326965..12d47a20 100644
--- a/CampusAppWP8/CampusAppWP8/Pages/Campusmap/RoomListPage.xaml
+++ b/CampusAppWP8/CampusAppWP8/Pages/Campusmap/RoomListPage.xaml
@@ -7,42 +7,53 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:lui="clr-namespace:CampusAppWP8.Utility.Lui.Button"
- mc:Ignorable="d"
+ xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
+ xmlns:header="clr-namespace:CampusAppWP8.Utility.Lui.Header"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}"
- SupportedOrientations="Portrait" Orientation="Portrait"
+ SupportedOrientations="Portrait" Orientation="Portrait"
+ mc:Ignorable="d"
shell:SystemTray.IsVisible="True">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ 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 dc0cac40..7205a010 100644
--- a/CampusAppWP8/CampusAppWP8/Pages/Campusmap/RoomListPage.xaml.cs
+++ b/CampusAppWP8/CampusAppWP8/Pages/Campusmap/RoomListPage.xaml.cs
@@ -17,6 +17,13 @@ namespace CampusAppWP8.Pages.Campusmap
using CampusAppWP8.Resources;
using Microsoft.Phone.Controls;
using CampusAppWP8.Utility.Lui.MessageBoxes;
+ using CampusAppWP8.Model.Campusmap;
+ using System.Windows;
+ using System.Windows.Controls;
+ using CampusAppWP8.Utility;
+ using System.Windows.Input;
+ using System.Windows.Media;
+ using CampusAppWPortalLib8.Model.Utility;
///
/// Class of the RoomListPage
@@ -34,6 +41,14 @@ namespace CampusAppWP8.Pages.Campusmap
///
private CampusBuildingModel building;
+ /// Variable for the map model.
+ private BuildingMapModel buildingMap;
+
+ private bool pinchRun = false;
+ private Point mappoint;
+ private Point offsetPoint;
+ private ListPickerItemListModel layerListPicker;
+
#endregion
#region Constructor
@@ -85,23 +100,32 @@ namespace CampusAppWP8.Pages.Campusmap
{
if (this.placeFile.Model != null)
{
- this.SetupPivot();
+ this.SetupMap();
}
}
///
/// Method setup the PivotElement
///
- private void SetupPivot()
+ private void SetupMap()
{
if (NavigationContext.QueryString.ContainsKey(Constants.ParamBuildingId))
{
- this.building = new CampusBuildingModel(NavigationContext.QueryString[Constants.ParamBuildingId], this.placeFile.Model.Places.ToList());
+ this.setupCanvas(NavigationContext.QueryString[Constants.ParamBuildingId]);
+ this.createLayerListPicker();
if (this.building != null && this.building.Layers != null && this.building.Layers.Count > 0)
{
- this.SetCaptionsToRooms();
- this.RoomPivot.ItemsSource = this.GetSortedLayers(this.building);
+ if (NavigationContext.QueryString.ContainsKey(Constants.ParamRoomId))
+ {
+ string layerKey = this.building.GetLayerKey(NavigationContext.QueryString[Constants.ParamRoomId]);
+ if (layerKey != null)
+ {
+ this.Layer.SelectedIndex = this.layerListPicker.GetIndexOrDefault(layerKey);
+ this.showCurrentRoom(NavigationContext.QueryString[Constants.ParamRoomId]);
+ }
+ }
+ this.showLayerPlaces(((ListPickerItemModel)this.Layer.SelectedItem).Value);
}
else
{
@@ -112,44 +136,227 @@ namespace CampusAppWP8.Pages.Campusmap
{
MessageBoxes.ShowMainModelErrorMessageBox(AppResources.MsgBox_ErrorMainModelLoad);
}
-
+
}
- ///
- /// Method sorts the Layers
- ///
- /// building of the layers
- /// sorted Dictionary
- private Dictionary GetSortedLayers(CampusBuildingModel build)
+ private void showCurrentRoom(string placeId)
{
- Dictionary result = new Dictionary();
- foreach (CampusBuildingLayerModel layer in build.Layers.Values)
+
+ double x;
+ double y;
+
+ this.ClearMap(new List() { MapPinModel.InfoPlacePinString });
+
+ PlaceModel room = this.building.GetPlaceById(placeId);
+
+ x = room.GeoRefPoint.Longitude;
+ y = room.GeoRefPoint.Latitude;
+ Point roompoint = this.buildingMap.GetScrollPoint(this.buildingMap.ConverToPixelPoint(this.buildingMap.ConverToMapPoint(x, y)));
+ Point viewPoint = new Point(roompoint.X - mappoint.X + offsetPoint.X, roompoint.Y - mappoint.Y + offsetPoint.Y);
+
+ MapCanvas.Children.Add(this.buildingMap.AddPin(viewPoint, MapPinModel.PinType.InfoRedPlace, new List { room }));
+ }
+
+ private void ShowMapInfo(List places)
+ {
+ if (this.pinchRun)
{
- var sortRom = from place in layer.Rooms.Places
- orderby place.GetInformationsValue(Constants.PisInformationName_Typ), place.GetInformationsValue(Constants.PisInformationName_Name)
- select place;
- result.Add(layer.LayerId, new CampusBuildingLayerModel(layer.LayerId, sortRom.ToList()));
+ return;
+ }
+ string msgText = string.Empty;
+ if (places == null)
+ {
+ return;
+ }
+ foreach (PlaceModel place in places)
+ {
+ msgText += AppResources.PlaceLabel_Name + ": ";
+ msgText += place.GetInformationsValue(Constants.PisInformationName_Name);
+ msgText = Wp8StringManager.AddNewLine(msgText);
+
+ string type = place.GetInformationsValue(Constants.PisInformationName_Typ);
+ if (type != null)
+ {
+ msgText += AppResources.PlaceLabel_Type + ": ";
+ msgText += type;
+ msgText = Wp8StringManager.AddNewLine(msgText);
+ }
+
+ string shortDesc = place.GetInformationsValue(Constants.PisInformationName_ShortDesc);
+ if (shortDesc != null)
+ {
+ msgText += AppResources.PlaceLabel_ShortDesc + ": ";
+ msgText += shortDesc;
+ msgText = Wp8StringManager.AddNewLine(msgText);
+ }
+
+ string access = place.GetInformationsValue(Constants.PisInformationName_Accesbility);
+ if (access != null)
+ {
+ msgText += AppResources.PlaceLabel_Accessbility + ": ";
+ msgText += access;
+ msgText = Wp8StringManager.AddNewLine(msgText);
+ }
}
- return result;
+ MessageBoxes.ShowMainModelInfoMessageBox(msgText);
}
- ///
- /// Method set all rooms a formatted string , which will be show as buttonContent
- ///
- private void SetCaptionsToRooms()
+ private void MapCanvas_ManipulationDelta(object sender, System.Windows.Input.ManipulationDeltaEventArgs e)
{
- string name;
- string type;
- foreach (CampusBuildingLayerModel layer in this.building.Layers.Values)
+ PinchManipulation pinch = e.PinchManipulation;
+ if (pinch == null)
{
- foreach (PlaceModel place in layer.Rooms.Places)
+ return;
+ }
+
+ ScaleTransform scale = MapCanvas.RenderTransform as ScaleTransform;
+
+ if (scale == null)
+ {
+ return;
+ }
+
+ double scaleVal = pinch.CumulativeScale;
+ if (scaleVal < 1)
+ {
+
+ scaleVal = 1;
+ }
+ else if (scaleVal > 1.5)
+ {
+ scaleVal = 1.5;
+ }
+
+ scale.ScaleX = scaleVal;
+ scale.ScaleY = scaleVal;
+
+
+
+ var newCenter = e.PinchManipulation.Current.Center;
+ scale.CenterX = newCenter.X;
+ scale.CenterY = newCenter.Y;
+ }
+
+ private void MapCanvas_ManipulationCompleted(object sender, ManipulationCompletedEventArgs e)
+ {
+ this.pinchRun = false;
+ }
+
+ private void MapCanvas_ManipulationStarted(object sender, ManipulationStartedEventArgs e)
+ {
+ this.pinchRun = true;
+ }
+
+ private void createLayerListPicker()
+ {
+ layerListPicker = new ListPickerItemListModel();
+
+ foreach (string layername in this.building.Layers.Keys)
+ {
+ layerListPicker.AddItem(layername, layername);
+ }
+ this.Layer.ItemsSource = layerListPicker.List;
+ }
+
+ private void showLayerPlaces(string layerKey = null)
+ {
+ if (layerKey == null)
+ {
+ layerKey = this.building.Layers.Keys.First();
+ }
+
+ CampusBuildingLayerModel layer = this.building.Layers[layerKey];
+ double x;
+ double y;
+
+ this.ClearMap(new List() { MapPinModel.InfoPlacePinString });
+
+ foreach (PlaceModel room in layer.Rooms.Places)
+ {
+ x = room.GeoRefPoint.Longitude;
+ y = room.GeoRefPoint.Latitude;
+ Point roompoint = this.buildingMap.GetScrollPoint(this.buildingMap.ConverToPixelPoint(this.buildingMap.ConverToMapPoint(x, y)));
+ Point viewPoint = new Point(roompoint.X - mappoint.X + offsetPoint.X, roompoint.Y - mappoint.Y + offsetPoint.Y);
+
+ MapPinModel.PinType type;
+
+ switch (room.GetInformationsValue(Constants.PisInformationName_Typ))
{
- name = place.GetInformationsValue(Constants.PisInformationName_Name);
- type = place.GetInformationsValue(Constants.PisInformationName_Typ);
- if (name != null && type != null)
+ case "Labor":
+ type = MapPinModel.PinType.InfoLabPlace;
+ break;
+ case "Zugangsbereich":
+ type = MapPinModel.PinType.InfoAccesPlace;
+ break;
+ case "WC":
+ type = MapPinModel.PinType.InfoWcPlace;
+ break;
+ case "Regal":
+ continue;
+ default:
+ type = MapPinModel.PinType.InfoPlace;
+ break;
+
+ }
+ MapCanvas.Children.Add(this.buildingMap.AddPin(viewPoint, type, new List { room }));
+ }
+
+ // MapCanvas.Children.Add(this.buildingMap.AddPin(offsetPoint, MapPinModel.PinType.SearchPlace));
+ }
+
+ private void showLayerPlaces(int index = 0)
+ {
+ string layerKey = this.building.Layers.Keys.ElementAt(index);
+ this.showLayerPlaces(layerKey);
+ }
+
+ private void setupCanvas(string buildingId)
+ {
+ this.building = new CampusBuildingModel(buildingId, this.placeFile.Model.Places.ToList());
+
+ this.buildingMap = new BuildingMapModel(this.building.Building.PlaceId);
+ this.buildingMap.ShowMapInfos += new CBMainMapModel.MapInfos(this.ShowMapInfo);
+ this.DefHeader.HeaderName = AppResources.CampusMapApp_RoomListTitle + " (" + this.building.Building.GetInformationsValue(Constants.PisInformationName_ShortName) + ")";
+
+ double y = this.building.Building.GeoRefPoint.Latitude;
+ double x = this.building.Building.GeoRefPoint.Longitude;
+ mappoint = this.buildingMap.GetScrollPoint(this.buildingMap.ConverToPixelPoint(this.buildingMap.ConverToMapPoint(x, y)));
+ offsetPoint = new Point(-this.buildingMap.MapImageOffsetX, -this.buildingMap.MapImageOffsetY);
+
+ this.MapCanvas.DataContext = buildingMap;
+
+ Canvas.SetLeft(this.imgMap, -1 * mappoint.X);
+ Canvas.SetTop(this.imgMap, -1 * mappoint.Y);
+ Canvas.SetZIndex(this.imgMap, 0);
+ }
+
+ private void Layer_SelectionChanged(object sender, SelectionChangedEventArgs e)
+ {
+ this.showLayerPlaces(((ListPickerItemModel)this.Layer.SelectedItem).Value);
+ }
+
+ private void ClearMap(List removeTags = null)
+ {
+ if (removeTags == null)
+ {
+ MapCanvas.Children.Clear();
+ }
+ else
+ {
+ List childs = MapCanvas.Children.ToList();
+ foreach (UIElement child in childs)
+ {
+ Image childImg = child as Image;
+ if (childImg == null || childImg.Tag == null)
{
- place.Caption = name + " (" + type + ")";
+ continue;
+ }
+
+ string imgTag = childImg.Tag.ToString().Trim();
+ if (removeTags.Contains(imgTag))
+ {
+ MapCanvas.Children.Remove(child);
}
}
}
diff --git a/CampusAppWP8/CampusAppWP8/Pages/Departments/DepartmentFavoritePage.xaml b/CampusAppWP8/CampusAppWP8/Pages/Departments/DepartmentFavoritePage.xaml
index 41b7eb21..b0abbe4c 100644
--- a/CampusAppWP8/CampusAppWP8/Pages/Departments/DepartmentFavoritePage.xaml
+++ b/CampusAppWP8/CampusAppWP8/Pages/Departments/DepartmentFavoritePage.xaml
@@ -6,6 +6,7 @@
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:header="clr-namespace:CampusAppWP8.Utility.Lui.Header"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}"
@@ -20,12 +21,8 @@
-
-
-
-
-
-
+
+
@@ -39,8 +36,8 @@
-
-
+
+
diff --git a/CampusAppWP8/CampusAppWP8/Pages/Departments/DepartmentFavoritePage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/Departments/DepartmentFavoritePage.xaml.cs
index f45eb0cb..b94a4a7f 100644
--- a/CampusAppWP8/CampusAppWP8/Pages/Departments/DepartmentFavoritePage.xaml.cs
+++ b/CampusAppWP8/CampusAppWP8/Pages/Departments/DepartmentFavoritePage.xaml.cs
@@ -66,7 +66,7 @@ namespace CampusAppWP8.Pages.Departments
protected override void OnNavigatedTo(NavigationEventArgs e)
{
base.OnNavigatedTo(e);
- this.progressBar.Visibility = Visibility.Visible;
+ this.DefHeader.ProgressVisibility = Visibility.Visible;
if (this.isNewInstance)
{
@@ -95,7 +95,7 @@ namespace CampusAppWP8.Pages.Departments
this.isSourceSet = true;
}
- this.progressBar.Visibility = Visibility.Collapsed;
+ this.DefHeader.ProgressVisibility = Visibility.Collapsed;
}
///
@@ -180,7 +180,7 @@ namespace CampusAppWP8.Pages.Departments
FrameworkElement infoBtn = sender as FrameworkElement;
string chairName = ((this.lastClickedBtn as Button).Content as TextBlock).Text.ToString();
- NavigationService.Navigate(new Uri(Constants.PathDepartment_DepartmentInfoPage + "?url=" + infoBtn.Tag.ToString() + "&name=" + chairName, UriKind.Relative));
+ NavigationService.Navigate(new Uri(Constants.PathDepartment_DepartmentInfoPage + "?" + Constants.ParamUrl + "=" + infoBtn.Tag.ToString() + "&" + Constants.ParamName + "=" + chairName, UriKind.Relative));
}
#endregion
diff --git a/CampusAppWP8/CampusAppWP8/Pages/Departments/DepartmentIndexPage.xaml b/CampusAppWP8/CampusAppWP8/Pages/Departments/DepartmentIndexPage.xaml
index b1f6f8b6..d8cd2952 100644
--- a/CampusAppWP8/CampusAppWP8/Pages/Departments/DepartmentIndexPage.xaml
+++ b/CampusAppWP8/CampusAppWP8/Pages/Departments/DepartmentIndexPage.xaml
@@ -7,6 +7,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:lui="clr-namespace:CampusAppWP8.Utility.Lui.Button"
+ xmlns:header="clr-namespace:CampusAppWP8.Utility.Lui.Header"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}"
@@ -18,16 +19,12 @@
-
+
-
-
-
-
-
-
+
+
@@ -38,7 +35,7 @@
-
+
@@ -61,7 +58,7 @@
-
+
diff --git a/CampusAppWP8/CampusAppWP8/Pages/Departments/DepartmentIndexPage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/Departments/DepartmentIndexPage.xaml.cs
index cfdf92f8..c740b5fe 100644
--- a/CampusAppWP8/CampusAppWP8/Pages/Departments/DepartmentIndexPage.xaml.cs
+++ b/CampusAppWP8/CampusAppWP8/Pages/Departments/DepartmentIndexPage.xaml.cs
@@ -44,19 +44,10 @@ namespace CampusAppWP8.Pages.Departments
public DepartmentIndexPage()
{
this.InitializeComponent();
- this.progressBar.Visibility = Visibility.Visible;
+ this.DefHeader.ProgressVisibility = Visibility.Visible;
//// init feed objects
- if (DepartmentIndexPage.feed == null)
- {
- DepartmentIndexPage.feed = new DepartmentFeed(false);
- }
-
- DepartmentIndexPage.feed.OnLoaded += new DepartmentFeed.OnIO(this.SetupFacultyList);
- DepartmentIndexPage.feed.OnFailedWeb += new DepartmentFeed.OnFailed(this.FeedIsFailedWeb);
- DepartmentIndexPage.feed.OnFailedFile += new DepartmentFeed.OnFailed(this.FeedIsFailedFile);
-
- DepartmentIndexPage.feed.LoadData(Utilities.GetLoadModus());
+ DepartmentIndexPage.InitFeed(this.SetupFacultyList, this.FeedIsFailedWeb, this.FeedIsFailedFile);
if (DepartmentIndexPage.favorite == null)
{
@@ -83,10 +74,7 @@ namespace CampusAppWP8.Pages.Departments
set
{
- if (value != DepartmentIndexPage.feed)
- {
- DepartmentIndexPage.feed = value;
- }
+ DepartmentIndexPage.feed = value;
}
}
@@ -179,13 +167,33 @@ namespace CampusAppWP8.Pages.Departments
{
}
+ ///
+ /// Initialize the feed objects and load the data.
+ ///
+ public static void InitFeed(DepartmentFeed.OnIO onLoaded = null, DepartmentFeed.OnIO failedWeb = null, DepartmentFeed.OnIO failedFile = null)
+ {
+ if (DepartmentIndexPage.feed == null)
+ {
+ DepartmentIndexPage.feed = new DepartmentFeed(false);
+ }
+
+ if(onLoaded != null)
+ DepartmentIndexPage.feed.OnLoaded += new DepartmentFeed.OnIO(onLoaded);
+ if(failedWeb != null)
+ DepartmentIndexPage.feed.OnFailedWeb += new DepartmentFeed.OnFailed(failedWeb);
+ if(failedFile != null)
+ DepartmentIndexPage.feed.OnFailedFile += new DepartmentFeed.OnFailed(failedFile);
+
+ DepartmentIndexPage.feed.LoadData(Utilities.GetLoadModus());
+ }
+
///
/// Setup the faculty list.
///
private void SetupFacultyList()
{
this.FacultyList.ItemsSource = DepartmentIndexPage.feed.Model.Faculties;
- this.progressBar.Visibility = Visibility.Collapsed;
+ this.DefHeader.ProgressVisibility = Visibility.Collapsed;
}
///
@@ -251,7 +259,7 @@ namespace CampusAppWP8.Pages.Departments
///
private void FeedIsFailedFile()
{
- this.progressBar.Visibility = Visibility.Collapsed;
+ this.DefHeader.ProgressVisibility = Visibility.Collapsed;
MessageBoxResult result = MessageBoxes.ShowMainModelErrorMessageBox(AppResources.MsgBox_ErrorMainModelLoadFile);
}
diff --git a/CampusAppWP8/CampusAppWP8/Pages/Departments/DepartmentInfoPage.xaml b/CampusAppWP8/CampusAppWP8/Pages/Departments/DepartmentInfoPage.xaml
index 19d9b033..ce9fbe42 100644
--- a/CampusAppWP8/CampusAppWP8/Pages/Departments/DepartmentInfoPage.xaml
+++ b/CampusAppWP8/CampusAppWP8/Pages/Departments/DepartmentInfoPage.xaml
@@ -6,6 +6,7 @@
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:header="clr-namespace:CampusAppWP8.Utility.Lui.Header"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}"
@@ -21,11 +22,8 @@
-
-
-
-
-
+
+
diff --git a/CampusAppWP8/CampusAppWP8/Pages/Departments/DepartmentInfoPage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/Departments/DepartmentInfoPage.xaml.cs
index f9c98b98..64baf51b 100644
--- a/CampusAppWP8/CampusAppWP8/Pages/Departments/DepartmentInfoPage.xaml.cs
+++ b/CampusAppWP8/CampusAppWP8/Pages/Departments/DepartmentInfoPage.xaml.cs
@@ -8,14 +8,23 @@
namespace CampusAppWP8.Pages.Departments
{
using System;
+ using System.Windows;
+ using System.Collections.Generic;
+ using System.Collections.ObjectModel;
using System.Windows.Navigation;
using Microsoft.Phone.Controls;
+ using CampusAppWP8.Resources;
+ using CampusAppWPortalLib8.Model.Departments;
///
/// Info page of a chair.
///
public partial class DepartmentInfoPage : PhoneApplicationPage
{
+ private bool feedLoadedFlag = false;
+
+ private string chairName = string.Empty;
+
#region Constructor
///
@@ -41,15 +50,32 @@ namespace CampusAppWP8.Pages.Departments
{
base.OnNavigatedTo(e);
- string url = string.Empty;
- string chairName = string.Empty;
+ this.feedLoadedFlag = false;
- if (NavigationContext.QueryString.TryGetValue("url", out url)
- && NavigationContext.QueryString.TryGetValue("name", out chairName))
+ string url = string.Empty;
+
+ if(NavigationContext.QueryString.TryGetValue(Constants.ParamName, out this.chairName))
+ {
+ this.DefHeader.HeaderName = this.chairName;
+ }
+
+ if (NavigationContext.QueryString.TryGetValue(Constants.ParamUrl, out url))
{
- this.PageHeadline.Text = chairName;
this.WebBrowser.Navigate(new Uri(url, UriKind.Absolute));
}
+ else
+ {
+ CampusAppWP8.Feed.Departments.DepartmentFeed temp = DepartmentIndexPage.Feed;
+
+ if (temp != null)
+ {
+ this.OnFeedReady();
+ }
+ else
+ {
+ DepartmentIndexPage.InitFeed(this.OnFeedReady);
+ }
+ }
}
#endregion
@@ -64,6 +90,52 @@ namespace CampusAppWP8.Pages.Departments
private void PhoneApplicationPage_OrientationChanged(object sender, OrientationChangedEventArgs e)
{
}
+
+ ///
+ /// On feed ready.
+ ///
+ private void OnFeedReady()
+ {
+ if (this.feedLoadedFlag == false)
+ {
+ this.feedLoadedFlag = true;
+ DepartmentIndexPage.Feed.OnLoaded -= this.OnFeedReady;
+
+ ChairModel chair = null;
+ ObservableCollection tempModelList = DepartmentIndexPage.GetFeed().Model.Faculties;
+
+ foreach (CampusAppWPortalLib8.Model.Departments.FacultyModel model in tempModelList)
+ {
+ if (chair == null)
+ {
+ chair = model.GetChairModel(this.chairName);
+ }
+ }
+
+ if (chair != null)
+ {
+ this.WebBrowser.Navigate(new Uri(chair.Url, UriKind.Absolute));
+ }
+ else
+ {
+ MessageBoxResult res = MessageBox.Show(AppResources.DepartmentNotFound + " " + AppResources.DepartmentForwarding, string.Empty, MessageBoxButton.OKCancel);
+
+ switch (res)
+ {
+ case MessageBoxResult.OK:
+ {
+ NavigationService.Navigate(new Uri(Constants.PathDepartment_DepartmentIndexPage, UriKind.Relative));
+ }
+ break;
+ case MessageBoxResult.Cancel:
+ {
+ NavigationService.GoBack();
+ }
+ break;
+ }
+ }
+ }
+ }
#endregion
diff --git a/CampusAppWP8/CampusAppWP8/Pages/Departments/DepartmentPage.xaml b/CampusAppWP8/CampusAppWP8/Pages/Departments/DepartmentPage.xaml
index 5e6f7462..86be4065 100644
--- a/CampusAppWP8/CampusAppWP8/Pages/Departments/DepartmentPage.xaml
+++ b/CampusAppWP8/CampusAppWP8/Pages/Departments/DepartmentPage.xaml
@@ -6,7 +6,7 @@
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:viewModel="clr-namespace:CampusAppWP8.Model.Departments"
+ xmlns:header="clr-namespace:CampusAppWP8.Utility.Lui.Header"
mc:Ignorable="d"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
@@ -17,13 +17,20 @@
-
+
+
+
+
+
+
+
+
-
+
-
+
@@ -39,8 +46,8 @@
-
-
+
+
diff --git a/CampusAppWP8/CampusAppWP8/Pages/Departments/DepartmentPage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/Departments/DepartmentPage.xaml.cs
index 1dd9291d..b3189a4e 100644
--- a/CampusAppWP8/CampusAppWP8/Pages/Departments/DepartmentPage.xaml.cs
+++ b/CampusAppWP8/CampusAppWP8/Pages/Departments/DepartmentPage.xaml.cs
@@ -66,7 +66,7 @@ namespace CampusAppWP8.Pages.Departments
protected override void OnNavigatedTo(NavigationEventArgs e)
{
base.OnNavigatedTo(e);
- this.progressBar.Visibility = Visibility.Visible;
+ this.DefHeader.ProgressVisibility = Visibility.Visible;
if (this.isNewInstance)
{
@@ -113,7 +113,7 @@ namespace CampusAppWP8.Pages.Departments
}
}
- this.progressBar.Visibility = Visibility.Collapsed;
+ this.DefHeader.ProgressVisibility = Visibility.Collapsed;
}
///
@@ -205,7 +205,7 @@ namespace CampusAppWP8.Pages.Departments
FrameworkElement infoBtn = sender as FrameworkElement;
string chairName = ((this.lastClickedBtn as Button).Content as TextBlock).Text.ToString();
- NavigationService.Navigate(new Uri(Constants.PathDepartment_DepartmentInfoPage + "?url=" + infoBtn.Tag.ToString() + "&name=" + chairName, UriKind.Relative));
+ NavigationService.Navigate(new Uri(Constants.PathDepartment_DepartmentInfoPage + "?" + Constants.ParamUrl + "=" + infoBtn.Tag.ToString() + "&" + Constants.ParamName + "=" + chairName, UriKind.Relative));
}
#endregion
diff --git a/CampusAppWP8/CampusAppWP8/Pages/Dev/QRScanner.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/Dev/QRScanner.xaml.cs
index 9126ab91..15003e4f 100644
--- a/CampusAppWP8/CampusAppWP8/Pages/Dev/QRScanner.xaml.cs
+++ b/CampusAppWP8/CampusAppWP8/Pages/Dev/QRScanner.xaml.cs
@@ -23,6 +23,8 @@ namespace CampusAppWP8.Pages.Dev
using Microsoft.Devices;
using Microsoft.Phone.Controls;
using ZXing;
+ using CampusAppWP8.Utility.Lui.MessageBoxes;
+ using CampusAppWP8.Model.Setting;
///
/// QR Code scanner.
@@ -228,16 +230,25 @@ namespace CampusAppWP8.Pages.Dev
}
else
{
- string pid = Wp8StringManager.FilterPlaceIdinQRResultString(result.Text);
- string urlString = Constants.PathCampusmap_Campusmap;
- urlString += "?" + Constants.ParamModelMap_SearchTermAlias + "=" + pid;
- Uri url = new Uri(urlString as string, UriKind.Relative);
- NavigationService.Navigate(url);
+ this.GoToCampusMappage(result.Text);
}
}
else
{
- MessageBox.Show(result.Text);
+ if (AppSettings.BTUTagDefaultHandler.CampusMap == Settings.AppSetting.TagDefaultHandler)
+ {
+ this.GoToCampusMappage(result.Text);
+ }
+ else
+ {
+ MessageBoxResult msgResult = MessageBoxes.ShowBtuTagInfoOkCancelMessageBox(result.Text);
+ if (msgResult.Equals(MessageBoxResult.OK))
+ {
+ string urlString = Constants.PathBTUTag_Info;
+ Uri url = new Uri(urlString as string, UriKind.Relative);
+ this.NavigationService.Navigate(url);
+ }
+ }
}
});
}
@@ -247,6 +258,15 @@ namespace CampusAppWP8.Pages.Dev
}
}
+ private void GoToCampusMappage(string tagContent)
+ {
+ string pid = Wp8StringManager.FilterPlaceIdinQRResultString(tagContent);
+ string urlString = Constants.PathCampusmap_Campusmap;
+ urlString += "?" + Constants.ParamModelMap_SearchTermAlias + "=" + pid;
+ Uri url = new Uri(urlString as string, UriKind.Relative);
+ NavigationService.Navigate(url);
+ }
+
///
/// Capture thread function.
///
@@ -259,10 +279,10 @@ namespace CampusAppWP8.Pages.Dev
{
//if (this.isInAutofocus == false)
//{
- this.cam.GetPreviewBufferArgb32(buffer);
+ this.cam.GetPreviewBufferArgb32(buffer);
- this.OnCaptureImage(buffer, (int)resolution.Width, (int)resolution.Height);
- this.isInAutofocus = true;
+ this.OnCaptureImage(buffer, (int)resolution.Width, (int)resolution.Height);
+ this.isInAutofocus = true;
//}
System.Threading.Thread.Sleep(1000);
diff --git a/CampusAppWP8/CampusAppWP8/Pages/Events/EventIndexPage.xaml b/CampusAppWP8/CampusAppWP8/Pages/Events/EventIndexPage.xaml
index 0aac8c25..f680cfc0 100644
--- a/CampusAppWP8/CampusAppWP8/Pages/Events/EventIndexPage.xaml
+++ b/CampusAppWP8/CampusAppWP8/Pages/Events/EventIndexPage.xaml
@@ -7,6 +7,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:lui="clr-namespace:CampusAppWP8.Utility.Lui.Button"
+ xmlns:header="clr-namespace:CampusAppWP8.Utility.Lui.Header"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}"
@@ -21,14 +22,16 @@
-
-
+
+
+
-
+