Merge branch 'develop' into feature/#173
Conflicts: CampusAppWP8/CampusAppWP8/Resources/AppResources.Designer.cs work/geoApi/Offlinemap.xml
@@ -16,6 +16,7 @@
|
||||
<local:LocalizedStrings xmlns:local="clr-namespace:CampusAppWP8" x:Key="LocalizedStrings"/>
|
||||
<local:ThemelizedIcons xmlns:local="clr-namespace:CampusAppWP8" x:Key="ThemelizedIcons"/>
|
||||
<local:Const xmlns:local="clr-namespace:CampusAppWP8" x:Key="Const"/>
|
||||
<local:BoolToVisibilityConverter xmlns:local="clr-namespace:CampusAppWP8.Utility" x:Key="BoolToVisibilityConverter"/>
|
||||
</ResourceDictionary>
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
|
||||
|
Before Width: | Height: | Size: 5.4 KiB |
BIN
CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/events_159.png
Normal file
|
After Width: | Height: | Size: 3.5 KiB |
|
After Width: | Height: | Size: 979 B |
|
Before Width: | Height: | Size: 9.0 KiB |
|
After Width: | Height: | Size: 3.1 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 4.4 KiB |
|
After Width: | Height: | Size: 1003 B |
|
After Width: | Height: | Size: 755 B |
BIN
CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/pos_159.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/speaker_159.png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 7.3 KiB After Width: | Height: | Size: 5.0 KiB |
BIN
CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/events_159.png
Normal file
|
After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 864 B After Width: | Height: | Size: 864 B |
|
Before Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 4.4 KiB |
|
After Width: | Height: | Size: 1003 B |
|
After Width: | Height: | Size: 755 B |
BIN
CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/pos_159.png
Normal file
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 8.1 KiB After Width: | Height: | Size: 5.3 KiB |
BIN
CampusAppWP8/CampusAppWP8/Assets/Maps/IKMZ.png
Normal file
|
After Width: | Height: | Size: 44 KiB |
BIN
CampusAppWP8/CampusAppWP8/Assets/Maps/MZG.png
Normal file
|
After Width: | Height: | Size: 97 KiB |
|
Before Width: | Height: | Size: 1.1 MiB After Width: | Height: | Size: 1.1 MiB |
|
Before Width: | Height: | Size: 10 KiB |
@@ -113,12 +113,18 @@
|
||||
<Compile Include="File\Exams\ExamFile.cs" />
|
||||
<Compile Include="File\Places\PlacesFile.cs" />
|
||||
<Compile Include="Model\BinaryModel.cs" />
|
||||
<Compile Include="Model\Campusmap\BuildingMapModel.cs" />
|
||||
<Compile Include="Model\Campusmap\CampusMapModel.cs" />
|
||||
<Compile Include="Model\Campusmap\CBMainMapModel.cs" />
|
||||
<Compile Include="Model\Campusmap\ClickAblePlacePinModel.cs" />
|
||||
<Compile Include="Model\Campusmap\CurrentPositionPinModel.cs" />
|
||||
<Compile Include="Model\Campusmap\HiddenPinPlaceModel.cs" />
|
||||
<Compile Include="Model\Campusmap\InfoPlacePinModel.cs" />
|
||||
<Compile Include="Model\Campusmap\CBMainMapRoomModel.cs" />
|
||||
<Compile Include="Model\Campusmap\InfoLabPlacePinModel.cs" />
|
||||
<Compile Include="Model\Campusmap\InfoPlaceRedPinModel.cs" />
|
||||
<Compile Include="Model\Campusmap\InfoPlaceAccessPinModel.cs" />
|
||||
<Compile Include="Model\Campusmap\InfoPlaceWCPinModel.cs" />
|
||||
<Compile Include="Model\Campusmap\SearchPlacePinModel.cs" />
|
||||
<Compile Include="Model\Exams\ExamListWp8Model.cs" />
|
||||
<Compile Include="Model\Exams\ExamWp8Model.cs" />
|
||||
@@ -132,6 +138,7 @@
|
||||
<Compile Include="Model\Person\PersonListWp8Model.cs" />
|
||||
<Compile Include="Model\Person\PersonWp8Model.cs" />
|
||||
<Compile Include="Model\Setting\AppSettings.cs" />
|
||||
<Compile Include="Model\Setting\TagHandlerListPickerItemListModel.cs" />
|
||||
<Compile Include="Model\Setting\UserProfilModel.cs" />
|
||||
<Compile Include="Model\TimeTable\AppointmentListModel.cs" />
|
||||
<Compile Include="Model\TimeTable\AppointmentModel.cs" />
|
||||
@@ -206,6 +213,9 @@
|
||||
<Compile Include="Utility\ICSProperties\Url.cs" />
|
||||
<Compile Include="Utility\ICSProperties\Version.cs" />
|
||||
<Compile Include="Model\Utility\CourseListPickerItemListWp8Model.cs" />
|
||||
<Compile Include="Pages\BTUTag\BTUTagInfo.xaml.cs">
|
||||
<DependentUpon>BTUTagInfo.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Pages\Campusmap\RoomListPage.xaml.cs">
|
||||
<DependentUpon>RoomListPage.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@@ -228,7 +238,11 @@
|
||||
</Compile>
|
||||
<Compile Include="Utility\AppUriMapper.cs" />
|
||||
<Compile Include="Utility\BackgroundTasks.cs" />
|
||||
<Compile Include="Utility\BoolToVisibilityConverter.cs" />
|
||||
<Compile Include="Utility\Lui\Button\AddPersonButton.cs" />
|
||||
<Compile Include="Utility\Lui\Header\DefaultHeader.xaml.cs">
|
||||
<DependentUpon>DefaultHeader.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Utility\Lui\Tiles\TileCreator.cs" />
|
||||
<Compile Include="Utility\NDEF\NDEFMessage.cs" />
|
||||
<Compile Include="Utility\NDEF\NDEFRecord.cs" />
|
||||
@@ -353,6 +367,10 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</ApplicationDefinition>
|
||||
<Page Include="Pages\BTUTag\BTUTagInfo.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Pages\Campusmap\CampusMapPage.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
@@ -493,6 +511,10 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Utility\Lui\Header\DefaultHeader.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Assets\psd\holo_optionsbuttons.psd" />
|
||||
@@ -512,7 +534,19 @@
|
||||
<Content Include="Assets\ApplicationIcon.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Assets\campusmap.png" />
|
||||
<Content Include="Assets\Icons\DarkTheme\events_159.png" />
|
||||
<Content Include="Assets\Icons\DarkTheme\lectures_159.png" />
|
||||
<Content Include="Assets\Icons\DarkTheme\lehrstuehle_159.png" />
|
||||
<Content Include="Assets\Icons\DarkTheme\mensaplan_159.png" />
|
||||
<Content Include="Assets\Icons\DarkTheme\pos_159.png" />
|
||||
<Content Include="Assets\Icons\DarkTheme\speaker_159.png" />
|
||||
<Content Include="Assets\Icons\LightTheme\events_159.png" />
|
||||
<Content Include="Assets\Icons\LightTheme\lectures_159.png" />
|
||||
<Content Include="Assets\Icons\LightTheme\lehrstuehle_159.png" />
|
||||
<Content Include="Assets\Icons\LightTheme\mensaplan_159.png" />
|
||||
<Content Include="Assets\Icons\LightTheme\pos_159.png" />
|
||||
<Content Include="Assets\Icons\LightTheme\speaker_159.png" />
|
||||
<Content Include="Assets\Maps\campusmap.png" />
|
||||
<Content Include="Assets\Icons\DarkTheme\add_159.png" />
|
||||
<Content Include="Assets\Icons\DarkTheme\add_contact_159.png" />
|
||||
<Content Include="Assets\Icons\DarkTheme\btulogo_159.png" />
|
||||
@@ -531,7 +565,11 @@
|
||||
<Content Include="Assets\Icons\DarkTheme\lecture_159.png" />
|
||||
<Content Include="Assets\Icons\DarkTheme\person_159.png" />
|
||||
<Content Include="Assets\Icons\DarkTheme\phone_159.png" />
|
||||
<Content Include="Assets\Icons\DarkTheme\placeinfoacces_159.png" />
|
||||
<Content Include="Assets\Icons\DarkTheme\placeinfowc_159.png" />
|
||||
<Content Include="Assets\Icons\DarkTheme\placeinfo_159.png" />
|
||||
<Content Include="Assets\Icons\DarkTheme\placelab_159.png" />
|
||||
<Content Include="Assets\Icons\DarkTheme\placesearchred_159.png" />
|
||||
<Content Include="Assets\Icons\DarkTheme\pork_159.png" />
|
||||
<Content Include="Assets\Icons\DarkTheme\practise_159.png" />
|
||||
<Content Include="Assets\Icons\DarkTheme\search_place_159.png" />
|
||||
@@ -543,12 +581,10 @@
|
||||
<Content Include="Assets\Icons\LightTheme\add_contact_159.png" />
|
||||
<Content Include="Assets\Icons\LightTheme\btulogo_159.png" />
|
||||
<Content Include="Assets\Icons\LightTheme\campus_159.png" />
|
||||
<Content Include="Assets\Icons\DarkTheme\departments_159.png" />
|
||||
<Content Include="Assets\Icons\LightTheme\carotte_159.png" />
|
||||
<Content Include="Assets\Icons\LightTheme\chicken_159.png" />
|
||||
<Content Include="Assets\Icons\LightTheme\current_position_159.png" />
|
||||
<Content Include="Assets\Icons\LightTheme\delete_159.png" />
|
||||
<Content Include="Assets\Icons\LightTheme\departments_159.png" />
|
||||
<Content Include="Assets\Icons\DarkTheme\homework_159.png" />
|
||||
<Content Include="Assets\Icons\LightTheme\exams_159.png" />
|
||||
<Content Include="Assets\Icons\LightTheme\favorite_159.png" />
|
||||
@@ -561,10 +597,6 @@
|
||||
<Content Include="Assets\Icons\LightTheme\lamb_159.png" />
|
||||
<Content Include="Assets\Icons\LightTheme\lecture_159.png" />
|
||||
<Content Include="Assets\Icons\LightTheme\link_159.png" />
|
||||
<Content Include="Assets\Icons\DarkTheme\lectures_159.png" />
|
||||
<Content Include="Assets\Icons\LightTheme\lectures_159.png" />
|
||||
<Content Include="Assets\Icons\DarkTheme\mensa_159.png" />
|
||||
<Content Include="Assets\Icons\LightTheme\mensa_159.png" />
|
||||
<Content Include="Assets\Icons\DarkTheme\news_159.png" />
|
||||
<Content Include="Assets\Icons\LightTheme\news_159.png" />
|
||||
<Content Include="Assets\Icons\DarkTheme\openhours_159.png" />
|
||||
@@ -572,7 +604,11 @@
|
||||
<Content Include="Assets\Icons\DarkTheme\schedule_159.png" />
|
||||
<Content Include="Assets\Icons\LightTheme\person_159.png" />
|
||||
<Content Include="Assets\Icons\LightTheme\phone_159.png" />
|
||||
<Content Include="Assets\Icons\LightTheme\placeinfoacces_159.png" />
|
||||
<Content Include="Assets\Icons\LightTheme\placeinfowc_159.png" />
|
||||
<Content Include="Assets\Icons\LightTheme\placeinfo_159.png" />
|
||||
<None Include="Assets\Icons\LightTheme\placelab_159.png" />
|
||||
<Content Include="Assets\Icons\LightTheme\placesearchred_159.png" />
|
||||
<Content Include="Assets\Icons\LightTheme\pork_159.png" />
|
||||
<Content Include="Assets\Icons\LightTheme\practise_159.png" />
|
||||
<Content Include="Assets\Icons\LightTheme\schedule_159.png" />
|
||||
@@ -590,7 +626,8 @@
|
||||
<Content Include="Assets\Lens.Screen-720p.png" />
|
||||
<Content Include="Assets\Lens.Screen-WVGA.png" />
|
||||
<Content Include="Assets\Lens.Screen-WXGA.png" />
|
||||
<Content Include="Assets\testmap.png" />
|
||||
<Content Include="Assets\Maps\IKMZ.png" />
|
||||
<Content Include="Assets\Maps\MZG.png" />
|
||||
<Content Include="Assets\Tiles\FlipCycleTileLarge.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
@@ -609,6 +646,7 @@
|
||||
<Content Include="Assets\Tiles\kachel_large.png" />
|
||||
<Content Include="Assets\Tiles\kachel_medium.png" />
|
||||
<Content Include="Assets\Tiles\kachel_small.png" />
|
||||
<Content Include="File\Campusmap\BuildingsMaps.xml" />
|
||||
<Content Include="File\Campusmap\Offlinemap.xml">
|
||||
<SubType>Designer</SubType>
|
||||
</Content>
|
||||
@@ -657,6 +695,7 @@
|
||||
<Name>CampusAppWPortalLib8</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<Import Project="$(MSBuildExtensionsPath)\Microsoft\$(TargetFrameworkIdentifier)\$(TargetFrameworkVersion)\Microsoft.$(TargetFrameworkIdentifier).$(TargetFrameworkVersion).Overrides.targets" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\Microsoft\$(TargetFrameworkIdentifier)\$(TargetFrameworkVersion)\Microsoft.$(TargetFrameworkIdentifier).CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
|
||||
@@ -77,7 +77,7 @@ namespace CampusAppWP8.Feed.Events
|
||||
if (model == null)
|
||||
{
|
||||
// at loading
|
||||
if (info.Exists == true)
|
||||
if (info != null && info.Exists == true)
|
||||
{
|
||||
retValue = this.CheckIsUpToDate(info.LastWriteTime);
|
||||
}
|
||||
@@ -96,7 +96,8 @@ namespace CampusAppWP8.Feed.Events
|
||||
{
|
||||
bool retValue = true;
|
||||
|
||||
if ((info.Exists == false)
|
||||
if ((info == null)
|
||||
|| (info.Exists == false)
|
||||
|| (info.Length == 0))
|
||||
{
|
||||
retValue = false;
|
||||
|
||||
@@ -76,7 +76,7 @@ namespace CampusAppWP8.Feed.News
|
||||
|
||||
if (model == null)
|
||||
{
|
||||
if (info.Exists == true)
|
||||
if (info != null && info.Exists == true)
|
||||
{
|
||||
retValue = this.CheckIsUpToDate(info.LastWriteTime);
|
||||
}
|
||||
@@ -95,7 +95,8 @@ namespace CampusAppWP8.Feed.News
|
||||
{
|
||||
bool retValue = true;
|
||||
|
||||
if ((info.Exists == false)
|
||||
if ((info == null)
|
||||
|| (info.Exists == false)
|
||||
|| (info.Length == 0))
|
||||
{
|
||||
retValue = false;
|
||||
|
||||
31
CampusAppWP8/CampusAppWP8/File/Campusmap/BuildingsMaps.xml
Normal file
@@ -0,0 +1,31 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<root>
|
||||
<place id="122" parentId="1" refpoint="POINT(14.321714914733889 51.76608468494122)">
|
||||
<placeInformation placeInformationName="Kurzbeschreibung">Das Mehrzweckgebäude ist Sitz verschiedener Lehrsühle der BTU u.a. des Lehrstuhls Kraftwerkstechnik und des Lehrstuhls Industrielle Informationstechnik.</placeInformation>
|
||||
<placeInformation placeInformationName="Kurzname">MZG</placeInformation>
|
||||
<placeInformation placeInformationName="Name">Mehrzweckgebäude</placeInformation>
|
||||
<placeInformation placeInformationName="Typ">Mehrzweck</placeInformation>
|
||||
<placeInformation placeInformationName="ImageSource">/Assets/Maps/MZG.png</placeInformation>
|
||||
<placeInformation placeInformationName="ImageWidth">756</placeInformation>
|
||||
<placeInformation placeInformationName="ImageHeight">800</placeInformation>
|
||||
<placeInformation placeInformationName="MapImageOffsetX">-288</placeInformation>
|
||||
<placeInformation placeInformationName="MapImageOffsetY">-390</placeInformation>
|
||||
<placeInformation placeInformationName="MapRefPoint">Point(430 500)</placeInformation>
|
||||
<placeInformation placeInformationName="ScaleX">650000</placeInformation>
|
||||
<placeInformation placeInformationName="ScaleY">1200000</placeInformation>
|
||||
</place>
|
||||
<place id="157" parentId="1" refpoint="POINT(14.329434644291759 51.76722025560722)">
|
||||
<placeInformation placeInformationName="Kurzbeschreibung">Das IKMZ ist die zentrale Einrichtung der BTU, in der die Strukturbereiche der Informations-, Kommunikations- und Medienversorgung zusammengefasst sind.</placeInformation>
|
||||
<placeInformation placeInformationName="Kurzname">IKMZ</placeInformation>
|
||||
<placeInformation placeInformationName="Name">Informations-, Kommunikations- und Medienzentrum</placeInformation>
|
||||
<placeInformation placeInformationName="Typ">Bibliothek</placeInformation>
|
||||
<placeInformation placeInformationName="ImageSource">/Assets/Maps/IKMZ.png</placeInformation>
|
||||
<placeInformation placeInformationName="ImageWidth">525</placeInformation>
|
||||
<placeInformation placeInformationName="ImageHeight">800</placeInformation>
|
||||
<placeInformation placeInformationName="MapImageOffsetX">-252</placeInformation>
|
||||
<placeInformation placeInformationName="MapImageOffsetY">-390</placeInformation>
|
||||
<placeInformation placeInformationName="MapRefPoint">Point(235 380)</placeInformation>
|
||||
<placeInformation placeInformationName="ScaleX">300000</placeInformation>
|
||||
<placeInformation placeInformationName="ScaleY">500000</placeInformation>
|
||||
</place>
|
||||
</root>
|
||||
@@ -0,0 +1,80 @@
|
||||
using CampusAppWP8.Model.GeoDb;
|
||||
using CampusAppWP8.Resources;
|
||||
using CampusAppWPortalLib8.Utility;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
|
||||
namespace CampusAppWP8.Model.Campusmap
|
||||
{
|
||||
public class BuildingMapModel : MapModel
|
||||
{
|
||||
public BuildingMapModel(string id)
|
||||
{
|
||||
SpsModel buildings = XmlManager.DeserializationFileToModel<SpsModel>(Constants.FileMap_BuildingsMap);
|
||||
PlaceModel building = buildings.GetPlaceById(id);
|
||||
if (buildings == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
this.ImageSource = building.GetInformationsValue("ImageSource");
|
||||
double tmpVal;
|
||||
if (double.TryParse(building.GetInformationsValue("ImageWidth"), NumberStyles.Number, CultureInfo.InvariantCulture, out tmpVal))
|
||||
{
|
||||
this.ImageWidth = tmpVal;
|
||||
}
|
||||
|
||||
if (double.TryParse(building.GetInformationsValue("ImageHeight"), NumberStyles.Number, CultureInfo.InvariantCulture, out tmpVal))
|
||||
{
|
||||
this.ImageHeight = tmpVal;
|
||||
}
|
||||
|
||||
if (double.TryParse(building.GetInformationsValue("MapImageOffsetX"), NumberStyles.Number, CultureInfo.InvariantCulture, out tmpVal))
|
||||
{
|
||||
this.MapImageOffsetX = tmpVal;
|
||||
}
|
||||
|
||||
if (double.TryParse(building.GetInformationsValue("MapImageOffsetY"), NumberStyles.Number, CultureInfo.InvariantCulture, out tmpVal))
|
||||
{
|
||||
this.MapImageOffsetY = tmpVal;
|
||||
}
|
||||
|
||||
string pointString = building.GetInformationsValue("MapRefPoint");
|
||||
pointString = pointString.TrimStart("Point(".ToArray());
|
||||
pointString = pointString.TrimEnd(')');
|
||||
string[] coord = pointString.Split(' ');
|
||||
if (coord == null || coord.Length != 2)
|
||||
{
|
||||
return;
|
||||
}
|
||||
double x;
|
||||
double y;
|
||||
|
||||
if (!double.TryParse(coord[0], NumberStyles.Number, CultureInfo.InvariantCulture, out x) || !double.TryParse(coord[1], NumberStyles.Number, CultureInfo.InvariantCulture, out y))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
this.RefPoint = new Point(x,y);
|
||||
|
||||
if (double.TryParse(building.GetInformationsValue("ScaleX"), NumberStyles.Number, CultureInfo.InvariantCulture, out tmpVal))
|
||||
{
|
||||
this.ScaleX = tmpVal;
|
||||
}
|
||||
|
||||
if (double.TryParse(building.GetInformationsValue("ScaleY"), NumberStyles.Number, CultureInfo.InvariantCulture, out tmpVal))
|
||||
{
|
||||
this.ScaleY = tmpVal;
|
||||
}
|
||||
|
||||
this.GeoOffsetX = building.GeoRefPoint.Longitude;
|
||||
this.GeoOffsetY = building.GeoRefPoint.Latitude;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -45,9 +45,5 @@ namespace CampusAppWP8.Model.Campusmap
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Method
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// <copyright file="CBMainMapModel.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>stubbfel</author>
|
||||
// <sience>13.08.2013</sience>
|
||||
//-----------------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Model.Campusmap
|
||||
{
|
||||
using System.Windows;
|
||||
using CampusAppWP8.File.Places;
|
||||
using CampusAppWP8.Model.GeoDb;
|
||||
using CampusAppWP8.Resources;
|
||||
using System.Collections.Generic;
|
||||
|
||||
/// <summary>
|
||||
/// Class for the MapModel of the mainCampus of cottbus
|
||||
/// </summary>
|
||||
public class CBMainMapRoomModel
|
||||
{
|
||||
#region Constructor
|
||||
public CBMainMapRoomModel()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -30,6 +30,10 @@ namespace CampusAppWP8.Model.Campusmap
|
||||
this.IsReady = true;
|
||||
}
|
||||
|
||||
public CampusMapModel()
|
||||
{
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region property
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace CampusAppWP8.Model.Campusmap
|
||||
this.PinImageOffsetX = -25;
|
||||
this.PinImageOffsetY = -34;
|
||||
this.Tag = MapPinModel.CurrendPositionPlacePinString;
|
||||
this.ZIndex = 2;
|
||||
this.ZIndex = 3;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// <copyright file="InfoLabPlacePinModel.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>stubbfel</author>
|
||||
// <sience>27.08.2013</sience>
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
namespace CampusAppWP8.Model.Campusmap
|
||||
{
|
||||
using CampusAppWP8.Resources;
|
||||
|
||||
/// <summary>Search pin place model.</summary>
|
||||
/// <remarks>Stubbfel, 27.08.2013.</remarks>
|
||||
public class InfoLabPlacePinModel : InfoPlacePinModel
|
||||
{
|
||||
#region Constructor
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="InfoPlacePinModel" /> class.
|
||||
/// </summary>
|
||||
/// <remarks>Stubbfel, 27.08.2013.</remarks>
|
||||
public InfoLabPlacePinModel()
|
||||
{
|
||||
this.ImageSource = Icons.PlaceLab;
|
||||
this.ImageWidth = 40;
|
||||
this.ImageHeight = 40;
|
||||
this.PinImageOffsetX = -20;
|
||||
this.PinImageOffsetY = -15;
|
||||
this.ZIndex += 1;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// <copyright file="InfoLabPlacePinModel.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>stubbfel</author>
|
||||
// <sience>27.08.2013</sience>
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
namespace CampusAppWP8.Model.Campusmap
|
||||
{
|
||||
using CampusAppWP8.Resources;
|
||||
|
||||
/// <summary>Search pin place model.</summary>
|
||||
/// <remarks>Stubbfel, 27.08.2013.</remarks>
|
||||
public class InfoPlaceAccessPinModel : InfoPlacePinModel
|
||||
{
|
||||
#region Constructor
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="InfoPlacePinModel" /> class.
|
||||
/// </summary>
|
||||
/// <remarks>Stubbfel, 27.08.2013.</remarks>
|
||||
public InfoPlaceAccessPinModel()
|
||||
{
|
||||
this.ImageSource = Icons.PlaceInfoAccess;
|
||||
this.ImageWidth = 40;
|
||||
this.ImageHeight = 40;
|
||||
this.PinImageOffsetX = -10;
|
||||
this.PinImageOffsetY = -35;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// <copyright file="InfoLabPlacePinModel.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>stubbfel</author>
|
||||
// <sience>27.08.2013</sience>
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
namespace CampusAppWP8.Model.Campusmap
|
||||
{
|
||||
using CampusAppWP8.Resources;
|
||||
|
||||
/// <summary>Search pin place model.</summary>
|
||||
/// <remarks>Stubbfel, 27.08.2013.</remarks>
|
||||
public class InfoPlaceRedPinModel : InfoPlacePinModel
|
||||
{
|
||||
#region Constructor
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="InfoPlacePinModel" /> class.
|
||||
/// </summary>
|
||||
/// <remarks>Stubbfel, 27.08.2013.</remarks>
|
||||
public InfoPlaceRedPinModel()
|
||||
{
|
||||
this.ImageSource = Icons.PlaceRearchRed;
|
||||
this.ImageWidth = 60;
|
||||
this.ImageHeight = 60;
|
||||
this.PinImageOffsetX = -25;
|
||||
this.PinImageOffsetY = -27;
|
||||
this.ZIndex += 1;
|
||||
this.Tag = MapPinModel.InfoRedPlacePinString;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// <copyright file="InfoLabPlacePinModel.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>stubbfel</author>
|
||||
// <sience>27.08.2013</sience>
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
namespace CampusAppWP8.Model.Campusmap
|
||||
{
|
||||
using CampusAppWP8.Resources;
|
||||
|
||||
/// <summary>Search pin place model.</summary>
|
||||
/// <remarks>Stubbfel, 27.08.2013.</remarks>
|
||||
public class InfoPlaceWCPinModel : InfoPlacePinModel
|
||||
{
|
||||
#region Constructor
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="InfoPlacePinModel" /> class.
|
||||
/// </summary>
|
||||
/// <remarks>Stubbfel, 27.08.2013.</remarks>
|
||||
public InfoPlaceWCPinModel()
|
||||
{
|
||||
this.ImageSource = Icons.PlaceInfoWc;
|
||||
this.ImageWidth = 40;
|
||||
this.ImageHeight = 40;
|
||||
this.PinImageOffsetX = 0;
|
||||
this.PinImageOffsetY = -10;
|
||||
this.ZIndex += 1;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,7 @@
|
||||
// <sience>24.06.2013</sience>
|
||||
//----------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Model.Campusmap
|
||||
{
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows;
|
||||
@@ -43,7 +43,7 @@ namespace CampusAppWP8.Model.Campusmap
|
||||
|
||||
#endregion
|
||||
|
||||
#region Events
|
||||
#region Events
|
||||
|
||||
/// <summary>
|
||||
/// Delegate for MapInfo
|
||||
@@ -145,6 +145,7 @@ namespace CampusAppWP8.Model.Campusmap
|
||||
{
|
||||
x = this.RefPoint.X + this.MapImageOffsetX + x;
|
||||
y = this.RefPoint.Y + this.MapImageOffsetY - y;
|
||||
|
||||
return new Point(x, y);
|
||||
}
|
||||
|
||||
@@ -302,6 +303,34 @@ namespace CampusAppWP8.Model.Campusmap
|
||||
((InfoPlacePinModel)pin).AssocPlaces = places;
|
||||
((InfoPlacePinModel)pin).CallBack = this.ShowMapInfos;
|
||||
break;
|
||||
case MapPinModel.PinType.InfoLabPlace:
|
||||
pin = new InfoLabPlacePinModel();
|
||||
pinImg.MouseLeftButtonDown += new MouseButtonEventHandler(((InfoLabPlacePinModel)pin).ShowInfo);
|
||||
|
||||
((InfoLabPlacePinModel)pin).AssocPlaces = places;
|
||||
((InfoLabPlacePinModel)pin).CallBack = this.ShowMapInfos;
|
||||
break;
|
||||
case MapPinModel.PinType.InfoAccesPlace:
|
||||
pin = new InfoPlaceAccessPinModel();
|
||||
pinImg.MouseLeftButtonDown += new MouseButtonEventHandler(((InfoPlaceAccessPinModel)pin).ShowInfo);
|
||||
|
||||
((InfoPlaceAccessPinModel)pin).AssocPlaces = places;
|
||||
((InfoPlaceAccessPinModel)pin).CallBack = this.ShowMapInfos;
|
||||
break;
|
||||
case MapPinModel.PinType.InfoRedPlace:
|
||||
pin = new InfoPlaceRedPinModel();
|
||||
pinImg.MouseLeftButtonDown += new MouseButtonEventHandler(((InfoPlaceRedPinModel)pin).ShowInfo);
|
||||
|
||||
((InfoPlaceRedPinModel)pin).AssocPlaces = places;
|
||||
((InfoPlaceRedPinModel)pin).CallBack = this.ShowMapInfos;
|
||||
break;
|
||||
case MapPinModel.PinType.InfoWcPlace:
|
||||
pin = new InfoPlaceWCPinModel();
|
||||
pinImg.MouseLeftButtonDown += new MouseButtonEventHandler(((InfoPlaceWCPinModel)pin).ShowInfo);
|
||||
|
||||
((InfoPlaceWCPinModel)pin).AssocPlaces = places;
|
||||
((InfoPlaceWCPinModel)pin).CallBack = this.ShowMapInfos;
|
||||
break;
|
||||
default:
|
||||
pin = new HiddenPinPlaceModel();
|
||||
break;
|
||||
|
||||
@@ -23,6 +23,11 @@ namespace CampusAppWP8.Model.Campusmap
|
||||
/// </summary>
|
||||
private static string infoPlacePinString = MapPinModel.PinTypeToString(PinType.InfoPlace);
|
||||
|
||||
/// <summary>
|
||||
/// String for info pins
|
||||
/// </summary>
|
||||
private static string infoLabPlacePinString = MapPinModel.PinTypeToString(PinType.InfoLabPlace);
|
||||
|
||||
/// <summary>
|
||||
/// String for hidden pins
|
||||
/// </summary>
|
||||
@@ -38,6 +43,14 @@ namespace CampusAppWP8.Model.Campusmap
|
||||
/// </summary>
|
||||
private static string currendPositionPlacePinString = MapPinModel.PinTypeToString(PinType.CurrentPosition);
|
||||
|
||||
private static string infoWcPlacePinString = MapPinModel.PinTypeToString(PinType.InfoWcPlace);
|
||||
|
||||
private static string infoAccesPlacePinString = MapPinModel.PinTypeToString(PinType.InfoAccesPlace);
|
||||
|
||||
private static string infoRedPlacePinString = MapPinModel.PinTypeToString(PinType.InfoRedPlace);
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Variable of the actual position of the pin
|
||||
/// </summary>
|
||||
@@ -70,12 +83,31 @@ namespace CampusAppWP8.Model.Campusmap
|
||||
CurrentPosition = 2,
|
||||
|
||||
/// <summary>An enum constant representing the info place option.</summary>
|
||||
InfoPlace = 3
|
||||
InfoPlace = 3,
|
||||
InfoLabPlace = 4,
|
||||
InfoWcPlace = 5,
|
||||
InfoRedPlace = 6,
|
||||
InfoAccesPlace = 7
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Property
|
||||
|
||||
public static string InfoRedPlacePinString
|
||||
{
|
||||
get { return MapPinModel.infoRedPlacePinString; }
|
||||
}
|
||||
|
||||
public static string InfoAccesPlacePinString
|
||||
{
|
||||
get { return MapPinModel.infoAccesPlacePinString; }
|
||||
}
|
||||
|
||||
public static string InfoWcPlacePinString
|
||||
{
|
||||
get { return MapPinModel.infoWcPlacePinString; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the string of current position pins
|
||||
/// </summary>
|
||||
@@ -108,6 +140,11 @@ namespace CampusAppWP8.Model.Campusmap
|
||||
get { return MapPinModel.infoPlacePinString; }
|
||||
}
|
||||
|
||||
public static string InfoLabPlacePinString
|
||||
{
|
||||
get { return MapPinModel.infoLabPlacePinString; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the ImageSource of the pin
|
||||
/// </summary>
|
||||
@@ -205,6 +242,9 @@ namespace CampusAppWP8.Model.Campusmap
|
||||
case PinType.InfoPlace:
|
||||
result = Constants.PinType_Info;
|
||||
break;
|
||||
case PinType.InfoLabPlace:
|
||||
result = Constants.PinType_InfoLab;
|
||||
break;
|
||||
case PinType.SearchPlace:
|
||||
result = Constants.PinType_Search;
|
||||
break;
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace CampusAppWP8.Model.Campusmap
|
||||
this.PinImageOffsetX = -25;
|
||||
this.PinImageOffsetY = -27;
|
||||
this.Tag = MapPinModel.SearchPlacePinString;
|
||||
this.ZIndex = 3;
|
||||
this.ZIndex = 4;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -91,6 +91,22 @@ namespace CampusAppWP8.Model.GeoDb
|
||||
return result;
|
||||
}
|
||||
|
||||
public string GetLayerKey(string placeId)
|
||||
{
|
||||
PlaceModel tmpPlace = null;
|
||||
foreach (CampusBuildingLayerModel layer in this.Layers.Values)
|
||||
{
|
||||
tmpPlace = layer.Rooms.GetPlaceById(placeId);
|
||||
if (tmpPlace != null)
|
||||
{
|
||||
|
||||
return layer.LayerId;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,9 @@
|
||||
namespace CampusAppWP8.Model.Lecture
|
||||
{
|
||||
using CampusAppWP8.Resources;
|
||||
using CampusAppWP8.Utility;
|
||||
using CampusAppWPortalLib8.Model.Lecture;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
/// <summary>
|
||||
/// Model for a Activity
|
||||
@@ -34,6 +36,26 @@ namespace CampusAppWP8.Model.Lecture
|
||||
return this.iconUrl;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the topic of the Lecture
|
||||
/// </summary>
|
||||
[XmlElement("lehrinhalt")]
|
||||
public new string Topic
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.Topic;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (value != this.Topic)
|
||||
{
|
||||
base.Topic = Wp8StringManager.StripAndDecodeHTML(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
|
||||
@@ -11,13 +11,13 @@ namespace CampusAppWP8.Model.Openinghours
|
||||
using System.Globalization;
|
||||
using System.Windows;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Model for menu
|
||||
/// </summary>
|
||||
public class OpeninghoursInstitutionWp8Model : CampusAppWPortalLib8.Model.Openinghours.OpeninghoursInstitutionModel
|
||||
{
|
||||
#region Property
|
||||
#region Property
|
||||
|
||||
/// <summary>
|
||||
/// Gets the visibility state of the monday TextBlock.
|
||||
@@ -152,5 +152,5 @@ namespace CampusAppWP8.Model.Openinghours
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ namespace CampusAppWP8.Model.Person
|
||||
{
|
||||
using System.Xml.Serialization;
|
||||
using CampusAppWPortalLib8.Model.Person;
|
||||
using System.Collections.Generic;
|
||||
|
||||
/// <summary>Person list model.</summary>
|
||||
/// <remarks>Stubbfel, 05.09.2013.</remarks>
|
||||
@@ -20,10 +21,51 @@ namespace CampusAppWP8.Model.Person
|
||||
/// <remarks>Stubbfel, 05.09.2013.</remarks>
|
||||
/// <param name="id">The identifier.</param>
|
||||
/// <returns>The person.</returns>
|
||||
public new PersonWp8Model GetPerson(string id)
|
||||
/// <summary>Gets a person.</summary>
|
||||
/// <remarks>Stubbfel, 05.09.2013.</remarks>
|
||||
/// <param name="id">The identifier.</param>
|
||||
/// <returns>The person.</returns>
|
||||
public override PersonWp8Model GetPerson(string id)
|
||||
{
|
||||
IPersonModel<IPersonFunctionModel> tmpPerson = base.GetPerson(id);
|
||||
return tmpPerson as PersonWp8Model;
|
||||
foreach (PersonWp8Model tmpPerson in this.Persons)
|
||||
{
|
||||
if (tmpPerson.ID.Equals(id))
|
||||
{
|
||||
return tmpPerson;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>Removes the non function person.</summary>
|
||||
/// <remarks>Stubbfel, 05.09.2013.</remarks>
|
||||
public override void RemoveNonFunctionPerson()
|
||||
{
|
||||
List<PersonWp8Model> removeList = new List<PersonWp8Model>();
|
||||
foreach (PersonWp8Model tmpPerson in this.Persons)
|
||||
{
|
||||
if (tmpPerson.Functions.Count < 1)
|
||||
{
|
||||
removeList.Add(tmpPerson);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (PersonWp8Model removePerson in removeList)
|
||||
{
|
||||
this.Persons.Remove(removePerson);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Sets person identifier to function.</summary>
|
||||
/// <remarks>Stubbfel, 05.09.2013.</remarks>
|
||||
public override void SetPersonIdToFunction()
|
||||
{
|
||||
foreach (PersonWp8Model person in this.Persons)
|
||||
{
|
||||
person.SetPersonIdToFunction();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,6 +15,16 @@ namespace CampusAppWP8.Model.Setting
|
||||
/// </summary>
|
||||
public class AppSettings
|
||||
{
|
||||
|
||||
#region Enum
|
||||
|
||||
public enum BTUTagDefaultHandler
|
||||
{
|
||||
InfoPage = 0,
|
||||
CampusMap = 1
|
||||
}
|
||||
|
||||
#endregion
|
||||
#region Property
|
||||
|
||||
/// <summary>
|
||||
@@ -124,6 +134,19 @@ namespace CampusAppWP8.Model.Setting
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public BTUTagDefaultHandler TagDefaultHandler
|
||||
{
|
||||
get
|
||||
{
|
||||
return App.LoadFromAppState<BTUTagDefaultHandler>(Constants.AppSetting_BTUTagDefaultHandler);
|
||||
}
|
||||
set
|
||||
{
|
||||
App.SaveToAppState<BTUTagDefaultHandler>(Constants.AppSetting_BTUTagDefaultHandler, value);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
// <copyright file="RoleListPickerItemListModel.cs" company="BTU/IIT">
|
||||
// Company copyright tag.List
|
||||
// </copyright>
|
||||
// <author>stubbfel</author>
|
||||
// <sience>25.07.2013</sience>
|
||||
//----------------------------------------------------------------------
|
||||
namespace CampusApp8.Model.Setting
|
||||
{
|
||||
using CampusAppWPortalLib8.Model.Utility;
|
||||
using CampusAppWP8.Model.Setting;
|
||||
using CampusAppWP8.Resources;
|
||||
|
||||
/// <summary>
|
||||
/// Class for the RoleList
|
||||
/// </summary>
|
||||
public class TagHandlerListPickerItemListModel : ListPickerItemListModel
|
||||
{
|
||||
#region Constructor
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="RoleListPickerItemListModel" /> class.
|
||||
/// </summary>
|
||||
public TagHandlerListPickerItemListModel()
|
||||
: base()
|
||||
{
|
||||
this.LoadList();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Method
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the LoadList-Method <see cref="ListPickerItemListModel"/>
|
||||
/// </summary>
|
||||
protected override void LoadList()
|
||||
{
|
||||
this.AddItem(new ListPickerItemModel(AppSettings.BTUTagDefaultHandler.InfoPage.ToString(), AppResources.Setting_TagHandlerInfo));
|
||||
this.AddItem(new ListPickerItemModel(AppSettings.BTUTagDefaultHandler.CampusMap.ToString(), AppResources.Setting_TagHandlerMap));
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
62
CampusAppWP8/CampusAppWP8/Pages/BTUTag/BTUTagInfo.xaml
Normal file
@@ -0,0 +1,62 @@
|
||||
<phone:PhoneApplicationPage
|
||||
x:Class="CampusAppWP8.Pages.BTTTag.BTUTagInfo"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
|
||||
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: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="PortraitOrLandscape" Orientation="Portrait"
|
||||
mc:Ignorable="d"
|
||||
shell:SystemTray.IsVisible="True">
|
||||
|
||||
<!--LayoutRoot ist das Stammraster, in dem alle anderen Seiteninhalte platziert werden-->
|
||||
<Grid x:Name="LayoutRoot" Background="Transparent">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!--TitlePanel enthält den Namen der Anwendung und den Seitentitel-->
|
||||
<StackPanel Grid.Row="0">
|
||||
<header:DefaultHeader Name="DefHeader" HeaderName="{Binding Path=LocalizedResources.BTUTag_Title, Source={StaticResource LocalizedStrings}}"/>
|
||||
</StackPanel>
|
||||
|
||||
<!--ContentPanel - zusätzliche Inhalte hier platzieren-->
|
||||
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Grid.Row="0" Text="{Binding Path=LocalizedResources.BTUTag_Text, Source={StaticResource LocalizedStrings}}" TextWrapping="Wrap" />
|
||||
<Border Grid.Row="1" BorderBrush="{StaticResource PhoneInverseInactiveBrush}" BorderThickness="0,1,0,0" Padding="0,12,0,12">
|
||||
<StackPanel >
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.Setting_TagHandler, Source={StaticResource LocalizedStrings}}"/>
|
||||
<toolkit:ListPicker Name="TagHandler" ExpansionMode="FullScreenOnly" FullModeHeader="{Binding Path=LocalizedResources.ListPickerHeaderTag, Source={StaticResource LocalizedStrings}}" >
|
||||
<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>
|
||||
</Border>
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
|
||||
</phone:PhoneApplicationPage>
|
||||
45
CampusAppWP8/CampusAppWP8/Pages/BTUTag/BTUTagInfo.xaml.cs
Normal file
@@ -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
|
||||
|
||||
/// <summary>
|
||||
/// Override the OnNavigatedFrom method
|
||||
/// </summary>
|
||||
/// <param name="e">Arguments of navigation</param>
|
||||
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
|
||||
}
|
||||
}
|
||||
@@ -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 @@
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<ProgressBar Name="ProgressBar" Visibility="Collapsed" IsIndeterminate="True"/>
|
||||
<!--TitlePanel enthält den Namen der Anwendung und den Seitentitel-->
|
||||
<StackPanel Grid.Row="0" Margin="12,17,0,28">
|
||||
<TextBlock Text="{Binding LocalizedResources.CampusMapApp_Title, Source={StaticResource LocalizedStrings}}" Style="{StaticResource PhoneTextNormalStyle}"/>
|
||||
<StackPanel Grid.Row="0">
|
||||
<header:DefaultHeader Name="DefHeader" HeaderName="{Binding Path=LocalizedResources.CampusMapApp_Title, Source={StaticResource LocalizedStrings}}"/>
|
||||
</StackPanel>
|
||||
|
||||
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
|
||||
@@ -40,18 +40,16 @@
|
||||
<ColumnDefinition Width="auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel Grid.Column="0" VerticalAlignment="Center">
|
||||
<TextBox Name="QString" InputScope="Text" AcceptsReturn="False" />
|
||||
<TextBox Name="QString" InputScope="Text" AcceptsReturn="False" KeyDown="Button_KeyDown" />
|
||||
</StackPanel>
|
||||
<Button Grid.Column="1" Click="SearchByText">
|
||||
<Button Grid.Column="1" Click="SearchByText" >
|
||||
<Image Source="{Binding Path=ThemelizedIcon.Search, Source={StaticResource ThemelizedIcons}}" Width="60"/>
|
||||
</Button>
|
||||
</Grid>
|
||||
<ScrollViewer Name="MapScroller" Grid.Row="1" HorizontalScrollBarVisibility="Auto" RenderTransformOrigin="0,0">
|
||||
<ScrollViewer Name="MapScroller" Grid.Row="1" HorizontalScrollBarVisibility="Auto" RenderTransformOrigin="0,0" Margin="12,0,0,0">
|
||||
<Canvas Name="MapCanvas" ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Auto" Height="{Binding ImageHeight}" Width="{Binding ImageWidth}">
|
||||
<Canvas.Background>
|
||||
<ImageBrush Stretch="Fill" ImageSource="{Binding ImageSource}">
|
||||
|
||||
</ImageBrush>
|
||||
<ImageBrush Stretch="Fill" ImageSource="{Binding ImageSource}"/>
|
||||
</Canvas.Background>
|
||||
</Canvas>
|
||||
</ScrollViewer>
|
||||
@@ -61,9 +59,9 @@
|
||||
<shell:ApplicationBar IsVisible="True" IsMenuEnabled="True" Mode="Minimized" >
|
||||
<lui:UpdateButtonAppBar Click="UpdateButtonAppBar_Click"/>
|
||||
<shell:ApplicationBar.MenuItems>
|
||||
<shell:ApplicationBarMenuItem Text="Gebäudeinfos einblenden" Click="ShowBuildingsInformation" />
|
||||
<shell:ApplicationBarMenuItem Text="Scan QR-Code" Click="SearchPlaceByQR_Click" />
|
||||
<shell:ApplicationBarMenuItem Text="Scan NFC-Tag" Click="SearchPlaceByNFC_Click"/>
|
||||
<shell:ApplicationBarMenuItem Text="Gebäudeinfos einblenden" Click="ShowBuildingsInformation" />
|
||||
</shell:ApplicationBar.MenuItems>
|
||||
</shell:ApplicationBar>
|
||||
</phone:PhoneApplicationPage.ApplicationBar>
|
||||
|
||||
@@ -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;
|
||||
|
||||
/// <summary>Class for the campusMap page.</summary>
|
||||
/// <remarks>Stubbfel, 19.08.2013.</remarks>
|
||||
@@ -65,6 +66,8 @@ namespace CampusAppWP8.Pages.Campusmap
|
||||
/// </summary>
|
||||
private bool buildInfoEnable;
|
||||
|
||||
private long ndefId;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructor
|
||||
@@ -79,19 +82,19 @@ namespace CampusAppWP8.Pages.Campusmap
|
||||
ApplicationBarMenuItem menuItem2 = ApplicationBar.MenuItems[1] as ApplicationBarMenuItem;
|
||||
ApplicationBarMenuItem menuItem3 = ApplicationBar.MenuItems[2] as ApplicationBarMenuItem;
|
||||
|
||||
if (menuItem1 != null)
|
||||
{
|
||||
menuItem1.Text = AppResources.CampusMapApp_ScanQR;
|
||||
}
|
||||
|
||||
if (menuItem2 != null)
|
||||
{
|
||||
menuItem2.Text = AppResources.CampusMapApp_ScanNfc;
|
||||
menuItem2.Text = AppResources.App_ScanQR;
|
||||
}
|
||||
|
||||
if (menuItem3 != null)
|
||||
{
|
||||
menuItem3.Text = AppResources.CampusMapApp_EnableBuildInfo;
|
||||
menuItem3.Text = AppResources.App_ScanNfc;
|
||||
}
|
||||
|
||||
if (menuItem1 != null)
|
||||
{
|
||||
menuItem1.Text = AppResources.CampusMapApp_EnableBuildInfo;
|
||||
}
|
||||
|
||||
if (this.file == null)
|
||||
@@ -117,6 +120,7 @@ namespace CampusAppWP8.Pages.Campusmap
|
||||
/// Event for loading places
|
||||
/// </summary>
|
||||
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<string>(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) || place.PlaceId.Equals(this.campusMap.CampusId))
|
||||
{
|
||||
this.ShowAllPlacesByPlaceIdAsSearchPin(searchPid);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.GoToRoomList(place.ParentId, place.PlaceId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ndefId = this.device.SubscribeForMessage(Constants.NCFMessageType_NDEF, this.NDEFHandler);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Methods overrides the OnNavigatedFrom-Method
|
||||
/// </summary>
|
||||
/// <param name="e">some NavigationEventArgs</param>
|
||||
protected override void OnNavigatedFrom(NavigationEventArgs e)
|
||||
{
|
||||
this.device.StopSubscribingForMessage(ndefId);
|
||||
|
||||
base.OnNavigatedFrom(e);
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region private
|
||||
@@ -352,7 +390,7 @@ namespace CampusAppWP8.Pages.Campusmap
|
||||
menuText = AppResources.CampusMapApp_EnableBuildInfo;
|
||||
}
|
||||
|
||||
ApplicationBarMenuItem item = ApplicationBar.MenuItems[2] as ApplicationBarMenuItem;
|
||||
ApplicationBarMenuItem item = ApplicationBar.MenuItems[0] as ApplicationBarMenuItem;
|
||||
item.Text = menuText;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -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);
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <summary>Searches for the first places.</summary>
|
||||
@@ -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
|
||||
/// <param name="scroll">(Optional) the scroll.</param>
|
||||
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<string>(Constants.GeoWatch_CurrentPosition_Lat);
|
||||
string log = App.LoadFromAppState<string>(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;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -692,6 +768,11 @@ namespace CampusAppWP8.Pages.Campusmap
|
||||
/// <param name="places">List of places</param>
|
||||
private void ShowMapInfo(List<PlaceModel> 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);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Method check if a certain place has some rooms
|
||||
/// </summary>
|
||||
@@ -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
|
||||
|
||||
@@ -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">
|
||||
|
||||
<!--LayoutRoot ist das Stammraster, in dem alle anderen Seiteninhalte platziert werden-->
|
||||
<Grid x:Name="LayoutRoot" Background="Transparent">
|
||||
<!--Pivotsteuerelement-->
|
||||
<phone:Pivot Name="RoomPivot" Title="{Binding LocalizedResources.CampusMapApp_Title, Source={StaticResource LocalizedStrings}}">
|
||||
<phone:Pivot.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Key}" />
|
||||
</DataTemplate>
|
||||
</phone:Pivot.HeaderTemplate>
|
||||
<phone:Pivot.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<ListBox ItemsSource="{Binding Value.Rooms.Places}">
|
||||
<ListBox.ItemContainerStyle>
|
||||
<Style TargetType="ListBoxItem">
|
||||
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch"/>
|
||||
</Style>
|
||||
</ListBox.ItemContainerStyle>
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<lui:GoToMapButton SearchTerm="{Binding PlaceId}" Style="{StaticResource ListButtonStyle}">
|
||||
<TextBlock Text="{Binding Caption}"/>
|
||||
</lui:GoToMapButton>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
</DataTemplate>
|
||||
</phone:Pivot.ItemTemplate>
|
||||
</phone:Pivot>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<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>
|
||||
|
||||
</phone:PhoneApplicationPage>
|
||||
@@ -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;
|
||||
|
||||
/// <summary>
|
||||
/// Class of the RoomListPage
|
||||
@@ -34,6 +41,14 @@ namespace CampusAppWP8.Pages.Campusmap
|
||||
/// </summary>
|
||||
private CampusBuildingModel building;
|
||||
|
||||
/// <summary>Variable for the map model.</summary>
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method setup the PivotElement
|
||||
/// </summary>
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method sorts the Layers
|
||||
/// </summary>
|
||||
/// <param name="build"> building of the layers </param>
|
||||
/// <returns>sorted Dictionary</returns>
|
||||
private Dictionary<string, CampusBuildingLayerModel> GetSortedLayers(CampusBuildingModel build)
|
||||
private void showCurrentRoom(string placeId)
|
||||
{
|
||||
Dictionary<string, CampusBuildingLayerModel> result = new Dictionary<string, CampusBuildingLayerModel>();
|
||||
foreach (CampusBuildingLayerModel layer in build.Layers.Values)
|
||||
|
||||
double x;
|
||||
double y;
|
||||
|
||||
this.ClearMap(new List<string>() { 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<PlaceModel> { room }));
|
||||
}
|
||||
|
||||
private void ShowMapInfo(List<PlaceModel> 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);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method set all rooms a formatted string , which will be show as buttonContent
|
||||
/// </summary>
|
||||
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<string>() { 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<PlaceModel> { 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<string> removeTags = null)
|
||||
{
|
||||
if (removeTags == null)
|
||||
{
|
||||
MapCanvas.Children.Clear();
|
||||
}
|
||||
else
|
||||
{
|
||||
List<UIElement> 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 @@
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<ProgressBar x:Name="progressBar" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Center" Visibility="Collapsed" IsIndeterminate="True"/>
|
||||
<!--TitlePanel enthält den Namen der Anwendung und den Seitentitel-->
|
||||
<StackPanel Grid.Row="0" Margin="12,17,0,28">
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.ApplicationTitle, Source={StaticResource LocalizedStrings}}" Style="{StaticResource PhoneTextNormalStyle}"/>
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.Favorites, Source={StaticResource LocalizedStrings}}" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
|
||||
</StackPanel>
|
||||
<!--header-->
|
||||
<header:DefaultHeader x:Name="DefHeader" Grid.Row="0" HeaderName="{Binding Path=LocalizedResources.Favorites, Source={StaticResource LocalizedStrings}}"/>
|
||||
|
||||
<!--ContentPanel - zusätzliche Inhalte hier platzieren-->
|
||||
<ListBox x:Name="ContentPanel" ItemsSource="{Binding Chairs}" Grid.Row="1" Margin="12,0,12,0">
|
||||
@@ -39,8 +36,8 @@
|
||||
<DataTemplate>
|
||||
<StackPanel>
|
||||
<!--chair main button-->
|
||||
<Button Tag="{Binding Url}" Click="ChairTB_Click" HorizontalContentAlignment="Left">
|
||||
<TextBlock Text="{Binding Name}" HorizontalAlignment="Stretch" TextWrapping="Wrap" FontSize="24"/>
|
||||
<Button Tag="{Binding Url}" Click="ChairTB_Click" HorizontalContentAlignment="Left" Style="{StaticResource ListButtonStyle}">
|
||||
<TextBlock Text="{Binding Name}" HorizontalAlignment="Stretch" TextWrapping="Wrap"/>
|
||||
</Button>
|
||||
<StackPanel Visibility="Collapsed">
|
||||
<!--delete button-->
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -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
|
||||
|
||||
@@ -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 @@
|
||||
<Grid x:Name="LayoutRoot" Background="Transparent">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<ProgressBar x:Name="progressBar" Grid.Row="2" VerticalAlignment="Center" HorizontalAlignment="Center" Visibility="Collapsed" IsIndeterminate="True"/>
|
||||
<!--TitlePanel enthält den Namen der Anwendung und den Seitentitel-->
|
||||
<StackPanel Grid.Row="0" Margin="12,17,0,28">
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.ApplicationTitle, Source={StaticResource LocalizedStrings}}" Style="{StaticResource PhoneTextNormalStyle}"/>
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.DepartmentApp_Title, Source={StaticResource LocalizedStrings}}" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
|
||||
</StackPanel>
|
||||
<!--header-->
|
||||
<header:DefaultHeader x:Name="DefHeader" Grid.Row="0" HeaderName="{Binding Path=LocalizedResources.DepartmentApp_Title, Source={StaticResource LocalizedStrings}}"/>
|
||||
|
||||
<!--ContentPanel - zusätzliche Inhalte hier platzieren-->
|
||||
<ListBox x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
|
||||
@@ -38,7 +35,7 @@
|
||||
</Style>
|
||||
</ListBox.ItemContainerStyle>
|
||||
<!--favorite button-->
|
||||
<Button x:Name="Favorite" Click="FavoriteBtn_Click" HorizontalContentAlignment="Left">
|
||||
<Button x:Name="Favorite" Click="FavoriteBtn_Click" HorizontalContentAlignment="Left" Style="{StaticResource ListButtonStyle}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="64"/>
|
||||
@@ -61,7 +58,7 @@
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<!--faculty button-->
|
||||
<Button Tag="{Binding Id}" Click="FacultyBtn_Click" HorizontalContentAlignment="Left">
|
||||
<Button Tag="{Binding Id}" Click="FacultyBtn_Click" HorizontalContentAlignment="Left" Style="{StaticResource ListButtonStyle}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="64"/>
|
||||
|
||||
@@ -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<CampusAppWPortalLib8.Model.Departments.DepartmentModel>());
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -146,8 +134,11 @@ namespace CampusAppWP8.Pages.Departments
|
||||
{
|
||||
base.OnNavigatedTo(e);
|
||||
|
||||
if (NavigationMode.Back != e.NavigationMode)
|
||||
if (NavigationContext.QueryString.ContainsKey(Constants.ParamRemoveBack))
|
||||
{
|
||||
if (NavigationContext.QueryString[Constants.ParamRemoveBack].Equals("true")) {
|
||||
NavigationService.RemoveBackEntry();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -179,13 +170,33 @@ namespace CampusAppWP8.Pages.Departments
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initialize the feed objects and load the data.
|
||||
/// </summary>
|
||||
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<CampusAppWPortalLib8.Model.Departments.DepartmentModel>());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Setup the faculty list.
|
||||
/// </summary>
|
||||
private void SetupFacultyList()
|
||||
{
|
||||
this.FacultyList.ItemsSource = DepartmentIndexPage.feed.Model.Faculties;
|
||||
this.progressBar.Visibility = Visibility.Collapsed;
|
||||
this.DefHeader.ProgressVisibility = Visibility.Collapsed;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -251,7 +262,7 @@ namespace CampusAppWP8.Pages.Departments
|
||||
/// </summary>
|
||||
private void FeedIsFailedFile()
|
||||
{
|
||||
this.progressBar.Visibility = Visibility.Collapsed;
|
||||
this.DefHeader.ProgressVisibility = Visibility.Collapsed;
|
||||
MessageBoxResult result = MessageBoxes.ShowMainModelErrorMessageBox(AppResources.MsgBox_ErrorMainModelLoadFile);
|
||||
}
|
||||
|
||||
|
||||
@@ -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 @@
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!--title-->
|
||||
<StackPanel Grid.Row="0" Margin="12,17,0,28">
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.DepartmentApp_Title, Source={StaticResource LocalizedStrings}}" Style="{StaticResource PhoneTextNormalStyle}"/>
|
||||
<TextBlock x:Name="PageHeadline" Text="Seitenname" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}" FontSize="36" TextWrapping="Wrap"/>
|
||||
</StackPanel>
|
||||
<!--header-->
|
||||
<header:DefaultHeader x:Name="DefHeader" Grid.Row="0" HeaderName="{Binding Path=LocalizedResources.DepartmentApp_Title, Source={StaticResource LocalizedStrings}}"/>
|
||||
|
||||
<!--webbrowser-->
|
||||
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
|
||||
|
||||
@@ -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;
|
||||
|
||||
/// <summary>
|
||||
/// Info page of a chair.
|
||||
/// </summary>
|
||||
public partial class DepartmentInfoPage : PhoneApplicationPage
|
||||
{
|
||||
private bool feedLoadedFlag = false;
|
||||
|
||||
private string chairName = string.Empty;
|
||||
|
||||
#region Constructor
|
||||
|
||||
/// <summary>
|
||||
@@ -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
|
||||
@@ -65,6 +91,52 @@ namespace CampusAppWP8.Pages.Departments
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// On feed ready.
|
||||
/// </summary>
|
||||
private void OnFeedReady()
|
||||
{
|
||||
if (this.feedLoadedFlag == false)
|
||||
{
|
||||
this.feedLoadedFlag = true;
|
||||
DepartmentIndexPage.Feed.OnLoaded -= this.OnFeedReady;
|
||||
|
||||
ChairModel chair = null;
|
||||
ObservableCollection<FacultyModel> 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+"?"+Constants.ParamRemoveBack +"=true", UriKind.Relative));
|
||||
}
|
||||
break;
|
||||
case MessageBoxResult.Cancel:
|
||||
{
|
||||
NavigationService.GoBack();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -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 @@
|
||||
|
||||
<!-- LayoutRoot -->
|
||||
<Grid x:Name="LayoutRoot" Background="Transparent">
|
||||
<ProgressBar x:Name="progressBar" VerticalAlignment="Center" HorizontalAlignment="Center" Visibility="Collapsed" IsIndeterminate="True"/>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!--header-->
|
||||
<header:DefaultHeader x:Name="DefHeader" Grid.Row="0" HeaderName="{Binding Path=LocalizedResources.DepartmentApp_Title, Source={StaticResource LocalizedStrings}}"/>
|
||||
|
||||
<!-- Pivot -->
|
||||
<phone:Pivot x:Name="DepartmentPivot" Title="{Binding Path=LocalizedResources.DepartmentApp_Title, Source={StaticResource LocalizedStrings}}" ItemsSource="{Binding Faculties}">
|
||||
<phone:Pivot x:Name="DepartmentPivot" Grid.Row="1" ItemsSource="{Binding Faculties}">
|
||||
<!-- Pivotitem template -->
|
||||
<phone:Pivot.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Path=Name, Mode=OneWay}" />
|
||||
<TextBlock Text="{Binding Path=Name, Mode=OneWay}" Margin="0,-36,0,0"/>
|
||||
</DataTemplate>
|
||||
</phone:Pivot.HeaderTemplate>
|
||||
<phone:Pivot.ItemTemplate>
|
||||
@@ -39,8 +46,8 @@
|
||||
<DataTemplate>
|
||||
<StackPanel>
|
||||
<!--chair button-->
|
||||
<Button Tag="{Binding Url}" Click="ChairTB_Click" HorizontalContentAlignment="Left">
|
||||
<TextBlock Text="{Binding Name}" HorizontalAlignment="Stretch" TextWrapping="Wrap" FontSize="24"/>
|
||||
<Button Tag="{Binding Url}" Click="ChairTB_Click" HorizontalContentAlignment="Left" Style="{StaticResource ListButtonStyle}">
|
||||
<TextBlock Text="{Binding Name}" HorizontalAlignment="Stretch" TextWrapping="Wrap"/>
|
||||
</Button>
|
||||
<StackPanel Visibility="Collapsed">
|
||||
<!--add to favorite button-->
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
/// <summary>
|
||||
/// QR Code scanner.
|
||||
@@ -109,7 +111,12 @@ namespace CampusAppWP8.Pages.Dev
|
||||
if (this.cam != null)
|
||||
{
|
||||
this.captureThreadExit = true;
|
||||
this.captureThread.Join();
|
||||
|
||||
if (this.captureThread != null)
|
||||
{
|
||||
this.captureThread.Join();
|
||||
}
|
||||
|
||||
|
||||
this.cam.Dispose();
|
||||
|
||||
@@ -161,11 +168,14 @@ namespace CampusAppWP8.Pages.Dev
|
||||
{
|
||||
if (e.Succeeded)
|
||||
{
|
||||
this.cam.Focus();
|
||||
if (this.cam != null && !this.captureThreadExit)
|
||||
{
|
||||
this.cam.Focus();
|
||||
|
||||
this.captureThreadExit = false;
|
||||
this.captureThread = new Thread(this.CaptureThreadFunc);
|
||||
this.captureThread.Start();
|
||||
this.captureThreadExit = false;
|
||||
this.captureThread = new Thread(this.CaptureThreadFunc);
|
||||
this.captureThread.Start();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -228,16 +238,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 +266,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);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Capture thread function.
|
||||
/// </summary>
|
||||
@@ -259,10 +287,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);
|
||||
|
||||
@@ -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 @@
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<ProgressBar x:Name="progressBar" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Center" Visibility="Collapsed" IsIndeterminate="True"/>
|
||||
<!-- Title and headline -->
|
||||
<!--header-->
|
||||
<header:DefaultHeader x:Name="DefHeader" Grid.Row="0" HeaderName="{Binding Path=LocalizedResources.EventApp_Title, Source={StaticResource LocalizedStrings}}"/>
|
||||
<!--
|
||||
<StackPanel Grid.Row="0" Margin="12,17,0,28">
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.ApplicationTitle, Source={StaticResource LocalizedStrings}}" Style="{StaticResource PhoneTextNormalStyle}"/>
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.EventApp_Title, Source={StaticResource LocalizedStrings}}" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
|
||||
</StackPanel>
|
||||
-->
|
||||
<!-- Content -->
|
||||
<ListBox x:Name="EventList" Grid.Row="1">
|
||||
<ListBox x:Name="EventList" Grid.Row="1" Margin="12,0,12,0">
|
||||
<ListBox.ItemContainerStyle>
|
||||
<Style TargetType="ListBoxItem">
|
||||
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
|
||||
@@ -37,11 +40,9 @@
|
||||
</ListBox.ItemContainerStyle>
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Border BorderBrush="{StaticResource PhoneContrastBackgroundBrush}" Style="{StaticResource ListButtonBorder}">
|
||||
<lui:NavigateButton Name="EventItem" QuerryStringValue="{Binding Index}" Url="{Binding Path=Constants.PathEvent_EventPage, Source={StaticResource Const}}" QuerryStringName="{Binding Path=Constants.ParamPivotIndex, Source={StaticResource Const}}" Style="{StaticResource ListButtonNoneBorder}" HorizontalContentAlignment="Left">
|
||||
<TextBlock TextWrapping="Wrap" Text="{Binding Title}"/>
|
||||
</lui:NavigateButton>
|
||||
</Border>
|
||||
<lui:NavigateButton Name="EventItem" QuerryStringValue="{Binding Index}" Url="{Binding Path=Constants.PathEvent_EventPage, Source={StaticResource Const}}" QuerryStringName="{Binding Path=Constants.ParamPivotIndex, Source={StaticResource Const}}" Style="{StaticResource ListButtonStyle}" HorizontalContentAlignment="Left">
|
||||
<TextBlock TextWrapping="Wrap" Text="{Binding Title}"/>
|
||||
</lui:NavigateButton>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace CampusAppWP8.Pages.Events
|
||||
public EventIndexPage()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
this.progressBar.Visibility = Visibility.Visible;
|
||||
this.DefHeader.ProgressVisibility = Visibility.Visible;
|
||||
|
||||
ApplicationBarIconButton updateBtn = new ApplicationBarIconButton();
|
||||
updateBtn.IconUri = new Uri(Icons.Update, UriKind.Relative);
|
||||
@@ -108,6 +108,11 @@ namespace CampusAppWP8.Pages.Events
|
||||
protected override void OnNavigatedTo(NavigationEventArgs e)
|
||||
{
|
||||
base.OnNavigatedTo(e);
|
||||
|
||||
if (this.Orientation.Equals(PageOrientation.Landscape) || this.Orientation.Equals(PageOrientation.LandscapeLeft) || this.Orientation.Equals(PageOrientation.LandscapeRight))
|
||||
{
|
||||
ApplicationBar.Mode = Microsoft.Phone.Shell.ApplicationBarMode.Default;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -125,6 +130,26 @@ namespace CampusAppWP8.Pages.Events
|
||||
base.OnNavigatedFrom(e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Methods overrides the OnOrientationChanged-Method.
|
||||
/// </summary>
|
||||
/// <param name="e">orientation changed event args.</param>
|
||||
protected override void OnOrientationChanged(OrientationChangedEventArgs e)
|
||||
{
|
||||
if (e.Orientation == PageOrientation.Landscape
|
||||
|| e.Orientation == PageOrientation.LandscapeLeft
|
||||
|| e.Orientation == PageOrientation.LandscapeRight)
|
||||
{
|
||||
ApplicationBar.Mode = ApplicationBarMode.Default;
|
||||
}
|
||||
else
|
||||
{
|
||||
ApplicationBar.Mode = ApplicationBarMode.Minimized;
|
||||
}
|
||||
|
||||
base.OnOrientationChanged(e);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region private
|
||||
@@ -136,8 +161,9 @@ namespace CampusAppWP8.Pages.Events
|
||||
/// </summary>
|
||||
private void SetupEventPageList()
|
||||
{
|
||||
EventIndexPage.eventFeed.Model.Channel[0].OrderByDate();
|
||||
this.EventList.ItemsSource = EventIndexPage.eventFeed.Model.Channel[0].Item;
|
||||
this.progressBar.Visibility = Visibility.Collapsed;
|
||||
this.DefHeader.ProgressVisibility = Visibility.Collapsed;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -148,7 +174,7 @@ namespace CampusAppWP8.Pages.Events
|
||||
/// <param name="e">event args</param>
|
||||
private void EventForceUpdate_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.progressBar.Visibility = Visibility.Visible;
|
||||
this.DefHeader.ProgressVisibility = Visibility.Visible;
|
||||
EventIndexPage.eventFeed.ForceWebUpdate();
|
||||
}
|
||||
|
||||
@@ -167,7 +193,7 @@ namespace CampusAppWP8.Pages.Events
|
||||
private void FeedIsFailedFile()
|
||||
{
|
||||
MessageBoxResult result = MessageBoxes.ShowMainModelErrorMessageBox(AppResources.MsgBox_ErrorMainModelLoadFile);
|
||||
this.progressBar.Visibility = Visibility.Collapsed;
|
||||
this.DefHeader.ProgressVisibility = Visibility.Collapsed;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -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"
|
||||
mc:Ignorable="d"
|
||||
FontFamily="{StaticResource PhoneFontFamilyNormal}"
|
||||
FontSize="{StaticResource PhoneFontSizeNormal}"
|
||||
@@ -14,37 +15,43 @@
|
||||
shell:SystemTray.IsVisible="True">
|
||||
<!-- LayoutRoot -->
|
||||
<Grid x:Name="LayoutRoot" Background="Transparent">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!--header-->
|
||||
<header:DefaultHeader x:Name="DefHeader" Grid.Row="0" HeaderName="{Binding Path=LocalizedResources.EventApp_Title, Source={StaticResource LocalizedStrings}}"/>
|
||||
|
||||
<ProgressBar x:Name="progressBar" VerticalAlignment="Center" HorizontalAlignment="Center" Visibility="Collapsed" IsIndeterminate="True"/>
|
||||
<!-- Pivotpage -->
|
||||
<phone:Pivot x:Name="EventPivot" Title="{Binding Path=LocalizedResources.ApplicationTitle, Source={StaticResource LocalizedStrings}}" SelectionChanged="OnPivotSelectionChange">
|
||||
<phone:Pivot x:Name="EventPivot" Grid.Row="1" SelectionChanged="OnPivotSelectionChange">
|
||||
<!-- Pivotitem template -->
|
||||
<phone:Pivot.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Path=Date, Mode=OneWay}" />
|
||||
<TextBlock Text="{Binding Path=Date, Mode=OneWay}" Margin="0,-36,0,0"/>
|
||||
</DataTemplate>
|
||||
</phone:Pivot.HeaderTemplate>
|
||||
<phone:Pivot.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<DataTemplate x:Name="DataTemp">
|
||||
<Grid x:Name="EventParentGrid">
|
||||
<Grid.RowDefinitions>
|
||||
<!--<RowDefinition Height="100"/>-->
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Grid x:Name="EventTextGrid" Grid.Row="0">
|
||||
<Grid x:Name="EventTextGrid" Grid.Row="0" Visibility="{Binding Path=TextVisibility, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}}">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="100" />
|
||||
<RowDefinition Height="Auto" MaxHeight="300"/>
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock x:Name="EventHeadline" Text="{Binding Path=Title, Mode=OneWay}" Grid.Row="0" Height="Auto" TextWrapping="Wrap" VerticalAlignment="Center" HorizontalAlignment="Left" FontSize="42"/>
|
||||
<TextBlock x:Name="EventHeadline" Text="{Binding Path=Title, Mode=OneWay}" Grid.Row="0" Height="Auto" TextWrapping="Wrap" VerticalAlignment="Center" HorizontalAlignment="Left" Style="{StaticResource PhoneTextTitle2Style}"/>
|
||||
<ScrollViewer x:Name="EventTextScroll" Grid.Row="1">
|
||||
<TextBlock x:Name="EventText" Text="{Binding Path=Text, Mode=OneWay}" Height="Auto" TextWrapping="Wrap" VerticalAlignment="Center" HorizontalAlignment="Left" FontSize="24" />
|
||||
<TextBlock x:Name="EventText" Text="{Binding Path=Text, Mode=OneWay}" Height="Auto" TextWrapping="Wrap" VerticalAlignment="Center" HorizontalAlignment="Left" Style="{StaticResource PhoneTextNormalStyle}" />
|
||||
</ScrollViewer>
|
||||
</Grid>
|
||||
|
||||
<phone:WebBrowser x:Name="EventWebBrowser" Source="{Binding Path=Link, Mode=OneWay}" Grid.Row="0" IsScriptEnabled="True" Visibility="Collapsed"/>
|
||||
<phone:WebBrowser x:Name="EventWebBrowser" Source="{Binding Path=Link, Mode=OneWay}" Grid.Row="0" IsScriptEnabled="True" Visibility="{Binding Path=BrowserVisibility, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}}"/>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</phone:Pivot.ItemTemplate>
|
||||
|
||||
@@ -20,23 +20,20 @@ namespace CampusAppWP8.Pages.Events
|
||||
using Windows.Phone.Speech.Synthesis;
|
||||
using CampusAppWPortalLib8.Model.RSS;
|
||||
|
||||
using System.Windows.Media;
|
||||
|
||||
/// <summary>
|
||||
/// EventPage, where every event fees has his own PivotItem.
|
||||
/// EventPage, where every event feed has his own PivotItem.
|
||||
/// </summary>
|
||||
public partial class EventPage : PhoneApplicationPage
|
||||
{
|
||||
#region Method
|
||||
#region Memeber
|
||||
|
||||
/// <summary>
|
||||
/// To checking if the feed source is already set or not.
|
||||
/// </summary>
|
||||
private bool isSourceSet = false;
|
||||
|
||||
/// <summary>
|
||||
/// To store the last selected pivot index.
|
||||
/// </summary>
|
||||
private int lastSelectedIndex = -1;
|
||||
|
||||
/// <summary>
|
||||
/// For checking if the instance is back from tombstone.
|
||||
/// </summary>
|
||||
@@ -92,7 +89,13 @@ namespace CampusAppWP8.Pages.Events
|
||||
protected override void OnNavigatedTo(NavigationEventArgs e)
|
||||
{
|
||||
base.OnNavigatedTo(e);
|
||||
this.progressBar.Visibility = Visibility.Visible;
|
||||
|
||||
if (this.Orientation.Equals(PageOrientation.Landscape) || this.Orientation.Equals(PageOrientation.LandscapeLeft) || this.Orientation.Equals(PageOrientation.LandscapeRight))
|
||||
{
|
||||
ApplicationBar.Mode = Microsoft.Phone.Shell.ApplicationBarMode.Default;
|
||||
}
|
||||
|
||||
this.DefHeader.ProgressVisibility = Visibility.Visible;
|
||||
|
||||
if (this.isNewInstance)
|
||||
{
|
||||
@@ -147,7 +150,7 @@ namespace CampusAppWP8.Pages.Events
|
||||
}
|
||||
}
|
||||
|
||||
this.progressBar.Visibility = Visibility.Collapsed;
|
||||
this.DefHeader.ProgressVisibility = Visibility.Collapsed;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -181,15 +184,15 @@ namespace CampusAppWP8.Pages.Events
|
||||
/// <param name="e">event args</param>
|
||||
private void OnPivotSelectionChange(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
int selIndex = (sender as Pivot).SelectedIndex;
|
||||
|
||||
if (this.lastSelectedIndex > -1)
|
||||
if (e.RemovedItems.Count > 0)
|
||||
{
|
||||
Utilities.SetElementVisibility(this.EventPivot, "EventParentGrid", "EventWebBrowser", Visibility.Collapsed, this.lastSelectedIndex);
|
||||
Utilities.SetElementVisibility(this.EventPivot, "EventParentGrid", "EventTextGrid", Visibility.Visible, this.lastSelectedIndex);
|
||||
}
|
||||
RSSModel last = e.RemovedItems[0] as RSSModel;
|
||||
|
||||
this.lastSelectedIndex = selIndex;
|
||||
if (last != null && last.TextVisibility == false)
|
||||
{
|
||||
last.TextVisibility = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -201,15 +204,13 @@ namespace CampusAppWP8.Pages.Events
|
||||
/// <param name="e">event args</param>
|
||||
private void EventLink_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (Visibility.Visible == Utilities.GetElementVisibility(this.EventPivot, "EventParentGrid", "EventTextGrid", this.EventPivot.SelectedIndex))
|
||||
RSSModel cur = this.EventPivot.SelectedItem as RSSModel;
|
||||
|
||||
this.EventPivot.UpdateLayout();
|
||||
|
||||
if (cur != null)
|
||||
{
|
||||
Utilities.SetElementVisibility(this.EventPivot, "EventParentGrid", "EventTextGrid", Visibility.Collapsed, this.EventPivot.SelectedIndex);
|
||||
Utilities.SetElementVisibility(this.EventPivot, "EventParentGrid", "EventWebBrowser", Visibility.Visible, this.EventPivot.SelectedIndex);
|
||||
}
|
||||
else
|
||||
{
|
||||
Utilities.SetElementVisibility(this.EventPivot, "EventParentGrid", "EventWebBrowser", Visibility.Collapsed, this.EventPivot.SelectedIndex);
|
||||
Utilities.SetElementVisibility(this.EventPivot, "EventParentGrid", "EventTextGrid", Visibility.Visible, this.EventPivot.SelectedIndex);
|
||||
cur.TextVisibility = (cur.TextVisibility) ? false : true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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}"
|
||||
@@ -16,9 +17,22 @@
|
||||
|
||||
<!--LayoutRoot ist das Stammraster, in dem alle anderen Seiteninhalte platziert werden-->
|
||||
<Grid x:Name="LayoutRoot" Background="Transparent">
|
||||
<ProgressBar Name="ProgressBar" Visibility="Collapsed" IsIndeterminate="True"/>
|
||||
<phone:Pivot Name="ExamPivot" Title="{Binding Path=LocalizedResources.ExaminationApp_Header, Source={StaticResource LocalizedStrings}}">
|
||||
<phone:PivotItem Header="{Binding Path=LocalizedResources.Degree_Bachelor, Source={StaticResource LocalizedStrings}}">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<StackPanel Grid.Row="0">
|
||||
<header:DefaultHeader Name="DefHeader" HeaderName="{Binding Path=LocalizedResources.ExaminationApp_Header, Source={StaticResource LocalizedStrings}}"/>
|
||||
</StackPanel>
|
||||
<phone:Pivot Name="ExamPivot" Grid.Row="1">
|
||||
<phone:Pivot.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<Grid Margin="0,-36,0,0">
|
||||
<TextBlock Text="{Binding}"/>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</phone:Pivot.HeaderTemplate>
|
||||
<phone:PivotItem Name="BachelorItem">
|
||||
<ListBox x:Name="BachelorPanel" ItemsSource="{Binding Value}">
|
||||
<ListBox.ItemContainerStyle>
|
||||
<Style TargetType="ListBoxItem">
|
||||
@@ -30,14 +44,14 @@
|
||||
<DataTemplate>
|
||||
<StackPanel>
|
||||
<Button Tag="{Binding Link}" Style="{StaticResource ListButtonStyle}" Click="Button_Click">
|
||||
<TextBlock Text="{Binding Caption}" TextWrapping="Wrap"/>
|
||||
<TextBlock Text="{Binding Caption}" TextWrapping="Wrap" TextAlignment="Center"/>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
</phone:PivotItem>
|
||||
<phone:PivotItem Header="{Binding Path=LocalizedResources.Degree_Master, Source={StaticResource LocalizedStrings}}">
|
||||
<phone:PivotItem Name="MasterItem">
|
||||
<ListBox x:Name="MasterPanel" ItemsSource="{Binding Value}">
|
||||
<ListBox.ItemContainerStyle>
|
||||
<Style TargetType="ListBoxItem">
|
||||
@@ -49,14 +63,14 @@
|
||||
<DataTemplate>
|
||||
<StackPanel>
|
||||
<Button Tag="{Binding Link}" Style="{StaticResource ListButtonStyle}" Click="Button_Click">
|
||||
<TextBlock Text="{Binding Caption}" TextWrapping="Wrap"/>
|
||||
<TextBlock Text="{Binding Caption}" TextWrapping="Wrap" TextAlignment="Center"/>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
</phone:PivotItem>
|
||||
<phone:PivotItem Header="{Binding Path=LocalizedResources.Degree_Diploma, Source={StaticResource LocalizedStrings}}">
|
||||
<phone:PivotItem Name="DiplomItem">
|
||||
<ListBox x:Name="DiplomaPanel" ItemsSource="{Binding Value}">
|
||||
<ListBox.ItemContainerStyle>
|
||||
<Style TargetType="ListBoxItem">
|
||||
@@ -68,7 +82,7 @@
|
||||
<DataTemplate>
|
||||
<StackPanel>
|
||||
<Button Tag="{Binding Link}" Style="{StaticResource ListButtonStyle}" Click="Button_Click">
|
||||
<TextBlock Text="{Binding Caption}" TextWrapping="Wrap"/>
|
||||
<TextBlock Text="{Binding Caption}" TextWrapping="Wrap" TextAlignment="Center"/>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
|
||||
@@ -38,6 +38,10 @@ namespace CampusAppWP8.Pages.Exams
|
||||
public Exams()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
this.BachelorItem.Header = CampusAppWPortalLib8.Resources.AppResources.Degree_Bachelor;
|
||||
this.MasterItem.Header = CampusAppWPortalLib8.Resources.AppResources.Degree_Master;
|
||||
this.DiplomItem.Header = CampusAppWPortalLib8.Resources.AppResources.Degree_Diploma;
|
||||
this.DefHeader.ProgressVisibility = Visibility.Visible;
|
||||
this.InitializeFeed();
|
||||
}
|
||||
|
||||
@@ -53,12 +57,12 @@ namespace CampusAppWP8.Pages.Exams
|
||||
protected override void OnNavigatedTo(NavigationEventArgs e)
|
||||
{
|
||||
base.OnNavigatedTo(e);
|
||||
|
||||
if (this.feed == null)
|
||||
{
|
||||
this.InitializeFeed();
|
||||
}
|
||||
|
||||
this.ProgressBar.Visibility = System.Windows.Visibility.Visible;
|
||||
this.feed.LoadData(Utilities.GetLoadModus<Model.Exams.ExamListWp8Model>());
|
||||
}
|
||||
|
||||
@@ -99,14 +103,14 @@ namespace CampusAppWP8.Pages.Exams
|
||||
private void FeedIsReady()
|
||||
{
|
||||
this.SetupExamList();
|
||||
this.ProgressBar.Visibility = System.Windows.Visibility.Collapsed;
|
||||
this.DefHeader.ProgressVisibility = Visibility.Collapsed;
|
||||
}
|
||||
|
||||
/// <summary>Executes the PDF reader operation.</summary>
|
||||
/// <remarks>Stubbfel, 03.09.2013.</remarks>
|
||||
private void LaunchPDFReader()
|
||||
{
|
||||
this.ProgressBar.Visibility = System.Windows.Visibility.Collapsed;
|
||||
this.DefHeader.ProgressVisibility = Visibility.Collapsed;
|
||||
this.file.SaveAndLaunchFile();
|
||||
}
|
||||
|
||||
@@ -178,7 +182,7 @@ namespace CampusAppWP8.Pages.Exams
|
||||
private void FeedIsFailFile()
|
||||
{
|
||||
MessageBoxResult result = MessageBoxes.ShowMainModelErrorMessageBox(AppResources.MsgBox_ErrorMainModelLoadFile);
|
||||
this.ProgressBar.Visibility = System.Windows.Visibility.Collapsed;
|
||||
this.DefHeader.ProgressVisibility = Visibility.Collapsed;
|
||||
}
|
||||
|
||||
/// <summary>Event handler. Called by Button for click events.</summary>
|
||||
@@ -213,7 +217,7 @@ namespace CampusAppWP8.Pages.Exams
|
||||
this.file.OnFailedWeb += new ExamFile.OnFailed(this.FeedIsFailWeb);
|
||||
this.file.OnFailedFile += new ExamFile.OnFailed(this.FeedIsFailFile);
|
||||
this.file.LoadData();
|
||||
this.ProgressBar.Visibility = System.Windows.Visibility.Visible;
|
||||
this.DefHeader.ProgressVisibility = Visibility.Visible;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
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}"
|
||||
@@ -22,17 +23,12 @@
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!--TitlePanel enthält den Namen der Anwendung und den Seitentitel-->
|
||||
<ProgressBar Name="ProgressBar" Grid.Row="1" Visibility="Collapsed" IsIndeterminate="True"/>
|
||||
|
||||
<StackPanel Grid.Row="0" Margin="12,17,0,28">
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.ApplicationTitle, Source={StaticResource LocalizedStrings}}" Style="{StaticResource PhoneTextNormalStyle}"/>
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.LectureApp_Title, Source={StaticResource LocalizedStrings}}" Style="{StaticResource PhoneTextTitle2Style}"/>
|
||||
|
||||
<StackPanel Grid.Row="0">
|
||||
<header:DefaultHeader Name="DefHeader" HeaderName="{Binding Path=LocalizedResources.LectureApp_Title, Source={StaticResource LocalizedStrings}}"/>
|
||||
</StackPanel>
|
||||
|
||||
|
||||
<!--ContentPanel - zusätzliche Inhalte hier platzieren-->
|
||||
<ScrollViewer Grid.Row="1" Margin="12,0,12,0">
|
||||
<ScrollViewer Grid.Row="1" Margin="24,0,12,0">
|
||||
<Grid x:Name="ContentPanel">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
@@ -160,7 +156,7 @@
|
||||
</StackPanel>
|
||||
</Border>
|
||||
<Border BorderBrush="{StaticResource PhoneBorderBrush}" BorderThickness="0,2,0,0" Grid.Row="5">
|
||||
<Button Name="SearchButton" Click="SendRequest">
|
||||
<Button Name="SearchButton" Click="SendRequest" HorizontalAlignment="Center">
|
||||
<Image Name="SearchButtonImg" Source="{Binding Path=ThemelizedIcon.Search, Source={StaticResource ThemelizedIcons}}" Width="60" />
|
||||
</Button>
|
||||
</Border>
|
||||
|
||||
@@ -93,7 +93,7 @@ namespace CampusAppWP8.Pages.Lecture
|
||||
/// </summary>
|
||||
private void LoadPageModel()
|
||||
{
|
||||
this.ProgressBar.Visibility = Visibility.Visible;
|
||||
this.DefHeader.ProgressVisibility = Visibility.Visible;
|
||||
this.pageModel = new LecturePageModel();
|
||||
this.pageModel.OnLoaded += new LecturePageModel.OnIO(this.SetupListPickers);
|
||||
this.pageModel.LoadLists();
|
||||
@@ -119,7 +119,7 @@ namespace CampusAppWP8.Pages.Lecture
|
||||
|
||||
this.SetSelectedIndex();
|
||||
this.init = true;
|
||||
this.ProgressBar.Visibility = Visibility.Collapsed;
|
||||
this.DefHeader.ProgressVisibility = Visibility.Collapsed;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -169,7 +169,7 @@ namespace CampusAppWP8.Pages.Lecture
|
||||
this.api = new LectureApi();
|
||||
this.api.OnLoaded += new LectureApi.OnIO(this.ApiIsReady);
|
||||
this.api.OnFailedLoad += new LectureApi.OnFailed(this.ApiIsFail);
|
||||
this.ProgressBar.Visibility = System.Windows.Visibility.Visible;
|
||||
this.DefHeader.ProgressVisibility = System.Windows.Visibility.Visible;
|
||||
List<UrlParamModel> parameterList = this.CreateUrlParameter();
|
||||
this.api.SetUriParams(parameterList);
|
||||
this.api.LoadData();
|
||||
@@ -208,7 +208,7 @@ namespace CampusAppWP8.Pages.Lecture
|
||||
}
|
||||
|
||||
App.SaveToIsolatedStorage<LectureWp8List>(Constants.IsolatedStorage_LectureModel, this.api.Model);
|
||||
this.ProgressBar.Visibility = System.Windows.Visibility.Collapsed;
|
||||
this.DefHeader.ProgressVisibility = System.Windows.Visibility.Collapsed;
|
||||
Uri url = new Uri(Constants.PathLecture_ResultPage, UriKind.Relative);
|
||||
NavigationService.Navigate(url);
|
||||
}
|
||||
@@ -254,7 +254,7 @@ namespace CampusAppWP8.Pages.Lecture
|
||||
private void ApiIsFail()
|
||||
{
|
||||
MessageBoxResult result = MessageBoxes.ShowMainModelErrorMessageBox(AppResources.MsgBox_ErrorMainModelLoad);
|
||||
this.ProgressBar.Visibility = Visibility.Collapsed;
|
||||
this.DefHeader.ProgressVisibility = Visibility.Collapsed;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -6,10 +6,12 @@
|
||||
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: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="Portrait" Orientation="Portrait"
|
||||
SupportedOrientations="PortraitOrLandscape" Orientation="Portrait"
|
||||
mc:Ignorable="d"
|
||||
shell:SystemTray.IsVisible="True">
|
||||
|
||||
@@ -20,14 +22,12 @@
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!--TitlePanel enthält den Namen der Anwendung und den Seitentitel-->
|
||||
<StackPanel Grid.Row="0" Margin="12,17,0,28">
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.ApplicationTitle, Source={StaticResource LocalizedStrings}}" Style="{StaticResource PhoneTextNormalStyle}"/>
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.LectureApp_DetailsHeader, Source={StaticResource LocalizedStrings}}" Style="{StaticResource PhoneTextTitle2Style}"/>
|
||||
<StackPanel Grid.Row="0">
|
||||
<header:DefaultHeader HeaderName="{Binding Path=LocalizedResources.LectureApp_DetailsHeader, Source={StaticResource LocalizedStrings}}"/>
|
||||
</StackPanel>
|
||||
|
||||
<!--ContentPanel - zusätzliche Inhalte hier platzieren-->
|
||||
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
|
||||
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="24,0,12,0">
|
||||
<ScrollViewer>
|
||||
<StackPanel>
|
||||
<Border BorderBrush="{StaticResource PhoneInverseInactiveBrush}" BorderThickness="0,0,0,0" Padding="0,12,0,12">
|
||||
@@ -57,7 +57,11 @@
|
||||
<Border BorderBrush="{StaticResource PhoneInverseInactiveBrush}" BorderThickness="0,1,0,0" Padding="0,12,0,12">
|
||||
<StackPanel>
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.LectureApp_Department, Source={StaticResource LocalizedStrings}}" Style="{StaticResource PhoneTextGroupHeaderStyle}" Margin="0,0,0,0"/>
|
||||
<TextBlock Text="{Binding Department}" TextWrapping="Wrap"/>
|
||||
|
||||
<lui:NavigateButton Url="{Binding Path=Constants.PathDepartment_DepartmentInfoPage, Source={StaticResource Const}}" QuerryStringName="{Binding Path=Constants.ParamName, Source={StaticResource Const}}" QuerryStringValue="{Binding Department}">
|
||||
<TextBlock Text="{Binding Department}" TextWrapping="Wrap"/>
|
||||
</lui:NavigateButton>
|
||||
|
||||
</StackPanel>
|
||||
</Border>
|
||||
<Border BorderBrush="{StaticResource PhoneInverseInactiveBrush}" BorderThickness="0,1,0,0" Padding="0,12,0,12">
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
|
||||
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}"
|
||||
@@ -23,11 +24,10 @@
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!--TitlePanel enthält den Namen der Anwendung und den Seitentitel-->
|
||||
<StackPanel Grid.Row="0" Margin="12,17,0,28">
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.ApplicationTitle, Source={StaticResource LocalizedStrings}}" Style="{StaticResource PhoneTextNormalStyle}"/>
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.LectureApp_Title, Source={StaticResource LocalizedStrings}}" Style="{StaticResource PhoneTextTitle2Style}" />
|
||||
<StackPanel Grid.Row="0">
|
||||
<header:DefaultHeader HeaderName="{Binding Path=LocalizedResources.LectureApp_Title, Source={StaticResource LocalizedStrings}}"/>
|
||||
</StackPanel>
|
||||
<ListBox x:Name="ResultList" Grid.Row="1">
|
||||
<ListBox x:Name="ResultList" Grid.Row="1" >
|
||||
<ListBox.ItemContainerStyle>
|
||||
<Style TargetType="ListBoxItem">
|
||||
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
|
||||
@@ -36,7 +36,7 @@
|
||||
</ListBox.ItemContainerStyle>
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Border BorderBrush="{StaticResource PhoneContrastBackgroundBrush}" Style="{StaticResource ListButtonBorder}">
|
||||
<Border BorderBrush="{StaticResource PhoneContrastBackgroundBrush}" Style="{StaticResource ListButtonBorder}" Margin="12,0,0,12">
|
||||
<StackPanel>
|
||||
<lui:ToggleButton ToggleContentTag="{Binding Path=Constants.ToggleContent, Source={StaticResource Const}}" Style="{StaticResource ListButtonNoneBorder}" HorizontalContentAlignment="Left" >
|
||||
<Grid HorizontalAlignment="Left">
|
||||
@@ -52,7 +52,7 @@
|
||||
<TextBlock Text="{Binding Type}" TextAlignment="Left" HorizontalAlignment="Left" />
|
||||
<TextBlock Text=" : "/>
|
||||
</StackPanel>
|
||||
<Image Source="{Binding IconUrl}" Width="50" />
|
||||
<Image Source="{Binding IconUrl}" Width="50" HorizontalAlignment="Left"/>
|
||||
</StackPanel>
|
||||
<TextBlock Text="{Binding Title}" TextWrapping="Wrap" Grid.Column="1" Grid.Row="0"/>
|
||||
</Grid>
|
||||
|
||||
@@ -7,19 +7,35 @@
|
||||
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"
|
||||
mc:Ignorable="d"
|
||||
FontFamily="{StaticResource PhoneFontFamilyNormal}"
|
||||
FontSize="{StaticResource PhoneFontSizeNormal}"
|
||||
Foreground="{StaticResource PhoneForegroundBrush}"
|
||||
SupportedOrientations="PortraitOrLandscape" Orientation="Portrait"
|
||||
OrientationChanged="PhoneApplicationPage_OrientationChanged"
|
||||
shell:SystemTray.IsVisible="True">
|
||||
|
||||
<!--LayoutRoot ist das Stammraster, in dem alle anderen Seiteninhalte platziert werden-->
|
||||
<Grid x:Name="LayoutRoot" Background="Transparent">
|
||||
<ProgressBar Name="ProgressBar" Visibility="Collapsed" IsIndeterminate="True"/>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!--header-->
|
||||
<header:DefaultHeader x:Name="DefHeader" Grid.Row="0" HeaderName="{Binding Path=LocalizedResources.LinkApp_Title, Source={StaticResource LocalizedStrings}}"/>
|
||||
|
||||
<!--Pivotsteuerelement-->
|
||||
<phone:Pivot Title="{Binding Path=LocalizedResources.ApplicationTitle, Source={StaticResource LocalizedStrings}}">
|
||||
<phone:Pivot Grid.Row="1">
|
||||
<!--Pivotelement eins-->
|
||||
<phone:Pivot.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<Grid Margin="0,-36,0,0">
|
||||
<TextBlock Text="{Binding}"/>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</phone:Pivot.HeaderTemplate>
|
||||
<phone:PivotItem Header="{Binding Path=LocalizedResources.LinkApp_CommonLinks, Source={StaticResource LocalizedStrings}}">
|
||||
<ListBox x:Name="CommonLinkPanel">
|
||||
<ListBox.ItemContainerStyle>
|
||||
@@ -50,7 +66,7 @@
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel>
|
||||
<lui:LinkButton Style="{StaticResource ListButtonStyle}" Content="{Binding Title}" Url="{Binding Link}"/>
|
||||
<lui:LinkButton Style="{StaticResource ListButtonStyle}" Content="{Binding Title}" Url="{Binding Link}" HorizontalContentAlignment="Center"/>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
|
||||
@@ -64,8 +64,14 @@ namespace CampusAppWP8.Pages.Links
|
||||
{
|
||||
base.OnNavigatedTo(e);
|
||||
|
||||
if (this.Orientation.Equals(PageOrientation.Landscape) || this.Orientation.Equals(PageOrientation.LandscapeLeft) || this.Orientation.Equals(PageOrientation.LandscapeRight))
|
||||
{
|
||||
ApplicationBar.Mode = Microsoft.Phone.Shell.ApplicationBarMode.Default;
|
||||
}
|
||||
|
||||
this.InitializeFeeds();
|
||||
this.ProgressBar.Visibility = System.Windows.Visibility.Visible;
|
||||
|
||||
this.DefHeader.ProgressVisibility = Visibility.Visible;
|
||||
this.loadingFeeds = 2;
|
||||
this.commonLinkFeed.LoadData(Utilities.GetLoadModus<CampusAppWPortalLib8.Model.Link.LinkListModel>());
|
||||
this.clubLinkFeed.LoadData(Utilities.GetLoadModus<CampusAppWPortalLib8.Model.Link.LinkListModel>());
|
||||
@@ -165,7 +171,8 @@ namespace CampusAppWP8.Pages.Links
|
||||
private void LinkForceUpdate_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.loadingFeeds = 2;
|
||||
this.ProgressBar.Visibility = System.Windows.Visibility.Visible;
|
||||
//this.ProgressBar.Visibility = System.Windows.Visibility.Visible;
|
||||
this.DefHeader.ProgressVisibility = Visibility.Visible;
|
||||
this.commonLinkFeed.ForceWebUpdate();
|
||||
this.clubLinkFeed.ForceWebUpdate();
|
||||
}
|
||||
@@ -205,9 +212,27 @@ namespace CampusAppWP8.Pages.Links
|
||||
this.loadingFeeds--;
|
||||
if (this.loadingFeeds < 1)
|
||||
{
|
||||
this.ProgressBar.Visibility = System.Windows.Visibility.Collapsed;
|
||||
this.DefHeader.ProgressVisibility = Visibility.Collapsed;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method handle OrientationPage
|
||||
/// </summary>
|
||||
/// <param name="sender">Caller of the function</param>
|
||||
/// <param name="e">some EventArgs</param>
|
||||
private void PhoneApplicationPage_OrientationChanged(object sender, OrientationChangedEventArgs e)
|
||||
{
|
||||
if (this.Orientation == PageOrientation.LandscapeLeft || this.Orientation == PageOrientation.LandscapeRight)
|
||||
{
|
||||
ApplicationBar.Mode = Microsoft.Phone.Shell.ApplicationBarMode.Default;
|
||||
}
|
||||
else
|
||||
{
|
||||
ApplicationBar.Mode = Microsoft.Phone.Shell.ApplicationBarMode.Minimized;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -7,20 +7,30 @@
|
||||
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"
|
||||
xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
|
||||
mc:Ignorable="d"
|
||||
FontFamily="{StaticResource PhoneFontFamilyNormal}"
|
||||
FontSize="{StaticResource PhoneFontSizeNormal}"
|
||||
Foreground="{StaticResource PhoneForegroundBrush}"
|
||||
SupportedOrientations="PortraitOrLandscape" Orientation="Portrait"
|
||||
OrientationChanged="PhoneApplicationPage_OrientationChanged"
|
||||
shell:SystemTray.IsVisible="True">
|
||||
<!--LayoutRoot ist das Stammraster, in dem alle anderen Seiteninhalte platziert werden-->
|
||||
<Grid x:Name="LayoutRoot" Background="Transparent">
|
||||
<ProgressBar Name="ProgressBar" Visibility="Collapsed" IsIndeterminate="True"/>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<StackPanel Grid.Row="0">
|
||||
<header:DefaultHeader Name="DefHeader" HeaderName="{Binding Path=LocalizedResources.LocalizedResources.MensaApp_Title, Source={StaticResource LocalizedStrings}}"/>
|
||||
</StackPanel>
|
||||
|
||||
<!--Pivotsteuerelement-->
|
||||
<phone:Pivot Name="MensaPivot" Title="{Binding Path=LocalizedResources.MensaApp_Title, Source={StaticResource LocalizedStrings}}">
|
||||
<phone:Pivot Grid.Row="1" Name="MensaPivot">
|
||||
<phone:Pivot.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel>
|
||||
<StackPanel Margin="0,-36,0,0">
|
||||
<TextBlock Text="{Binding Day}" />
|
||||
<TextBlock Text="{Binding Date}" FontSize="34" Margin="6,0,0,0"/>
|
||||
</StackPanel>
|
||||
@@ -28,7 +38,7 @@
|
||||
</phone:Pivot.HeaderTemplate>
|
||||
<phone:Pivot.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<ScrollViewer>
|
||||
<ScrollViewer Margin="12,0,0,0">
|
||||
<ItemsControl x:Name="MenuPanel" ItemsSource="{Binding Meals}" ScrollViewer.VerticalScrollBarVisibility="Auto">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
@@ -38,25 +48,29 @@
|
||||
<ColumnDefinition Width="auto"></ColumnDefinition>
|
||||
<ColumnDefinition Width="*"></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Grid.Column="0" Margin="0,0,0,12" Width="100">
|
||||
<StackPanel HorizontalAlignment="Left">
|
||||
<StackPanel Orientation="Horizontal" Grid.Column="0" Margin="0,0,0,12" MinWidth="100">
|
||||
<TextBlock Text="{Binding MealName}" FontWeight="Bold"/>
|
||||
<TextBlock Text=" : "/>
|
||||
</StackPanel>
|
||||
<Image Source="{Binding IconUrl}" Width="100" Margin="-25,-25,-25,-21"></Image>
|
||||
<Image HorizontalAlignment="Left" Source="{Binding IconUrl}" Width="100" Margin="-12,-25,0,-21"></Image>
|
||||
</StackPanel>
|
||||
<TextBlock Text="{Binding MealDesc}" TextWrapping="Wrap" Grid.Column="1"/>
|
||||
</Grid>
|
||||
<toolkit:ContextMenuService.ContextMenu>
|
||||
<toolkit:ContextMenu>
|
||||
<toolkit:MenuItem Tag="{Binding MealDesc}" Header="{Binding Path=LocalizedResources.ContextMenu_MealCopy, Source={StaticResource LocalizedStrings}}" Click="MenuItem_Click">
|
||||
</toolkit:MenuItem>
|
||||
</toolkit:ContextMenu>
|
||||
</toolkit:ContextMenuService.ContextMenu>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
|
||||
</ScrollViewer>
|
||||
</DataTemplate>
|
||||
</phone:Pivot.ItemTemplate>
|
||||
</phone:Pivot>
|
||||
<!-- <Image Source="/Assets/AlignmentGrid.png" VerticalAlignment="Top" Height="800" Width="480" Margin="0,-32,0,0" Grid.Row="0" Grid.RowSpan="2" IsHitTestVisible="False" /> -->
|
||||
</Grid>
|
||||
<phone:PhoneApplicationPage.ApplicationBar>
|
||||
<shell:ApplicationBar IsVisible="True" IsMenuEnabled="True" Mode="Minimized" >
|
||||
|
||||
@@ -85,6 +85,8 @@ namespace CampusAppWP8.Pages.Mensa
|
||||
{
|
||||
menuItem3.Text = CampusAppWPortalLib8.Resources.AppResources.Campus_SFBMain;
|
||||
}
|
||||
|
||||
this.DefHeader.ProgressVisibility = Visibility.Visible;
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -100,7 +102,11 @@ namespace CampusAppWP8.Pages.Mensa
|
||||
protected override void OnNavigatedTo(NavigationEventArgs e)
|
||||
{
|
||||
base.OnNavigatedTo(e);
|
||||
this.ProgressBar.Visibility = System.Windows.Visibility.Visible;
|
||||
|
||||
if (this.Orientation.Equals(PageOrientation.Landscape) || this.Orientation.Equals(PageOrientation.LandscapeLeft) || this.Orientation.Equals(PageOrientation.LandscapeRight))
|
||||
{
|
||||
ApplicationBar.Mode = Microsoft.Phone.Shell.ApplicationBarMode.Default;
|
||||
}
|
||||
this.InitializeFeed();
|
||||
}
|
||||
|
||||
@@ -204,7 +210,7 @@ namespace CampusAppWP8.Pages.Mensa
|
||||
private void FeedIsReady()
|
||||
{
|
||||
this.SetupMensaPivot();
|
||||
this.ProgressBar.Visibility = System.Windows.Visibility.Collapsed;
|
||||
this.DefHeader.ProgressVisibility = Visibility.Collapsed;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -222,7 +228,7 @@ namespace CampusAppWP8.Pages.Mensa
|
||||
private void FeedIsFailFile()
|
||||
{
|
||||
MessageBoxResult result = MessageBoxes.ShowMainModelErrorMessageBox(AppResources.MsgBox_ErrorMainModelLoadFile);
|
||||
this.ProgressBar.Visibility = System.Windows.Visibility.Collapsed;
|
||||
this.DefHeader.ProgressVisibility = Visibility.Collapsed;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -230,8 +236,9 @@ namespace CampusAppWP8.Pages.Mensa
|
||||
/// </summary>
|
||||
private void SetupMensaPivot()
|
||||
{
|
||||
this.MensaPivot.Title = AppResources.MensaApp_Title + " (" + this.feed.Title + ")";
|
||||
this.DefHeader.HeaderName = AppResources.MensaApp_Title + ": " + this.feed.Title;
|
||||
this.CreatesMealIcons();
|
||||
this.feed.Model.SetHolidayCaption(AppResources.MensaApp_CloseMensa);
|
||||
this.MensaPivot.ItemsSource = this.feed.Model.Menus;
|
||||
this.MensaPivot.SelectedIndex = this.selectedIndex;
|
||||
}
|
||||
@@ -322,7 +329,7 @@ namespace CampusAppWP8.Pages.Mensa
|
||||
/// <param name="e">event args</param>
|
||||
private void MensaForceUpdate_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.ProgressBar.Visibility = System.Windows.Visibility.Visible;
|
||||
this.DefHeader.ProgressVisibility = Visibility.Visible;
|
||||
this.forceLoad = true;
|
||||
this.InitializeFeed();
|
||||
this.refreshed = true;
|
||||
@@ -334,7 +341,7 @@ namespace CampusAppWP8.Pages.Mensa
|
||||
/// <param name="e"> Event information.</param>
|
||||
private void ApplicationBarMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.ProgressBar.Visibility = System.Windows.Visibility.Visible;
|
||||
this.DefHeader.ProgressVisibility = Visibility.Visible;
|
||||
this.InitializeFeed(CampusAppWPortalLib8.Model.Settings.Campus.CB_MAIN);
|
||||
}
|
||||
|
||||
@@ -344,7 +351,7 @@ namespace CampusAppWP8.Pages.Mensa
|
||||
/// <param name="e"> Event information.</param>
|
||||
private void ApplicationBarMenuItem2_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.ProgressBar.Visibility = System.Windows.Visibility.Visible;
|
||||
this.DefHeader.ProgressVisibility = Visibility.Visible;
|
||||
this.InitializeFeed(CampusAppWPortalLib8.Model.Settings.Campus.CB_SOUTH);
|
||||
}
|
||||
|
||||
@@ -354,12 +361,40 @@ namespace CampusAppWP8.Pages.Mensa
|
||||
/// <param name="e"> Event information.</param>
|
||||
private void ApplicationBarMenuItem3_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.ProgressBar.Visibility = System.Windows.Visibility.Visible;
|
||||
this.DefHeader.ProgressVisibility = Visibility.Visible;
|
||||
this.InitializeFeed(CampusAppWPortalLib8.Model.Settings.Campus.SFB_MAIN);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method handle OrientationPage
|
||||
/// </summary>
|
||||
/// <param name="sender">Caller of the function</param>
|
||||
/// <param name="e">some EventArgs</param>
|
||||
private void PhoneApplicationPage_OrientationChanged(object sender, OrientationChangedEventArgs e)
|
||||
{
|
||||
if (this.Orientation == PageOrientation.LandscapeLeft || this.Orientation == PageOrientation.LandscapeRight)
|
||||
{
|
||||
ApplicationBar.Mode = Microsoft.Phone.Shell.ApplicationBarMode.Default;
|
||||
}
|
||||
else
|
||||
{
|
||||
ApplicationBar.Mode = Microsoft.Phone.Shell.ApplicationBarMode.Minimized;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private void MenuItem_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
FrameworkElement frameelement = sender as FrameworkElement;
|
||||
if (frameelement == null)
|
||||
{
|
||||
|
||||
}
|
||||
string copyText = frameelement.Tag.ToString() + " (" + AppResources.Setting_UserCampus + " " + this.feed.Title + ")";
|
||||
Clipboard.SetText(copyText);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -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 @@
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<ProgressBar x:Name="progressBar" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Center" Visibility="Collapsed" IsIndeterminate="True"/>
|
||||
<!-- Title and headline -->
|
||||
<header:DefaultHeader x:Name="DefHeader" Grid.Row="0" HeaderName="{Binding Path=LocalizedResources.NewsApp_Title, Source={StaticResource LocalizedStrings}}"/>
|
||||
<!--
|
||||
<StackPanel Grid.Row="0" Margin="12,17,0,28">
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.ApplicationTitle, Source={StaticResource LocalizedStrings}}" Style="{StaticResource PhoneTextNormalStyle}"/>
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.NewsApp_Title, Source={StaticResource LocalizedStrings}}" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
|
||||
</StackPanel>
|
||||
-->
|
||||
<!-- Content -->
|
||||
<ListBox x:Name="NewsList" Grid.Row="1">
|
||||
<ListBox x:Name="NewsList" Grid.Row="1" Margin="12,0,12,0">
|
||||
<ListBox.ItemContainerStyle>
|
||||
<Style TargetType="ListBoxItem">
|
||||
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
|
||||
@@ -37,11 +40,17 @@
|
||||
</ListBox.ItemContainerStyle>
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Border BorderBrush="{StaticResource PhoneContrastBackgroundBrush}" Style="{StaticResource ListButtonBorder}">
|
||||
<lui:NavigateButton Name="NewsItem" QuerryStringValue="{Binding Index}" Url="{Binding Path=Constants.PathNews_NewsPage, Source={StaticResource Const}}" QuerryStringName="{Binding Path=Constants.ParamPivotIndex, Source={StaticResource Const}}" Style="{StaticResource ListButtonNoneBorder}" HorizontalContentAlignment="Left">
|
||||
<TextBlock TextWrapping="Wrap" Text="{Binding Title}" />
|
||||
</lui:NavigateButton>
|
||||
</Border>
|
||||
<lui:NavigateButton Name="NewsItem" QuerryStringValue="{Binding Index}" Url="{Binding Path=Constants.PathNews_NewsPage, Source={StaticResource Const}}" QuerryStringName="{Binding Path=Constants.ParamPivotIndex, Source={StaticResource Const}}" Style="{StaticResource ListButtonStyle}" HorizontalContentAlignment="Left">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<TextBlock Grid.Column="0" TextWrapping="NoWrap" Text="{Binding ShortDate}" Margin="-8, 0, 10, 0"/>
|
||||
<TextBlock Grid.Column="1" TextWrapping="Wrap" Text="{Binding Title}" />
|
||||
</Grid>
|
||||
</lui:NavigateButton>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace CampusAppWP8.Pages.News
|
||||
public NewsIndexPage()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
this.progressBar.Visibility = Visibility.Collapsed;
|
||||
this.DefHeader.ProgressVisibility = Visibility.Collapsed;
|
||||
|
||||
ApplicationBarIconButton updateBtn = new ApplicationBarIconButton();
|
||||
updateBtn.IconUri = new Uri(Icons.Update, UriKind.Relative);
|
||||
@@ -104,6 +104,11 @@ namespace CampusAppWP8.Pages.News
|
||||
protected override void OnNavigatedTo(NavigationEventArgs e)
|
||||
{
|
||||
base.OnNavigatedTo(e);
|
||||
|
||||
if (this.Orientation.Equals(PageOrientation.Landscape) || this.Orientation.Equals(PageOrientation.LandscapeLeft) || this.Orientation.Equals(PageOrientation.LandscapeRight))
|
||||
{
|
||||
ApplicationBar.Mode = Microsoft.Phone.Shell.ApplicationBarMode.Default;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -125,6 +130,26 @@ namespace CampusAppWP8.Pages.News
|
||||
|
||||
#region private
|
||||
|
||||
/// <summary>
|
||||
/// Methods overrides the OnOrientationChanged-Method.
|
||||
/// </summary>
|
||||
/// <param name="e">orientation changed event args.</param>
|
||||
protected override void OnOrientationChanged(OrientationChangedEventArgs e)
|
||||
{
|
||||
if (e.Orientation == PageOrientation.LandscapeRight
|
||||
|| e.Orientation == PageOrientation.LandscapeLeft
|
||||
|| e.Orientation == PageOrientation.Landscape)
|
||||
{
|
||||
ApplicationBar.Mode = ApplicationBarMode.Default;
|
||||
}
|
||||
else
|
||||
{
|
||||
ApplicationBar.Mode = ApplicationBarMode.Minimized;
|
||||
}
|
||||
|
||||
base.OnOrientationChanged(e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Is called after the RSS feeds are loaded into the newsFeed model.
|
||||
/// If there was no feed information set to the UI, the feed list
|
||||
@@ -132,8 +157,9 @@ namespace CampusAppWP8.Pages.News
|
||||
/// </summary>
|
||||
private void SetupNewsPageList()
|
||||
{
|
||||
NewsIndexPage.newsFeed.Model.Channel[0].OrderByDate();
|
||||
this.NewsList.ItemsSource = NewsIndexPage.newsFeed.Model.Channel[0].Item;
|
||||
this.progressBar.Visibility = Visibility.Collapsed;
|
||||
this.DefHeader.ProgressVisibility = Visibility.Collapsed;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -144,7 +170,7 @@ namespace CampusAppWP8.Pages.News
|
||||
/// <param name="e">event args</param>
|
||||
private void NewsForceUpdate_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.progressBar.Visibility = Visibility.Visible;
|
||||
this.DefHeader.ProgressVisibility = Visibility.Visible;
|
||||
NewsIndexPage.newsFeed.ForceWebUpdate();
|
||||
}
|
||||
|
||||
@@ -162,7 +188,7 @@ namespace CampusAppWP8.Pages.News
|
||||
/// </summary>
|
||||
private void FeedIsFailFile()
|
||||
{
|
||||
this.progressBar.Visibility = Visibility.Collapsed;
|
||||
this.DefHeader.ProgressVisibility = Visibility.Collapsed;
|
||||
MessageBoxResult result = MessageBoxes.ShowMainModelErrorMessageBox(AppResources.MsgBox_ErrorMainModelLoadFile);
|
||||
}
|
||||
|
||||
|
||||
@@ -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"
|
||||
mc:Ignorable="d"
|
||||
FontFamily="{StaticResource PhoneFontFamilyNormal}"
|
||||
FontSize="{StaticResource PhoneFontSizeNormal}"
|
||||
@@ -14,14 +15,20 @@
|
||||
shell:SystemTray.IsVisible="True">
|
||||
<!-- LayoutRoot -->
|
||||
<Grid x:Name="LayoutRoot" Background="Transparent">
|
||||
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!--header-->
|
||||
<header:DefaultHeader x:Name="DefHeader" Grid.Row="0" HeaderName="{Binding Path=LocalizedResources.NewsApp_Title, Source={StaticResource LocalizedStrings}}"/>
|
||||
|
||||
<!-- Pivotpage -->
|
||||
<ProgressBar x:Name="progressBar" VerticalAlignment="Center" HorizontalAlignment="Center" Visibility="Collapsed" IsIndeterminate="True"/>
|
||||
<phone:Pivot x:Name="NewsPivot" Title="{Binding Path=LocalizedResources.ApplicationTitle, Source={StaticResource LocalizedStrings}}" SelectionChanged="OnPivotSelectionChange">
|
||||
<phone:Pivot x:Name="NewsPivot" Grid.Row="1" SelectionChanged="OnPivotSelectionChange">
|
||||
<!-- Pivotitem template -->
|
||||
<phone:Pivot.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Path=Date, Mode=OneWay}" />
|
||||
<TextBlock Text="{Binding Path=Date, Mode=OneWay}" Margin="0,-36,0,0"/>
|
||||
</DataTemplate>
|
||||
</phone:Pivot.HeaderTemplate>
|
||||
<phone:Pivot.ItemTemplate>
|
||||
@@ -31,19 +38,19 @@
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Grid x:Name="NewsTextGrid" Grid.Row="0">
|
||||
<Grid x:Name="NewsTextGrid" Grid.Row="0" Visibility="{Binding Path=TextVisibility, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}}">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="100" />
|
||||
<RowDefinition Height="Auto" MaxHeight="300"/>
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock x:Name="NewsHeadline" Text="{Binding Path=Title, Mode=OneWay}" Grid.Row="0" Height="Auto" TextWrapping="Wrap" VerticalAlignment="Center" HorizontalAlignment="Left" FontSize="42"/>
|
||||
<TextBlock x:Name="NewsHeadline" Text="{Binding Path=Title, Mode=OneWay}" Grid.Row="0" Height="Auto" TextWrapping="Wrap" VerticalAlignment="Top" HorizontalAlignment="Left" Style="{StaticResource PhoneTextTitle2Style}"/>
|
||||
<ScrollViewer Grid.Row="1">
|
||||
<TextBlock x:Name="NewsText" Text="{Binding Path=Text, Mode=OneWay}" Height="Auto" TextWrapping="Wrap" VerticalAlignment="Center" HorizontalAlignment="Left" FontSize="24" />
|
||||
<TextBlock x:Name="NewsText" Text="{Binding Path=Text, Mode=OneWay}" Height="Auto" TextWrapping="Wrap" VerticalAlignment="Center" HorizontalAlignment="Left" Style="{StaticResource PhoneTextNormalStyle}" />
|
||||
</ScrollViewer>
|
||||
</Grid>
|
||||
|
||||
<phone:WebBrowser x:Name="NewsWebBrowser" Source="{Binding Path=Link, Mode=OneWay}" Grid.Row="0" IsScriptEnabled="True" Visibility="Collapsed"/>
|
||||
<phone:WebBrowser x:Name="NewsWebBrowser" Source="{Binding Path=Link, Mode=OneWay}" Grid.Row="0" IsScriptEnabled="True" Visibility="{Binding Path=BrowserVisibility, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}}"/>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</phone:Pivot.ItemTemplate>
|
||||
|
||||
@@ -30,11 +30,6 @@ namespace CampusAppWP8.Pages.News
|
||||
/// </summary>
|
||||
private bool isSourceSet = false;
|
||||
|
||||
/// <summary>
|
||||
/// To store the index of the last selected PivotItem.
|
||||
/// </summary>
|
||||
private int lastSelectedIndex = -1;
|
||||
|
||||
/// <summary>
|
||||
/// For checking if the instance is back from tombstone.
|
||||
/// </summary>
|
||||
@@ -80,7 +75,13 @@ namespace CampusAppWP8.Pages.News
|
||||
protected override void OnNavigatedTo(NavigationEventArgs e)
|
||||
{
|
||||
base.OnNavigatedTo(e);
|
||||
this.progressBar.Visibility = Visibility.Visible;
|
||||
|
||||
if (this.Orientation.Equals(PageOrientation.Landscape) || this.Orientation.Equals(PageOrientation.LandscapeLeft) || this.Orientation.Equals(PageOrientation.LandscapeRight))
|
||||
{
|
||||
ApplicationBar.Mode = Microsoft.Phone.Shell.ApplicationBarMode.Default;
|
||||
}
|
||||
|
||||
this.DefHeader.ProgressVisibility = Visibility.Visible;
|
||||
|
||||
if (this.isNewInstance)
|
||||
{
|
||||
@@ -128,7 +129,7 @@ namespace CampusAppWP8.Pages.News
|
||||
}
|
||||
}
|
||||
|
||||
this.progressBar.Visibility = Visibility.Collapsed;
|
||||
this.DefHeader.ProgressVisibility = Visibility.Collapsed;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -150,6 +151,24 @@ namespace CampusAppWP8.Pages.News
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
protected override void OnOrientationChanged(OrientationChangedEventArgs e)
|
||||
{
|
||||
if (e.Orientation == PageOrientation.Landscape
|
||||
|| e.Orientation == PageOrientation.LandscapeLeft
|
||||
|| e.Orientation == PageOrientation.LandscapeRight)
|
||||
{
|
||||
ApplicationBar.Mode = ApplicationBarMode.Default;
|
||||
}
|
||||
else
|
||||
{
|
||||
ApplicationBar.Mode = ApplicationBarMode.Minimized;
|
||||
}
|
||||
|
||||
base.OnOrientationChanged(e);
|
||||
}
|
||||
*/
|
||||
|
||||
/// <summary>
|
||||
/// Called when the index of the selected PivotItem is changed.
|
||||
/// Set the text Grid to visible and the WebBrowser to collapsed.
|
||||
@@ -158,15 +177,15 @@ namespace CampusAppWP8.Pages.News
|
||||
/// <param name="e">event args</param>
|
||||
private void OnPivotSelectionChange(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
int selIndex = (sender as Pivot).SelectedIndex;
|
||||
|
||||
if (this.lastSelectedIndex > -1)
|
||||
if (e.RemovedItems.Count > 0)
|
||||
{
|
||||
Utilities.SetElementVisibility(this.NewsPivot, "NewsParentGrid", "NewsWebBrowser", Visibility.Collapsed, this.lastSelectedIndex);
|
||||
Utilities.SetElementVisibility(this.NewsPivot, "NewsParentGrid", "NewsTextGrid", Visibility.Visible, this.lastSelectedIndex);
|
||||
}
|
||||
RSSModel last = e.RemovedItems[0] as RSSModel;
|
||||
|
||||
this.lastSelectedIndex = selIndex;
|
||||
if (last != null && last.TextVisibility == false)
|
||||
{
|
||||
last.TextVisibility = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -178,15 +197,13 @@ namespace CampusAppWP8.Pages.News
|
||||
/// <param name="e">event args</param>
|
||||
private void NewsLink_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (Visibility.Visible == Utilities.GetElementVisibility(this.NewsPivot, "NewsParentGrid", "NewsTextGrid", this.NewsPivot.SelectedIndex))
|
||||
RSSModel cur = this.NewsPivot.SelectedItem as RSSModel;
|
||||
|
||||
this.NewsPivot.UpdateLayout();
|
||||
|
||||
if (cur != null)
|
||||
{
|
||||
Utilities.SetElementVisibility(this.NewsPivot, "NewsParentGrid", "NewsTextGrid", Visibility.Collapsed, this.NewsPivot.SelectedIndex);
|
||||
Utilities.SetElementVisibility(this.NewsPivot, "NewsParentGrid", "NewsWebBrowser", Visibility.Visible, this.NewsPivot.SelectedIndex);
|
||||
}
|
||||
else
|
||||
{
|
||||
Utilities.SetElementVisibility(this.NewsPivot, "NewsParentGrid", "NewsWebBrowser", Visibility.Collapsed, this.NewsPivot.SelectedIndex);
|
||||
Utilities.SetElementVisibility(this.NewsPivot, "NewsParentGrid", "NewsTextGrid", Visibility.Visible, this.NewsPivot.SelectedIndex);
|
||||
cur.TextVisibility = (cur.TextVisibility) ? false : true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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,11 @@
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<ProgressBar x:Name="progressBar" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Center" Visibility="Collapsed" IsIndeterminate="True"/>
|
||||
<!-- Title and headline -->
|
||||
<StackPanel Grid.Row="0" Margin="12,17,0,28">
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.ApplicationTitle, Source={StaticResource LocalizedStrings}}" Style="{StaticResource PhoneTextNormalStyle}"/>
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.OpenHoursApp_Title, Source={StaticResource LocalizedStrings}}" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}" FontSize="64"/>
|
||||
</StackPanel>
|
||||
<!--header-->
|
||||
<header:DefaultHeader x:Name="DefHeader" Grid.Row="0" HeaderName="{Binding Path=LocalizedResources.OpenHoursApp_Title, Source={StaticResource LocalizedStrings}}"/>
|
||||
|
||||
<!-- Content -->
|
||||
<ListBox x:Name="InstitutionPanel" Grid.Row="1">
|
||||
<ListBox x:Name="InstitutionPanel" Grid.Row="1" SelectionMode="Single" SelectionChanged="InstitutionPanel_SelectionChanged">
|
||||
<ListBox.ItemContainerStyle>
|
||||
<Style TargetType="ListBoxItem">
|
||||
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
|
||||
@@ -37,91 +35,93 @@
|
||||
</ListBox.ItemContainerStyle>
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel>
|
||||
<lui:ToggleButton Content="{Binding Title}" ToggleContentTag="{Binding Path=Constants.ToggleContent, Source={StaticResource Const}}" Style="{StaticResource ListButtonStyle}"/>
|
||||
<StackPanel Visibility="Collapsed" Tag="{Binding Path=Constants.ToggleContent, Source={StaticResource Const}}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<!--day-->
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<!--time-->
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<!--monday-->
|
||||
<RowDefinition Height="auto"/>
|
||||
<!--tuesday-->
|
||||
<RowDefinition Height="auto"/>
|
||||
<!--wednesday-->
|
||||
<RowDefinition Height="auto"/>
|
||||
<!--thursday-->
|
||||
<RowDefinition Height="auto"/>
|
||||
<!--friday-->
|
||||
<RowDefinition Height="auto"/>
|
||||
<!--saturday-->
|
||||
<RowDefinition Height="auto"/>
|
||||
<!--sunday-->
|
||||
<RowDefinition Height="auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Border BorderBrush="{StaticResource PhoneContrastBackgroundBrush}" Style="{StaticResource ListButtonBorder}">
|
||||
<StackPanel Margin="12,0,12,0">
|
||||
<lui:ToggleButton Content="{Binding Title}" ToggleContentTag="{Binding Path=Constants.ToggleContent, Source={StaticResource Const}}" Style="{StaticResource ListButtonNoneBorder}"/>
|
||||
<StackPanel Visibility="Collapsed" Tag="{Binding Path=Constants.ToggleContent, Source={StaticResource Const}}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<!--day-->
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<!--time-->
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<!--monday-->
|
||||
<RowDefinition Height="auto"/>
|
||||
<!--tuesday-->
|
||||
<RowDefinition Height="auto"/>
|
||||
<!--wednesday-->
|
||||
<RowDefinition Height="auto"/>
|
||||
<!--thursday-->
|
||||
<RowDefinition Height="auto"/>
|
||||
<!--friday-->
|
||||
<RowDefinition Height="auto"/>
|
||||
<!--saturday-->
|
||||
<RowDefinition Height="auto"/>
|
||||
<!--sunday-->
|
||||
<RowDefinition Height="auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!--row 0 monday-->
|
||||
<TextBlock Grid.Row="0" Grid.Column="0" Text="{Binding Path=LocalizedResources.Time_Day_Monday, Source={StaticResource LocalizedStrings}}" FontWeight="Bold" Visibility="{Binding VisibleMonday}" Padding="10,3,10,0"/>
|
||||
<TextBlock Grid.Row="0" Grid.Column="1" Text="{Binding Monday}" Visibility="{Binding VisibleMonday}" HorizontalAlignment="Left"/>
|
||||
<!--row 1 tuesday-->
|
||||
<TextBlock Grid.Row="1" Grid.Column="0" Text="{Binding Path=LocalizedResources.Time_Day_Tuesday, Source={StaticResource LocalizedStrings}}" FontWeight="Bold" Visibility="{Binding VisibleTuesday}" Padding="10,3,10,0"/>
|
||||
<TextBlock Grid.Row="1" Grid.Column="1" Text="{Binding Tuesday}" Visibility="{Binding VisibleTuesday}" HorizontalAlignment="Left"/>
|
||||
<!--row 2 wednesday-->
|
||||
<TextBlock Grid.Row="2" Grid.Column="0" Text="{Binding Path=LocalizedResources.Time_Day_Wednesday, Source={StaticResource LocalizedStrings}}" FontWeight="Bold" Visibility="{Binding VisibleWednesday}" Padding="10,3,10,0"/>
|
||||
<TextBlock Grid.Row="2" Grid.Column="1" Text="{Binding Wednesday}" Visibility="{Binding VisibleWednesday}" HorizontalAlignment="Left"/>
|
||||
<!--row 3 thursday-->
|
||||
<TextBlock Grid.Row="3" Grid.Column="0" Text="{Binding Path=LocalizedResources.Time_Day_Thursday, Source={StaticResource LocalizedStrings}}" FontWeight="Bold" Visibility="{Binding VisibleThursday}" Padding="10,3,10,0"/>
|
||||
<TextBlock Grid.Row="3" Grid.Column="1" Text="{Binding Thursday}" Visibility="{Binding VisibleThursday}" HorizontalAlignment="Left"/>
|
||||
<!--row 4 friday-->
|
||||
<TextBlock Grid.Row="4" Grid.Column="0" Text="{Binding Path=LocalizedResources.Time_Day_Friday, Source={StaticResource LocalizedStrings}}" FontWeight="Bold" Visibility="{Binding VisibleFriday}" Padding="10,3,10,0"/>
|
||||
<TextBlock Grid.Row="4" Grid.Column="1" Text="{Binding Friday}" Visibility="{Binding VisibleFriday}" HorizontalAlignment="Left"/>
|
||||
<!--row 5 saturday-->
|
||||
<TextBlock Grid.Row="5" Grid.Column="0" Text="{Binding Path=LocalizedResources.Time_Day_Saturday, Source={StaticResource LocalizedStrings}}" FontWeight="Bold" Visibility="{Binding VisibleSaturday}" Padding="10,3,10,0"/>
|
||||
<TextBlock Grid.Row="5" Grid.Column="1" Text="{Binding Saturday}" Visibility="{Binding VisibleSaturday}" HorizontalAlignment="Left"/>
|
||||
<!--row 6 sunday-->
|
||||
<TextBlock Grid.Row="6" Grid.Column="0" Text="{Binding Path=LocalizedResources.Time_Day_Sunday, Source={StaticResource LocalizedStrings}}" FontWeight="Bold" Visibility="{Binding VisibleSunday}" Padding="10,3,10,0"/>
|
||||
<TextBlock Grid.Row="6" Grid.Column="1" Text="{Binding Sunday}" Visibility="{Binding VisibleSunday}" HorizontalAlignment="Left"/>
|
||||
</Grid>
|
||||
<Grid Margin="0,12,0,0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<!--row 0 monday-->
|
||||
<TextBlock Grid.Row="0" Grid.Column="0" Text="{Binding Path=LocalizedResources.Time_Day_Monday, Source={StaticResource LocalizedStrings}}" FontWeight="Bold" Visibility="{Binding VisibleMonday}" Padding="10,3,10,0"/>
|
||||
<TextBlock Grid.Row="0" Grid.Column="1" Text="{Binding Monday}" Visibility="{Binding VisibleMonday}" HorizontalAlignment="Left"/>
|
||||
<!--row 1 tuesday-->
|
||||
<TextBlock Grid.Row="1" Grid.Column="0" Text="{Binding Path=LocalizedResources.Time_Day_Tuesday, Source={StaticResource LocalizedStrings}}" FontWeight="Bold" Visibility="{Binding VisibleTuesday}" Padding="10,3,10,0"/>
|
||||
<TextBlock Grid.Row="1" Grid.Column="1" Text="{Binding Tuesday}" Visibility="{Binding VisibleTuesday}" HorizontalAlignment="Left"/>
|
||||
<!--row 2 wednesday-->
|
||||
<TextBlock Grid.Row="2" Grid.Column="0" Text="{Binding Path=LocalizedResources.Time_Day_Wednesday, Source={StaticResource LocalizedStrings}}" FontWeight="Bold" Visibility="{Binding VisibleWednesday}" Padding="10,3,10,0"/>
|
||||
<TextBlock Grid.Row="2" Grid.Column="1" Text="{Binding Wednesday}" Visibility="{Binding VisibleWednesday}" HorizontalAlignment="Left"/>
|
||||
<!--row 3 thursday-->
|
||||
<TextBlock Grid.Row="3" Grid.Column="0" Text="{Binding Path=LocalizedResources.Time_Day_Thursday, Source={StaticResource LocalizedStrings}}" FontWeight="Bold" Visibility="{Binding VisibleThursday}" Padding="10,3,10,0"/>
|
||||
<TextBlock Grid.Row="3" Grid.Column="1" Text="{Binding Thursday}" Visibility="{Binding VisibleThursday}" HorizontalAlignment="Left"/>
|
||||
<!--row 4 friday-->
|
||||
<TextBlock Grid.Row="4" Grid.Column="0" Text="{Binding Path=LocalizedResources.Time_Day_Friday, Source={StaticResource LocalizedStrings}}" FontWeight="Bold" Visibility="{Binding VisibleFriday}" Padding="10,3,10,0"/>
|
||||
<TextBlock Grid.Row="4" Grid.Column="1" Text="{Binding Friday}" Visibility="{Binding VisibleFriday}" HorizontalAlignment="Left"/>
|
||||
<!--row 5 saturday-->
|
||||
<TextBlock Grid.Row="5" Grid.Column="0" Text="{Binding Path=LocalizedResources.Time_Day_Saturday, Source={StaticResource LocalizedStrings}}" FontWeight="Bold" Visibility="{Binding VisibleSaturday}" Padding="10,3,10,0"/>
|
||||
<TextBlock Grid.Row="5" Grid.Column="1" Text="{Binding Saturday}" Visibility="{Binding VisibleSaturday}" HorizontalAlignment="Left"/>
|
||||
<!--row 6 sunday-->
|
||||
<TextBlock Grid.Row="6" Grid.Column="0" Text="{Binding Path=LocalizedResources.Time_Day_Sunday, Source={StaticResource LocalizedStrings}}" FontWeight="Bold" Visibility="{Binding VisibleSunday}" Padding="10,3,10,0"/>
|
||||
<TextBlock Grid.Row="6" Grid.Column="1" Text="{Binding Sunday}" Visibility="{Binding VisibleSunday}" HorizontalAlignment="Left"/>
|
||||
</Grid>
|
||||
<Grid Margin="0,12,0,0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!--building-->
|
||||
<TextBlock Grid.Row="0" Grid.Column="0" Text="{Binding Path=LocalizedResources.Building, Source={StaticResource LocalizedStrings}}" Visibility="{Binding VisibleBuilding}" Padding="10,3,10,0"/>
|
||||
<TextBlock Grid.Row="0" Grid.Column="1" Text="{Binding Building}" Visibility="{Binding VisibleBuilding}" HorizontalAlignment="Left" Padding="10,3,10,0"/>
|
||||
<!--room-->
|
||||
<TextBlock Grid.Row="1" Grid.Column="0" Text="{Binding Path=LocalizedResources.Room, Source={StaticResource LocalizedStrings}}" Visibility="{Binding VisibleRoom}" Padding="10,3,10,0"/>
|
||||
<TextBlock Grid.Row="1" Grid.Column="1" Text="{Binding Room}" Visibility="{Binding VisibleRoom}" HorizontalAlignment="Left" Padding="10,3,10,0"/>
|
||||
</Grid>
|
||||
<!--hint text-->
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.Hint, Source={StaticResource LocalizedStrings}}" Visibility="{Binding VisibleComment}" Padding="10,3,10,0" Margin="0,12,0,0" FontStyle="Italic"/>
|
||||
<TextBlock Text="{Binding Comment}" Visibility="{Binding VisibleComment}" TextWrapping="Wrap" Padding="10,3,10,0"/>
|
||||
<Grid Margin="0,6,0,0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<!--building-->
|
||||
<TextBlock Grid.Row="0" Grid.Column="0" Text="{Binding Path=LocalizedResources.Building, Source={StaticResource LocalizedStrings}}" Visibility="{Binding VisibleBuilding}" Padding="10,3,10,0"/>
|
||||
<TextBlock Grid.Row="0" Grid.Column="1" Text="{Binding Building}" Visibility="{Binding VisibleBuilding}" HorizontalAlignment="Left" Padding="10,3,10,0"/>
|
||||
<!--room-->
|
||||
<TextBlock Grid.Row="1" Grid.Column="0" Text="{Binding Path=LocalizedResources.Room, Source={StaticResource LocalizedStrings}}" Visibility="{Binding VisibleRoom}" Padding="10,3,10,0"/>
|
||||
<TextBlock Grid.Row="1" Grid.Column="1" Text="{Binding Room}" Visibility="{Binding VisibleRoom}" HorizontalAlignment="Left" Padding="10,3,10,0"/>
|
||||
</Grid>
|
||||
<!--hint text-->
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.Hint, Source={StaticResource LocalizedStrings}}" Visibility="{Binding VisibleComment}" Padding="10,3,10,0" Margin="0,12,0,0" FontStyle="Italic"/>
|
||||
<TextBlock Text="{Binding Comment}" Visibility="{Binding VisibleComment}" TextWrapping="Wrap" Padding="10,3,10,0"/>
|
||||
<Grid Margin="6,6,6,6">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!--mail button-->
|
||||
<lui:EmailButton Grid.Column="0" EmailAddress="{Binding EMail}" BorderBrush="Transparent" Background="Transparent" Height="100" Visibility="{Binding VisibleEMail}" Padding="0" Margin="-10"/>
|
||||
<!--phone button-->
|
||||
<lui:PhoneButton Grid.Column="1" Number="{Binding Phone}" DisplayName="{Binding Title}" BorderBrush="Transparent" Background="Transparent" Height="100" Visibility="{Binding VisiblePhone}" Padding="0" Margin="-10"/>
|
||||
<!--location button -->
|
||||
<lui:GoToMapButton Grid.Column="2" SearchTerm="{Binding Building}" BorderBrush="Transparent" Background="Transparent" Height="100" Visibility="{Binding VisibleBuilding}" Padding="0" Margin="-10" />
|
||||
</Grid>
|
||||
<!--mail button-->
|
||||
<lui:EmailButton Grid.Column="0" EmailAddress="{Binding EMail}" Height="100" Visibility="{Binding VisibleEMail}" Padding="0" Margin="0"/>
|
||||
<!--phone button-->
|
||||
<lui:PhoneButton Grid.Column="1" Number="{Binding Phone}" DisplayName="{Binding Title}" Height="100" Visibility="{Binding VisiblePhone}" Padding="0" Margin="0"/>
|
||||
<!--location button -->
|
||||
<lui:GoToMapButton Grid.Column="2" SearchTerm="{Binding Building}" Height="100" Visibility="{Binding VisibleBuilding}" Padding="0" Margin="0" />
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace CampusAppWP8.Pages.Openinghours
|
||||
public OpeninghoursPage()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
this.progressBar.Visibility = Visibility.Visible;
|
||||
this.DefHeader.ProgressVisibility = Visibility.Visible;
|
||||
|
||||
if (this.feed == null)
|
||||
{
|
||||
@@ -71,12 +71,12 @@ namespace CampusAppWP8.Pages.Openinghours
|
||||
protected override void OnNavigatedTo(NavigationEventArgs e)
|
||||
{
|
||||
base.OnNavigatedTo(e);
|
||||
/*
|
||||
if (e.NavigationMode != System.Windows.Navigation.NavigationMode.Back)
|
||||
{
|
||||
this.ProgressBar.Visibility = System.Windows.Visibility.Visible;
|
||||
}
|
||||
*/
|
||||
|
||||
if (this.Orientation.Equals(PageOrientation.Landscape) || this.Orientation.Equals(PageOrientation.LandscapeLeft) || this.Orientation.Equals(PageOrientation.LandscapeRight))
|
||||
{
|
||||
ApplicationBar.Mode = Microsoft.Phone.Shell.ApplicationBarMode.Default;
|
||||
}
|
||||
|
||||
if (this.isNewInstance)
|
||||
{
|
||||
if ((this.feed == null) || (this.feed.Model == null))
|
||||
@@ -108,6 +108,31 @@ namespace CampusAppWP8.Pages.Openinghours
|
||||
}
|
||||
}
|
||||
|
||||
private void OnTapGrid(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Override the OnOrientationChanged method.
|
||||
/// </summary>
|
||||
/// <param name="e">orientation changed event args.</param>
|
||||
protected override void OnOrientationChanged(OrientationChangedEventArgs e)
|
||||
{
|
||||
if (e.Orientation == PageOrientation.Landscape
|
||||
|| e.Orientation == PageOrientation.LandscapeLeft
|
||||
|| e.Orientation == PageOrientation.LandscapeRight)
|
||||
{
|
||||
ApplicationBar.Mode = Microsoft.Phone.Shell.ApplicationBarMode.Default;
|
||||
}
|
||||
else
|
||||
{
|
||||
ApplicationBar.Mode = Microsoft.Phone.Shell.ApplicationBarMode.Minimized;
|
||||
}
|
||||
|
||||
base.OnOrientationChanged(e);
|
||||
}
|
||||
|
||||
// protected
|
||||
#endregion
|
||||
|
||||
@@ -119,7 +144,7 @@ namespace CampusAppWP8.Pages.Openinghours
|
||||
private void FeedIsReady()
|
||||
{
|
||||
this.InstitutionPanel.ItemsSource = this.feed.Model.Institutions;
|
||||
this.progressBar.Visibility = Visibility.Collapsed;
|
||||
this.DefHeader.ProgressVisibility = Visibility.Collapsed;
|
||||
|
||||
// this.feed.SaveData(true);
|
||||
}
|
||||
@@ -132,7 +157,7 @@ namespace CampusAppWP8.Pages.Openinghours
|
||||
/// <param name="e">event args</param>
|
||||
private void OpenHoursForceUpdate_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.progressBar.Visibility = Visibility.Visible;
|
||||
this.DefHeader.ProgressVisibility = Visibility.Visible;
|
||||
this.feed.ForceWebUpdate();
|
||||
}
|
||||
|
||||
@@ -150,10 +175,20 @@ namespace CampusAppWP8.Pages.Openinghours
|
||||
/// </summary>
|
||||
private void FeedIsFailedFile()
|
||||
{
|
||||
this.progressBar.Visibility = Visibility.Collapsed;
|
||||
this.DefHeader.ProgressVisibility = Visibility.Collapsed;
|
||||
MessageBoxResult result = MessageBoxes.ShowMainModelErrorMessageBox(AppResources.MsgBox_ErrorMainModelLoadFile);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method will be execute if the selection is change in the listbox.
|
||||
/// </summary>
|
||||
/// <param name="sender">listbox object.</param>
|
||||
/// <param name="e">event args.</param>
|
||||
private void InstitutionPanel_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
|
||||
{
|
||||
this.InstitutionPanel.SelectedIndex = -1;
|
||||
}
|
||||
|
||||
// private
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -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,12 +22,9 @@
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<ProgressBar Name="ProgressBar" Grid.Row="1" Visibility="Collapsed" IsIndeterminate="True"/>
|
||||
|
||||
<!--TitlePanel enthält den Namen der Anwendung und den Seitentitel-->
|
||||
<StackPanel Grid.Row="0" Margin="12,17,0,28">
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.ApplicationTitle, Source={StaticResource LocalizedStrings}}" Style="{StaticResource PhoneTextNormalStyle}"/>
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.PersonApp_Header, Source={StaticResource LocalizedStrings}}" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle2Style}"/>
|
||||
<StackPanel Grid.Row="0">
|
||||
<header:DefaultHeader x:Name="DefHeader" HeaderName="{Binding Path=LocalizedResources.PersonApp_Header, Source={StaticResource LocalizedStrings}}"/>
|
||||
</StackPanel>
|
||||
|
||||
<!--ContentPanel - zusätzliche Inhalte hier platzieren-->
|
||||
@@ -36,7 +34,7 @@
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<StackPanel Orientation="Horizontal" Grid.Row="0">
|
||||
<StackPanel Orientation="Horizontal" Grid.Row="0" Margin="12,0,12,0">
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.PersonApp_SearchTextLabel, Source={StaticResource LocalizedStrings}}"/>
|
||||
<TextBlock Text=" : "/>
|
||||
</StackPanel>
|
||||
@@ -46,7 +44,7 @@
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBox Name="SearchName" AcceptsReturn="False" Grid.Column="0" InputScope="PersonalSurname"/>
|
||||
<TextBox Name="SearchName" AcceptsReturn="False" KeyDown="SearchName_KeyDown" Grid.Column="0" InputScope="PersonalSurname" VerticalAlignment="Center" />
|
||||
<Button Grid.Column="1" Click="SendRequest">
|
||||
<Image Source="{Binding Path=ThemelizedIcon.Search, Source={StaticResource ThemelizedIcons}}" Width="50"/>
|
||||
</Button>
|
||||
@@ -60,63 +58,65 @@
|
||||
</ListBox.ItemContainerStyle>
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel>
|
||||
<lui:ToggleButton ToggleContentTag="{Binding Path=Constants.ToggleContent, Source={StaticResource Const}}" Style="{StaticResource ListButtonStyle}">
|
||||
<TextBlock Text="{Binding FullName}" TextWrapping="Wrap"/>
|
||||
</lui:ToggleButton>
|
||||
<StackPanel Tag="{Binding Path=Constants.ToggleContent, Source={StaticResource Const}}" Visibility="Collapsed">
|
||||
<ListBox ItemsSource="{Binding Functions}">
|
||||
<ListBox.ItemContainerStyle>
|
||||
<Style TargetType="ListBoxItem">
|
||||
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch"/>
|
||||
</Style>
|
||||
</ListBox.ItemContainerStyle>
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Border BorderBrush="{StaticResource PhoneBorderBrush}" BorderThickness="0,0,0,1" >
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition Height="auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Border BorderBrush="{StaticResource PhoneContrastBackgroundBrush}" Style="{StaticResource ListButtonBorder}">
|
||||
<StackPanel>
|
||||
<lui:ToggleButton ToggleContentTag="{Binding Path=Constants.ToggleContent, Source={StaticResource Const}}" Style="{StaticResource ListButtonNoneBorder}">
|
||||
<TextBlock Text="{Binding FullName}" TextWrapping="Wrap"/>
|
||||
</lui:ToggleButton>
|
||||
<StackPanel Tag="{Binding Path=Constants.ToggleContent, Source={StaticResource Const}}" Visibility="Collapsed">
|
||||
<ListBox ItemsSource="{Binding Functions}" ScrollViewer.VerticalScrollBarVisibility="Disabled" SelectionMode="Single" SelectionChanged="Box_SelectionChanged">
|
||||
<ListBox.ItemContainerStyle>
|
||||
<Style TargetType="ListBoxItem">
|
||||
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch"/>
|
||||
</Style>
|
||||
</ListBox.ItemContainerStyle>
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Border BorderBrush="{StaticResource PhoneBorderBrush}" BorderThickness="0,0,0,1" >
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition Height="auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<StackPanel Orientation="Horizontal" Grid.Row="0" Grid.Column="0">
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.PersonApp_FunctionName, Source={StaticResource LocalizedStrings}}" />
|
||||
<TextBlock Text=" : "/>
|
||||
</StackPanel>
|
||||
<TextBlock Text="{Binding Function}" Grid.Row="0" Grid.Column="1" TextWrapping="Wrap"/>
|
||||
<StackPanel Orientation="Horizontal" Grid.Row="0" Grid.Column="0">
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.PersonApp_FunctionName, Source={StaticResource LocalizedStrings}}" />
|
||||
<TextBlock Text=" : "/>
|
||||
</StackPanel>
|
||||
<TextBlock Text="{Binding Function}" Grid.Row="0" Grid.Column="1" TextWrapping="Wrap"/>
|
||||
|
||||
<StackPanel Orientation="Horizontal" Grid.Row="1" Grid.Column="0">
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.PersonApp_Appointment, Source={StaticResource LocalizedStrings}}"/>
|
||||
<TextBlock Text=" : "/>
|
||||
</StackPanel>
|
||||
<TextBlock Text="{Binding Appointment}" Grid.Row="1" Grid.Column="1" TextWrapping="Wrap"/>
|
||||
<StackPanel Orientation="Horizontal" Grid.Row="1" Grid.Column="0">
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.PersonApp_Appointment, Source={StaticResource LocalizedStrings}}"/>
|
||||
<TextBlock Text=" : "/>
|
||||
</StackPanel>
|
||||
<TextBlock Text="{Binding Appointment}" Grid.Row="1" Grid.Column="1" TextWrapping="Wrap"/>
|
||||
|
||||
<StackPanel Orientation="Horizontal" Grid.Row="2" Grid.Column="0">
|
||||
<TextBlock Text ="{Binding Path=LocalizedResources.PersonApp_Building, Source={StaticResource LocalizedStrings}}" />
|
||||
<TextBlock Text=" : "/>
|
||||
</StackPanel>
|
||||
<TextBlock Text="{Binding Building}" Grid.Row="2" Grid.Column="1" TextWrapping="Wrap"/>
|
||||
<StackPanel Orientation="Horizontal" Grid.Row="2" Grid.Column="0">
|
||||
<TextBlock Text ="{Binding Path=LocalizedResources.PersonApp_Building, Source={StaticResource LocalizedStrings}}" />
|
||||
<TextBlock Text=" : "/>
|
||||
</StackPanel>
|
||||
<TextBlock Text="{Binding Building}" Grid.Row="2" Grid.Column="1" TextWrapping="Wrap"/>
|
||||
|
||||
<StackPanel Grid.Row="3" Grid.Column="1" Orientation="Horizontal">
|
||||
<lui:EmailButton EmailAddress="{Binding Mail}" Height="100" />
|
||||
<lui:PhoneButton Number="{Binding Tel1}" Height="100" />
|
||||
<lui:AddPersonButton Height="100" Click="Button_Click" PersonId="{Binding PersonID}" FunctionIndex="{Binding FunctionIndex}" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
<StackPanel Grid.Row="3" Grid.Column="1" Orientation="Horizontal" Margin="0,0,0,0">
|
||||
<lui:EmailButton EmailAddress="{Binding Mail}" Height="100" Margin="0,0,0,0" />
|
||||
<lui:PhoneButton Number="{Binding Tel1}" Height="100" Margin="0,0,0,0"/>
|
||||
<lui:AddPersonButton Height="100" Click="Button_Click" PersonId="{Binding PersonID}" FunctionIndex="{Binding FunctionIndex}" Margin="0,0,0,0"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
|
||||
namespace CampusAppWP8.Pages.Person
|
||||
{
|
||||
using System.Collections.Generic;
|
||||
using System.Windows;
|
||||
using System.Windows.Input;
|
||||
using CampusAppWP8.Api.Person;
|
||||
using CampusAppWP8.Model.Person;
|
||||
using CampusAppWP8.Resources;
|
||||
@@ -18,6 +18,8 @@ namespace CampusAppWP8.Pages.Person
|
||||
using CampusAppWPortalLib8.Model.Utility;
|
||||
using Microsoft.Phone.Controls;
|
||||
using Microsoft.Phone.Tasks;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows.Controls;
|
||||
|
||||
/// <summary>Person page.</summary>
|
||||
/// <remarks>Stubbfel, 09.09.2013.</remarks>
|
||||
@@ -58,7 +60,7 @@ namespace CampusAppWP8.Pages.Person
|
||||
this.api = new PersonSearchApi();
|
||||
this.api.OnLoaded += new PersonSearchApi.OnIO(this.ApiIsReady);
|
||||
this.api.OnFailedLoad += new PersonSearchApi.OnFailed(this.ApiIsFail);
|
||||
this.ProgressBar.Visibility = System.Windows.Visibility.Visible;
|
||||
this.DefHeader.ProgressVisibility = Visibility.Visible;
|
||||
List<UrlParamModel> parameterList = this.CreateUrlParameter(query);
|
||||
this.api.SetUriParams(parameterList);
|
||||
this.api.LoadData();
|
||||
@@ -80,7 +82,7 @@ namespace CampusAppWP8.Pages.Person
|
||||
private void ApiIsFail()
|
||||
{
|
||||
MessageBoxResult result = MessageBoxes.ShowMainModelErrorMessageBox(AppResources.MsgBox_ErrorMainModelLoad);
|
||||
this.ProgressBar.Visibility = Visibility.Collapsed;
|
||||
this.DefHeader.ProgressVisibility = Visibility.Collapsed;
|
||||
}
|
||||
|
||||
/// <summary>API is ready.</summary>
|
||||
@@ -88,7 +90,7 @@ namespace CampusAppWP8.Pages.Person
|
||||
private void ApiIsReady()
|
||||
{
|
||||
this.SetupResultBox();
|
||||
this.ProgressBar.Visibility = Visibility.Collapsed;
|
||||
this.DefHeader.ProgressVisibility = Visibility.Collapsed;
|
||||
}
|
||||
|
||||
/// <summary>Sets up the result box.</summary>
|
||||
@@ -97,6 +99,10 @@ namespace CampusAppWP8.Pages.Person
|
||||
{
|
||||
this.api.Model.RemoveNonFunctionAndSetIdsPerson();
|
||||
this.ResultBox.ItemsSource = this.api.Model.Persons;
|
||||
if (this.api.Model == null || this.api.Model.Persons == null || this.api.Model.Persons.Count < 1)
|
||||
{
|
||||
MessageBoxes.ShowMainModelInfoMessageBox(AppResources.MsgBox_NoResult);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Event handler. Called by Button for click events.</summary>
|
||||
@@ -138,6 +144,25 @@ namespace CampusAppWP8.Pages.Person
|
||||
saveContactTask.Show();
|
||||
}
|
||||
|
||||
private void SearchName_KeyDown(object sender, System.Windows.Input.KeyEventArgs e)
|
||||
{
|
||||
if (e.Key == Key.Enter)
|
||||
{
|
||||
this.SendRequest(sender,e);
|
||||
this.ResultBox.Focus();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method is called when the selection in the listbox is changed.
|
||||
/// </summary>
|
||||
/// <param name="sender">listbox object.</param>
|
||||
/// <param name="e">event args.</param>
|
||||
private void Box_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
|
||||
{
|
||||
(sender as ListBox).SelectedIndex = -1;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,7 @@
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
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}"
|
||||
@@ -22,14 +23,14 @@
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!--TitlePanel enthält den Namen der Anwendung und den Seitentitel-->
|
||||
<StackPanel Grid.Row="0" Margin="12,17,0,28">
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.ApplicationTitle, Source={StaticResource LocalizedStrings}}" Style="{StaticResource PhoneTextNormalStyle}"/>
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.Setting_App, Source={StaticResource LocalizedStrings}}" Style="{StaticResource PhoneTextTitle2Style}"/>
|
||||
<StackPanel Grid.Row="0">
|
||||
<header:DefaultHeader Name="DefHeader" HeaderName="{Binding Path=LocalizedResources.Setting_App, Source={StaticResource LocalizedStrings}}"/>
|
||||
</StackPanel>
|
||||
|
||||
<!--ContentPanel - zusätzliche Inhalte hier platzieren-->
|
||||
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
@@ -40,6 +41,25 @@
|
||||
<StackPanel Grid.Row="1">
|
||||
<toolkit:ToggleSwitch Name="OnlyWiFiToggle" Content="{Binding Path=LocalizedResources.Setting_AppOnlyWifi, Source={StaticResource LocalizedStrings}}"></toolkit:ToggleSwitch>
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Row="2">
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.Setting_TagHandler, Source={StaticResource LocalizedStrings}}"/>
|
||||
<toolkit:ListPicker Name="TagHandler" ExpansionMode="FullScreenOnly" FullModeHeader="{Binding Path=LocalizedResources.ListPickerHeaderTag, Source={StaticResource LocalizedStrings}}" >
|
||||
<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>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
|
||||
@@ -8,13 +8,18 @@
|
||||
namespace CampusAppWP8.Pages.Setting
|
||||
{
|
||||
using System.Windows.Navigation;
|
||||
using Microsoft.Phone.Controls;
|
||||
using Microsoft.Phone.Controls;
|
||||
using CampusApp8.Model.Setting;
|
||||
using System;
|
||||
|
||||
/// <summary>
|
||||
/// Class for the AppSettingPage
|
||||
/// </summary>
|
||||
public partial class AppSettingPage : PhoneApplicationPage
|
||||
{
|
||||
#region Member
|
||||
private TagHandlerListPickerItemListModel taghandlerModel;
|
||||
#endregion
|
||||
#region Constructor
|
||||
|
||||
/// <summary>
|
||||
@@ -23,8 +28,12 @@ namespace CampusAppWP8.Pages.Setting
|
||||
public AppSettingPage()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
GeoWatchToggle.IsChecked = Settings.AppSetting.GeoWatchEnable;
|
||||
OnlyWiFiToggle.IsChecked = Settings.AppSetting.OnlyWifi;
|
||||
this.GeoWatchToggle.IsChecked = Settings.AppSetting.GeoWatchEnable;
|
||||
this.OnlyWiFiToggle.IsChecked = Settings.AppSetting.OnlyWifi;
|
||||
this.taghandlerModel = new TagHandlerListPickerItemListModel();
|
||||
this.TagHandler.ItemsSource = this.taghandlerModel.List;
|
||||
int tagselIndex = this.taghandlerModel.GetIndexOrDefault(Settings.AppSetting.TagDefaultHandler.ToString());
|
||||
this.TagHandler.SelectedIndex = tagselIndex;
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -41,6 +50,7 @@ namespace CampusAppWP8.Pages.Setting
|
||||
{
|
||||
Settings.AppSetting.GeoWatchEnable = GeoWatchToggle.IsChecked.Value;
|
||||
Settings.AppSetting.OnlyWifi = OnlyWiFiToggle.IsChecked.Value;
|
||||
Settings.AppSetting.TagDefaultHandler = (CampusAppWP8.Model.Setting.AppSettings.BTUTagDefaultHandler)Enum.Parse(typeof(CampusAppWP8.Model.Setting.AppSettings.BTUTagDefaultHandler), ((CampusAppWPortalLib8.Model.Utility.ListPickerItemModel)this.TagHandler.SelectedItem).Value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
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}"
|
||||
@@ -22,12 +23,10 @@
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!--TitlePanel enthält den Namen der Anwendung und den Seitentitel-->
|
||||
<ProgressBar Name="ProgressBar" Grid.Row="1" Visibility="Collapsed" IsIndeterminate="True"/>
|
||||
|
||||
<StackPanel Grid.Row="0" Margin="12,17,0,28">
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.ApplicationTitle, Source={StaticResource LocalizedStrings}}" Style="{StaticResource PhoneTextNormalStyle}"/>
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.Setting_User, Source={StaticResource LocalizedStrings}}" Style="{StaticResource PhoneTextTitle2Style}"/>
|
||||
<StackPanel Grid.Row="0">
|
||||
<header:DefaultHeader Name="DefHeader" HeaderName="{Binding Path=LocalizedResources.Setting_User, Source={StaticResource LocalizedStrings}}"/>
|
||||
</StackPanel>
|
||||
|
||||
<ScrollViewer Grid.Row="1">
|
||||
<!--ContentPanel - zusätzliche Inhalte hier platzieren-->
|
||||
<Grid x:Name="ContentPanel" Margin="12,0,12,0">
|
||||
|
||||
@@ -71,7 +71,7 @@ namespace CampusAppWP8.Pages.Setting
|
||||
/// <remarks>Stubbfel, 10.09.2013.</remarks>
|
||||
private void LoadListPicker()
|
||||
{
|
||||
this.ProgressBar.Visibility = Visibility.Visible;
|
||||
this.DefHeader.ProgressVisibility = Visibility.Visible;
|
||||
this.courseList = new CourseListPickerItemListWp8Model();
|
||||
this.courseList.OnLoaded += new CourseListPickerItemListWp8Model.OnIO(this.SetupListPickers);
|
||||
this.courseList.LoadCourseList();
|
||||
@@ -98,7 +98,7 @@ namespace CampusAppWP8.Pages.Setting
|
||||
this.Semster.SelectedIndex = semesterList.GetIndexOrDefault(this.userProfil.Semester.ToString());
|
||||
this.Role.SelectedIndex = roleList.GetIndexOrDefault(this.userProfil.Role.ToString());
|
||||
this.Campus.SelectedIndex = campusList.GetIndexOrDefault(((int)this.userProfil.DefaultCampus).ToString());
|
||||
this.ProgressBar.Visibility = Visibility.Collapsed;
|
||||
this.DefHeader.ProgressVisibility = Visibility.Collapsed;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
<!--TitlePanel enthält den Namen der Anwendung und den Seitentitel-->
|
||||
<StackPanel Name="AppTitle" Grid.Row="0" Margin="12,17,0,28">
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.ApplicationTitle, Source={StaticResource LocalizedStrings}}" Style="{StaticResource PhoneTextNormalStyle}"/>
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.ApplicationTitle, Source={StaticResource LocalizedStrings}}" Style="{StaticResource PhoneTextLargeStyle}"/>
|
||||
</StackPanel>
|
||||
<ScrollViewer Grid.Row="1">
|
||||
<!--ContentPanel - zusätzliche Inhalte hier platzieren-->
|
||||
@@ -39,11 +39,23 @@
|
||||
<ColumnDefinition Width="auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<!-- Row 0 -->
|
||||
<lui:NavigateButton Name="TimeTableAppButton" Style="{StaticResource StartPageButton}" IsEnabled="False" Grid.Column="0">
|
||||
<!-- <lui:NavigateButton Name="TimeTableAppButton" Style="{StaticResource StartPageButton}" IsEnabled="False" Grid.Column="0">
|
||||
<StackPanel Style="{StaticResource StartPageStackPanelStyle}">
|
||||
<Image Source="{Binding Path=ThemelizedIcon.Schedule, Source={StaticResource ThemelizedIcons}}" Style="{StaticResource StartPageButtonImg}"/>
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.TimeTableApp_Title, Source={StaticResource LocalizedStrings}}" Style="{StaticResource StartPageButtonText}"/>
|
||||
</StackPanel>
|
||||
</lui:NavigateButton> -->
|
||||
<lui:NavigateButton Name="DepartmentAppButton" Grid.Column="0" Style="{StaticResource StartPageButton}" Url="{Binding Path=Constants.PathDepartment_DepartmentIndexPage, Source={StaticResource Const}}">
|
||||
<StackPanel Style="{StaticResource StartPageStackPanelStyle}">
|
||||
<Image Source="{Binding Path=ThemelizedIcon.Departments, Source={StaticResource ThemelizedIcons}}" Style="{StaticResource StartPageButtonImg}"/>
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.DepartmentApp_Title, Source={StaticResource LocalizedStrings}}" Style="{StaticResource StartPageButtonText}"/>
|
||||
</StackPanel>
|
||||
<toolkit:ContextMenuService.ContextMenu>
|
||||
<toolkit:ContextMenu>
|
||||
<toolkit:MenuItem Tag="DepartmentAppButton" Header="{Binding Path=LocalizedResources.ContextMenu_PinToStart, Source={StaticResource LocalizedStrings}}" Click="PintoStart_Click">
|
||||
</toolkit:MenuItem>
|
||||
</toolkit:ContextMenu>
|
||||
</toolkit:ContextMenuService.ContextMenu>
|
||||
</lui:NavigateButton>
|
||||
|
||||
<lui:NavigateButton Name="NewsAppButton" Style="{StaticResource StartPageButton}" Url="{Binding Path=Constants.PathNews_NewsIndexPage, Source={StaticResource Const}}" Grid.Column="1">
|
||||
@@ -83,16 +95,32 @@
|
||||
<ColumnDefinition Width="auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<lui:NavigateButton Name="HomeworkAppButton" Grid.Column="0" Style="{StaticResource StartPageButton}" IsEnabled="False">
|
||||
<!--<lui:NavigateButton Name="HomeworkAppButton" Grid.Column="0" Style="{StaticResource StartPageButton}" IsEnabled="False">
|
||||
<StackPanel Style="{StaticResource StartPageStackPanelStyle}">
|
||||
<Image Source="{Binding Path=ThemelizedIcon.Homework, Source={StaticResource ThemelizedIcons}}" Style="{StaticResource StartPageButtonImg}"/>
|
||||
<TextBlock Name="HomeworkAppButtonText" Text="{Binding Path=LocalizedResources.HomeworkApp_Title2, Source={StaticResource LocalizedStrings}}" Style="{StaticResource StartPageButtonText}"/>
|
||||
</StackPanel>
|
||||
</lui:NavigateButton> -->
|
||||
|
||||
<lui:NavigateButton Name="OSAAppButton" Url="{Binding Path=Constants.PathStudentCouncil_StudentCouncilPage, Source={StaticResource Const}}" Grid.Column="0" Style="{StaticResource StartPageButton}">
|
||||
<lui:NavigateButton.RenderTransform>
|
||||
<CompositeTransform/>
|
||||
</lui:NavigateButton.RenderTransform>
|
||||
<StackPanel Style="{StaticResource StartPageStackPanelStyle}">
|
||||
<Image Source="{Binding Path=ThemelizedIcon.StudentCouncil, Source={StaticResource ThemelizedIcons}}" Style="{StaticResource StartPageButtonImg}"/>
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.OSAApp_Title, Source={StaticResource LocalizedStrings}}" Style="{StaticResource StartPageButtonText}"/>
|
||||
</StackPanel>
|
||||
<toolkit:ContextMenuService.ContextMenu>
|
||||
<toolkit:ContextMenu>
|
||||
<toolkit:MenuItem Tag="OSAAppButton" Header="{Binding Path=LocalizedResources.ContextMenu_PinToStart, Source={StaticResource LocalizedStrings}}" Click="PintoStart_Click">
|
||||
</toolkit:MenuItem>
|
||||
</toolkit:ContextMenu>
|
||||
</toolkit:ContextMenuService.ContextMenu>
|
||||
</lui:NavigateButton>
|
||||
|
||||
<lui:NavigateButton Name="EventAppButton" Grid.Column="1" Style="{StaticResource StartPageButton}" Url="{Binding Path=Constants.PathEvents_EventsIndexPage, Source={StaticResource Const}}">
|
||||
<StackPanel Style="{StaticResource StartPageStackPanelStyle}">
|
||||
<Image Source="{Binding Path=ThemelizedIcon.News, Source={StaticResource ThemelizedIcons}}" Style="{StaticResource StartPageButtonImg}"/>
|
||||
<Image Source="{Binding Path=ThemelizedIcon.Events, Source={StaticResource ThemelizedIcons}}" Style="{StaticResource StartPageButtonImg}"/>
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.EventApp_Title, Source={StaticResource LocalizedStrings}}" Style="{StaticResource StartPageButtonText}"/>
|
||||
</StackPanel>
|
||||
<toolkit:ContextMenuService.ContextMenu>
|
||||
@@ -126,14 +154,15 @@
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<lui:NavigateButton Name="DepartmentAppButton" Grid.Column="0" Style="{StaticResource StartPageButton}" Url="{Binding Path=Constants.PathDepartment_DepartmentIndexPage, Source={StaticResource Const}}">
|
||||
<StackPanel Style="{StaticResource StartPageStackPanelStyle}">
|
||||
<Image Source="{Binding Path=ThemelizedIcon.Departments, Source={StaticResource ThemelizedIcons}}" Style="{StaticResource StartPageButtonImg}"/>
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.DepartmentApp_Title, Source={StaticResource LocalizedStrings}}" Style="{StaticResource StartPageButtonText}"/>
|
||||
|
||||
<lui:NavigateButton Name="examinationAppButton" Url="{Binding Path=Constants.PathExams_ExamsPage, Source={StaticResource Const}}" Grid.Column="0" Style="{StaticResource StartPageButton}">
|
||||
<StackPanel Style="{StaticResource StartPageStackPanelStyle}">
|
||||
<Image Source="{Binding Path=ThemelizedIcon.ExamApp, Source={StaticResource ThemelizedIcons}}" Style="{StaticResource StartPageButtonImg}"/>
|
||||
<TextBlock Name="examinationAppButtonText" Text="{Binding Path=LocalizedResources.ExaminationApp_Title, Source={StaticResource LocalizedStrings}}" Style="{StaticResource StartPageButtonText}"/>
|
||||
</StackPanel>
|
||||
<toolkit:ContextMenuService.ContextMenu>
|
||||
<toolkit:ContextMenu>
|
||||
<toolkit:MenuItem Tag="DepartmentAppButton" Header="{Binding Path=LocalizedResources.ContextMenu_PinToStart, Source={StaticResource LocalizedStrings}}" Click="PintoStart_Click">
|
||||
<toolkit:MenuItem Tag="examinationAppButton" Header="{Binding Path=LocalizedResources.ContextMenu_PinToStart, Source={StaticResource LocalizedStrings}}" Click="PintoStart_Click">
|
||||
</toolkit:MenuItem>
|
||||
</toolkit:ContextMenu>
|
||||
</toolkit:ContextMenuService.ContextMenu>
|
||||
@@ -152,14 +181,15 @@
|
||||
</toolkit:ContextMenuService.ContextMenu>
|
||||
</lui:NavigateButton>
|
||||
|
||||
<lui:NavigateButton Name="MailAppButton" Grid.Column="2" Style="{StaticResource StartPageButton}" Url="{Binding Path=Constants.PathMail_WebMailPage, Source={StaticResource Const}}">
|
||||
<lui:NavigateButton Name="personAppButton" Url="{Binding Path=Constants.PathPerson_Person, Source={StaticResource Const}}" Grid.Column="2" Style="{StaticResource StartPageButton}">
|
||||
<StackPanel Style="{StaticResource StartPageStackPanelStyle}">
|
||||
<Image Source="{Binding Path=ThemelizedIcon.WebMail, Source={StaticResource ThemelizedIcons}}" Style="{StaticResource StartPageButtonImg}"/>
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.MailApp_Title, Source={StaticResource LocalizedStrings}}" Style="{StaticResource StartPageButtonText}"/>
|
||||
<Image Source="{Binding Path=ThemelizedIcon.Person, Source={StaticResource ThemelizedIcons}}" Style="{StaticResource StartPageButtonImg}"/>
|
||||
<TextBlock Name="personAppButtonText" Text="{Binding Path=LocalizedResources.PersonApp_Title, Source={StaticResource LocalizedStrings}}" Style="{StaticResource StartPageButtonText}"/>
|
||||
</StackPanel>
|
||||
<toolkit:ContextMenuService.ContextMenu>
|
||||
<toolkit:ContextMenu>
|
||||
<toolkit:MenuItem Tag="MailAppButton" Header="{Binding Path=LocalizedResources.ContextMenu_PinToStart, Source={StaticResource LocalizedStrings}}" Click="PintoStart_Click" />
|
||||
<toolkit:MenuItem Tag="personAppButton" Header="{Binding Path=LocalizedResources.ContextMenu_PinToStart, Source={StaticResource LocalizedStrings}}" Click="PintoStart_Click">
|
||||
</toolkit:MenuItem>
|
||||
</toolkit:ContextMenu>
|
||||
</toolkit:ContextMenuService.ContextMenu>
|
||||
</lui:NavigateButton>
|
||||
@@ -174,8 +204,19 @@
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<lui:NavigateButton Name="OpenHoursAppButton" Url="{Binding Path=Constants.PathOpeninghours_OpeninghoursPage, Source={StaticResource Const}}" Grid.Column="0" Style="{StaticResource StartPageButton}">
|
||||
<lui:NavigateButton Name="MailAppButton" Grid.Column="0" Style="{StaticResource StartPageButton}" Url="{Binding Path=Constants.PathMail_WebMailPage, Source={StaticResource Const}}">
|
||||
<StackPanel Style="{StaticResource StartPageStackPanelStyle}">
|
||||
<Image Source="{Binding Path=ThemelizedIcon.WebMail, Source={StaticResource ThemelizedIcons}}" Style="{StaticResource StartPageButtonImg}"/>
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.MailApp_Title, Source={StaticResource LocalizedStrings}}" Style="{StaticResource StartPageButtonText}"/>
|
||||
</StackPanel>
|
||||
<toolkit:ContextMenuService.ContextMenu>
|
||||
<toolkit:ContextMenu>
|
||||
<toolkit:MenuItem Tag="MailAppButton" Header="{Binding Path=LocalizedResources.ContextMenu_PinToStart, Source={StaticResource LocalizedStrings}}" Click="PintoStart_Click" />
|
||||
</toolkit:ContextMenu>
|
||||
</toolkit:ContextMenuService.ContextMenu>
|
||||
</lui:NavigateButton>
|
||||
|
||||
<lui:NavigateButton Name="OpenHoursAppButton" Url="{Binding Path=Constants.PathOpeninghours_OpeninghoursPage, Source={StaticResource Const}}" Grid.Column="1" Style="{StaticResource StartPageButton}">
|
||||
<StackPanel Style="{StaticResource StartPageStackPanelStyle}">
|
||||
<Image Source="{Binding Path=ThemelizedIcon.Openhours, Source={StaticResource ThemelizedIcons}}" Style="{StaticResource StartPageButtonImg}"/>
|
||||
<TextBlock Name="OpenHoursAppButtonText" Text="{Binding Path=LocalizedResources.OpenHoursApp_Title2, Source={StaticResource LocalizedStrings}}" Style="{StaticResource StartPageButtonText}"/>
|
||||
@@ -187,8 +228,7 @@
|
||||
</toolkit:ContextMenu>
|
||||
</toolkit:ContextMenuService.ContextMenu>
|
||||
</lui:NavigateButton>
|
||||
|
||||
<lui:NavigateButton Name="LinkAppButton" Url="{Binding Path=Constants.PathLinks_LinkPage, Source={StaticResource Const}}" Grid.Column="1" Style="{StaticResource StartPageButton}">
|
||||
<lui:NavigateButton Name="LinkAppButton" Url="{Binding Path=Constants.PathLinks_LinkPage, Source={StaticResource Const}}" Grid.Column="2" Style="{StaticResource StartPageButton}">
|
||||
<StackPanel Style="{StaticResource StartPageStackPanelStyle}">
|
||||
<Image Source="{Binding Path=ThemelizedIcon.Link, Source={StaticResource ThemelizedIcons}}" Style="{StaticResource StartPageButtonImg}"/>
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.LinkApp_Title, Source={StaticResource LocalizedStrings}}" Style="{StaticResource StartPageButtonText}"/>
|
||||
@@ -200,25 +240,9 @@
|
||||
</toolkit:ContextMenu>
|
||||
</toolkit:ContextMenuService.ContextMenu>
|
||||
</lui:NavigateButton>
|
||||
|
||||
<lui:NavigateButton Name="OSAAppButton" Url="{Binding Path=Constants.PathStudentCouncil_StudentCouncilPage, Source={StaticResource Const}}" Grid.Column="2" Style="{StaticResource StartPageButton}">
|
||||
<lui:NavigateButton.RenderTransform>
|
||||
<CompositeTransform/>
|
||||
</lui:NavigateButton.RenderTransform>
|
||||
<StackPanel Style="{StaticResource StartPageStackPanelStyle}">
|
||||
<Image Source="{Binding Path=ThemelizedIcon.StudentCouncil, Source={StaticResource ThemelizedIcons}}" Style="{StaticResource StartPageButtonImg}"/>
|
||||
<TextBlock Text="{Binding Path=LocalizedResources.OSAApp_Title, Source={StaticResource LocalizedStrings}}" Style="{StaticResource StartPageButtonText}"/>
|
||||
</StackPanel>
|
||||
<toolkit:ContextMenuService.ContextMenu>
|
||||
<toolkit:ContextMenu>
|
||||
<toolkit:MenuItem Tag="OSAAppButton" Header="{Binding Path=LocalizedResources.ContextMenu_PinToStart, Source={StaticResource LocalizedStrings}}" Click="PintoStart_Click">
|
||||
</toolkit:MenuItem>
|
||||
</toolkit:ContextMenu>
|
||||
</toolkit:ContextMenuService.ContextMenu>
|
||||
</lui:NavigateButton>
|
||||
</Grid>
|
||||
|
||||
<!-- Row 4 -->
|
||||
<!-- Row 4
|
||||
|
||||
<Grid Name="Row4">
|
||||
<Grid.ColumnDefinitions>
|
||||
@@ -228,33 +252,7 @@
|
||||
<ColumnDefinition Width="auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<lui:NavigateButton Name="examinationAppButton" Url="{Binding Path=Constants.PathExams_ExamsPage, Source={StaticResource Const}}" Grid.Column="0" Style="{StaticResource StartPageButton}">
|
||||
<StackPanel Style="{StaticResource StartPageStackPanelStyle}">
|
||||
<Image Source="{Binding Path=ThemelizedIcon.Exams, Source={StaticResource ThemelizedIcons}}" Style="{StaticResource StartPageButtonImg}"/>
|
||||
<TextBlock Name="examinationAppButtonText" Text="{Binding Path=LocalizedResources.ExaminationApp_Title, Source={StaticResource LocalizedStrings}}" Style="{StaticResource StartPageButtonText}"/>
|
||||
</StackPanel>
|
||||
<toolkit:ContextMenuService.ContextMenu>
|
||||
<toolkit:ContextMenu>
|
||||
<toolkit:MenuItem Tag="examinationAppButton" Header="{Binding Path=LocalizedResources.ContextMenu_PinToStart, Source={StaticResource LocalizedStrings}}" Click="PintoStart_Click">
|
||||
</toolkit:MenuItem>
|
||||
</toolkit:ContextMenu>
|
||||
</toolkit:ContextMenuService.ContextMenu>
|
||||
</lui:NavigateButton>
|
||||
|
||||
<lui:NavigateButton Name="personAppButton" Url="{Binding Path=Constants.PathPerson_Person, Source={StaticResource Const}}" Grid.Column="1" Style="{StaticResource StartPageButton}">
|
||||
<StackPanel Style="{StaticResource StartPageStackPanelStyle}">
|
||||
<Image Source="{Binding Path=ThemelizedIcon.Person, Source={StaticResource ThemelizedIcons}}" Style="{StaticResource StartPageButtonImg}"/>
|
||||
<TextBlock Name="personAppButtonText" Text="{Binding Path=LocalizedResources.PersonApp_Title, Source={StaticResource LocalizedStrings}}" Style="{StaticResource StartPageButtonText}"/>
|
||||
</StackPanel>
|
||||
<toolkit:ContextMenuService.ContextMenu>
|
||||
<toolkit:ContextMenu>
|
||||
<toolkit:MenuItem Tag="personAppButton" Header="{Binding Path=LocalizedResources.ContextMenu_PinToStart, Source={StaticResource LocalizedStrings}}" Click="PintoStart_Click">
|
||||
</toolkit:MenuItem>
|
||||
</toolkit:ContextMenu>
|
||||
</toolkit:ContextMenuService.ContextMenu>
|
||||
</lui:NavigateButton>
|
||||
|
||||
<lui:NavigateButton Name="placeNewsAppButton" Url="{Binding Path=Constants.PathPlaceNews_PlaceNewsPage, Source={StaticResource Const}}" Grid.Column="2" Style="{StaticResource StartPageButton}">
|
||||
<lui:NavigateButton Name="placeNewsAppButton" Url="{Binding Path=Constants.PathPlaceNews_PlaceNewsPage, Source={StaticResource Const}}" Grid.Column="2" Style="{StaticResource StartPageButton}">
|
||||
<StackPanel Style="{StaticResource StartPageStackPanelStyle}">
|
||||
<Image Source="{Binding Path=ThemelizedIcon.News, Source={StaticResource ThemelizedIcons}}" Style="{StaticResource StartPageButtonImg}"/>
|
||||
<TextBlock Name="placeNewsButtonText" Text="{Binding Path=LocalizedResources.PlaceNewsApp_Title, Source={StaticResource LocalizedStrings}}" Style="{StaticResource StartPageButtonText}"/>
|
||||
@@ -266,12 +264,9 @@
|
||||
</toolkit:ContextMenu>
|
||||
</toolkit:ContextMenuService.ContextMenu>
|
||||
</lui:NavigateButton>
|
||||
</Grid>
|
||||
|
||||
</Grid> -->
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
|
||||
<!-- <Image Source="/Assets/AlignmentGrid.png" VerticalAlignment="Top" Height="800" Width="480" Margin="0,-32,0,0" Grid.Row="0" Grid.RowSpan="2" IsHitTestVisible="False" /> -->
|
||||
</Grid>
|
||||
<phone:PhoneApplicationPage.ApplicationBar>
|
||||
<shell:ApplicationBar IsVisible="True" IsMenuEnabled="True" Mode="Minimized" StateChanged="ApplicationBar_StateChanged" Opacity="0.5" >
|
||||
|
||||
@@ -9,18 +9,22 @@ namespace CampusAppWP8.Pages
|
||||
{
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices.WindowsRuntime;
|
||||
using System.Threading;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Navigation;
|
||||
using Windows.Networking.Proximity;
|
||||
using CampusAppWP8.Feed.Utility;
|
||||
using CampusAppWP8.File.Places;
|
||||
using CampusAppWP8.Resources;
|
||||
using CampusAppWP8.Utility;
|
||||
using CampusAppWP8.Utility.Lui.MessageBoxes;
|
||||
using CampusAppWP8.Utility.Lui.Tiles;
|
||||
using CampusAppWP8.Utility.NDEF;
|
||||
using Microsoft.Phone.Controls;
|
||||
using Microsoft.Phone.Shell;
|
||||
using CampusAppWP8.File.Places;
|
||||
using CampusAppWP8.Utility.Lui.Tiles;
|
||||
using CampusAppWP8.Model.Setting;
|
||||
|
||||
/// <summary>
|
||||
/// Class for the StartPage
|
||||
@@ -29,9 +33,14 @@ namespace CampusAppWP8.Pages
|
||||
{
|
||||
#region Member
|
||||
|
||||
/// <summary>The device.</summary>
|
||||
private readonly ProximityDevice device = ProximityDevice.GetDefault();
|
||||
|
||||
/// <summary>List of initialise courses.</summary>
|
||||
private CourseFeed initCourseList;
|
||||
|
||||
private PageOrientation prevOrientation;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructor
|
||||
@@ -42,6 +51,7 @@ namespace CampusAppWP8.Pages
|
||||
public StartPage()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
|
||||
ApplicationBarMenuItem menuItem1 = ApplicationBar.MenuItems[0] as ApplicationBarMenuItem;
|
||||
ApplicationBarMenuItem menuItem2 = ApplicationBar.MenuItems[1] as ApplicationBarMenuItem;
|
||||
ApplicationBarMenuItem menuItem3 = ApplicationBar.MenuItems[2] as ApplicationBarMenuItem;
|
||||
@@ -57,18 +67,16 @@ namespace CampusAppWP8.Pages
|
||||
menuItem2.Text = AppResources.Setting_ApplAppBarTitle;
|
||||
}
|
||||
|
||||
if (Settings.AppSetting.DevMode)
|
||||
if (menuItem3 != null)
|
||||
{
|
||||
if (menuItem3 != null)
|
||||
{
|
||||
menuItem3.Text = "Nfc";
|
||||
}
|
||||
|
||||
if (menuItem4 != null)
|
||||
{
|
||||
menuItem4.Text = "QR-Reader";
|
||||
}
|
||||
menuItem3.Text = AppResources.App_ScanQR;
|
||||
}
|
||||
|
||||
if (menuItem4 != null)
|
||||
{
|
||||
menuItem4.Text = AppResources.App_ScanNfc;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
ApplicationBar.MenuItems.RemoveAt(ApplicationBar.MenuItems.Count - 1);
|
||||
@@ -99,6 +107,8 @@ namespace CampusAppWP8.Pages
|
||||
file.LoadData();
|
||||
}
|
||||
|
||||
private long ndefId;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Method
|
||||
@@ -112,6 +122,27 @@ namespace CampusAppWP8.Pages
|
||||
protected override void OnNavigatedTo(NavigationEventArgs e)
|
||||
{
|
||||
base.OnNavigatedTo(e);
|
||||
if (this.Orientation.Equals(PageOrientation.PortraitUp) || this.Orientation.Equals(PageOrientation.PortraitDown) || this.Orientation.Equals(PageOrientation.Portrait))
|
||||
{
|
||||
this.prevOrientation = PageOrientation.Portrait;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.prevOrientation = PageOrientation.Landscape;
|
||||
}
|
||||
|
||||
ndefId = this.device.SubscribeForMessage(Constants.NCFMessageType_NDEF, this.NDEFHandler);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Methods overrides the OnNavigatedFrom-Method
|
||||
/// </summary>
|
||||
/// <param name="e">some NavigationEventArgs</param>
|
||||
protected override void OnNavigatedFrom(NavigationEventArgs e)
|
||||
{
|
||||
this.device.StopSubscribingForMessage(ndefId);
|
||||
|
||||
base.OnNavigatedFrom(e);
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -133,23 +164,36 @@ namespace CampusAppWP8.Pages
|
||||
private void PhoneApplicationPage_OrientationChanged(object sender, OrientationChangedEventArgs e)
|
||||
{
|
||||
// Switch the placement of the buttons based on an orientation change.
|
||||
if (this.Orientation == PageOrientation.LandscapeLeft)
|
||||
if (this.Orientation.Equals(PageOrientation.LandscapeLeft))
|
||||
{
|
||||
this.ContentPanel.Margin = new Thickness(24, -24, 76, 0);
|
||||
this.AppTitle.Margin = new Thickness(12, 17, 0, 28);
|
||||
this.MoveGridToLandscape();
|
||||
if (!this.prevOrientation.Equals(PageOrientation.Landscape))
|
||||
{
|
||||
this.MoveGridToLandscape();
|
||||
this.prevOrientation = PageOrientation.Landscape;
|
||||
}
|
||||
}
|
||||
else if (this.Orientation == PageOrientation.LandscapeRight)
|
||||
else if (this.Orientation.Equals(PageOrientation.LandscapeRight))
|
||||
{
|
||||
this.ContentPanel.Margin = new Thickness(76, -24, 24, 0);
|
||||
this.AppTitle.Margin = new Thickness(64, 17, 0, 28);
|
||||
this.MoveGridToLandscape();
|
||||
if (!this.prevOrientation.Equals(PageOrientation.Landscape))
|
||||
{
|
||||
this.MoveGridToLandscape();
|
||||
this.prevOrientation = PageOrientation.Landscape;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.ContentPanel.Margin = new Thickness(12, 0, 12, 12);
|
||||
this.AppTitle.Margin = new Thickness(12, 17, 0, 28);
|
||||
this.MoveToPortrait();
|
||||
|
||||
if (!this.prevOrientation.Equals(PageOrientation.Portrait))
|
||||
{
|
||||
this.MoveToPortrait();
|
||||
this.prevOrientation = PageOrientation.Portrait;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -157,18 +201,19 @@ namespace CampusAppWP8.Pages
|
||||
/// <remarks>Stubbfel, 27.08.2013.</remarks>
|
||||
private void MoveToPortrait()
|
||||
{
|
||||
bool test = this.Row0.Children.Remove(this.OpenHoursAppButton);
|
||||
if (!test)
|
||||
if (!this.Row0.Children.Contains(this.MailAppButton)
|
||||
&& !this.Row1.Children.Contains(this.OpenHoursAppButton)
|
||||
&& !this.Row2.Children.Contains(this.LinkAppButton))
|
||||
{
|
||||
return;
|
||||
}
|
||||
this.Row0.Children.Remove(this.MailAppButton);
|
||||
this.Row3.Children.Add(this.MailAppButton);
|
||||
this.MailAppButton.SetValue(Grid.ColumnProperty, 0);
|
||||
|
||||
this.Row1.Children.Remove(this.OpenHoursAppButton);
|
||||
this.Row3.Children.Add(this.OpenHoursAppButton);
|
||||
this.OpenHoursAppButton.SetValue(Grid.ColumnProperty, 0);
|
||||
|
||||
this.Row1.Children.Remove(this.OSAAppButton);
|
||||
this.Row3.Children.Add(this.OSAAppButton);
|
||||
this.OSAAppButton.SetValue(Grid.ColumnProperty, 1);
|
||||
this.OpenHoursAppButton.SetValue(Grid.ColumnProperty, 1);
|
||||
|
||||
this.Row2.Children.Remove(this.LinkAppButton);
|
||||
this.Row3.Children.Add(this.LinkAppButton);
|
||||
@@ -179,18 +224,20 @@ namespace CampusAppWP8.Pages
|
||||
/// <remarks>Stubbfel, 27.08.2013.</remarks>
|
||||
private void MoveGridToLandscape()
|
||||
{
|
||||
bool test = this.Row3.Children.Remove(this.OpenHoursAppButton);
|
||||
if (!test)
|
||||
if (!this.Row3.Children.Contains(this.MailAppButton)
|
||||
&& !this.Row3.Children.Contains(this.OpenHoursAppButton)
|
||||
&& !this.Row3.Children.Contains(this.LinkAppButton))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
this.Row0.Children.Add(this.OpenHoursAppButton);
|
||||
this.OpenHoursAppButton.SetValue(Grid.ColumnProperty, 3);
|
||||
this.Row3.Children.Remove(this.MailAppButton);
|
||||
this.Row0.Children.Add(this.MailAppButton); ;
|
||||
this.MailAppButton.SetValue(Grid.ColumnProperty, 3);
|
||||
|
||||
this.Row3.Children.Remove(this.OSAAppButton);
|
||||
this.Row1.Children.Add(this.OSAAppButton);
|
||||
this.OSAAppButton.SetValue(Grid.ColumnProperty, 3);
|
||||
this.Row3.Children.Remove(this.OpenHoursAppButton);
|
||||
this.Row1.Children.Add(this.OpenHoursAppButton);
|
||||
this.OpenHoursAppButton.SetValue(Grid.ColumnProperty, 3);
|
||||
|
||||
this.Row3.Children.Remove(this.LinkAppButton);
|
||||
this.Row2.Children.Add(this.LinkAppButton);
|
||||
@@ -224,10 +271,10 @@ namespace CampusAppWP8.Pages
|
||||
/// </summary>
|
||||
/// <param name="sender">Caller of the function</param>
|
||||
/// <param name="e">some EventArgs</param>
|
||||
private void ApplicationBarMenuItem3_Click(object sender, EventArgs e)
|
||||
private void ApplicationBarMenuItem4_Click(object sender, EventArgs e)
|
||||
{
|
||||
Uri url = new Uri("/Pages/Dev/NFC.xaml", UriKind.Relative);
|
||||
NavigationService.Navigate(url);
|
||||
/* Uri url = new Uri("/Pages/Dev/NFC.xaml", UriKind.Relative);
|
||||
NavigationService.Navigate(url);*/
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -235,7 +282,7 @@ namespace CampusAppWP8.Pages
|
||||
/// </summary>
|
||||
/// <param name="sender">Caller of the function.</param>
|
||||
/// <param name="e">Event information.</param>
|
||||
private void ApplicationBarMenuItem4_Click(object sender, EventArgs e)
|
||||
private void ApplicationBarMenuItem3_Click(object sender, EventArgs e)
|
||||
{
|
||||
Uri url = new Uri("/Pages/Dev/QRScanner.xaml", UriKind.Relative);
|
||||
NavigationService.Navigate(url);
|
||||
@@ -285,8 +332,6 @@ namespace CampusAppWP8.Pages
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private void PintoStart_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
FrameworkElement elment = sender as FrameworkElement;
|
||||
@@ -346,28 +391,68 @@ namespace CampusAppWP8.Pages
|
||||
|
||||
}
|
||||
|
||||
private void PintoStart_Click2(object sender, RoutedEventArgs e)
|
||||
private void NDEFHandler(ProximityDevice sender, ProximityMessage message)
|
||||
{
|
||||
IconicTileData oIcontile = new IconicTileData();
|
||||
oIcontile.Title = "WebmailPage";
|
||||
// create ndefMessage
|
||||
this.device.StopSubscribingForMessage(message.SubscriptionId);
|
||||
|
||||
oIcontile.IconImage = new Uri(Icons.Mensa, UriKind.Relative);
|
||||
oIcontile.SmallIconImage = new Uri(Icons.Mensa, UriKind.Relative);
|
||||
|
||||
// find the tile object for the application tile that using "Iconic" contains string in it.
|
||||
ShellTile TileToFind = ShellTile.ActiveTiles.FirstOrDefault(x => x.NavigationUri.ToString().Contains("WebmailPage".ToString()));
|
||||
|
||||
if (TileToFind != null && TileToFind.NavigationUri.ToString().Contains("WebmailPage"))
|
||||
if (AppSettings.BTUTagDefaultHandler.CampusMap == Settings.AppSetting.TagDefaultHandler)
|
||||
{
|
||||
TileToFind.Delete();
|
||||
ShellTile.Create(new Uri(Constants.PathMail_WebMailPage, UriKind.Relative), oIcontile, true);
|
||||
var ndefMessage = message.Data;
|
||||
byte[] data = ndefMessage.ToArray();
|
||||
NDEFMessage ndef = new NDEFMessage(data);
|
||||
|
||||
// search for placeId
|
||||
string nfcContent = ndef.GetContent();
|
||||
this.GoToCampusMappage(nfcContent);
|
||||
}
|
||||
else
|
||||
{
|
||||
ShellTile.Create(new Uri(Constants.PathMail_WebMailPage, UriKind.Relative), oIcontile, true);
|
||||
if (this.Dispatcher != null)
|
||||
{
|
||||
this.Dispatcher.BeginInvoke(new Action(() => this.ShowBtuTagMessageBox()));
|
||||
}
|
||||
else
|
||||
{
|
||||
this.ShowBtuTagMessageBox();
|
||||
}
|
||||
}
|
||||
|
||||
ndefId = this.device.SubscribeForMessage(Constants.NCFMessageType_NDEF, this.NDEFHandler);
|
||||
}
|
||||
|
||||
private void GoToCampusMappage(string tagContent)
|
||||
{
|
||||
string pid = Wp8StringManager.FilterPlaceIdinNFCResultString(tagContent);
|
||||
string urlString = Constants.PathCampusmap_Campusmap;
|
||||
urlString += "?" + Constants.ParamModelMap_SearchTermAlias + "=" + pid;
|
||||
Uri url = new Uri(urlString as string, UriKind.Relative);
|
||||
|
||||
if (this.Dispatcher != null)
|
||||
{
|
||||
this.Dispatcher.BeginInvoke(new Action(() => NavigationService.Navigate(url)));
|
||||
}
|
||||
else
|
||||
{
|
||||
NavigationService.Navigate(url);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void ShowBtuTagMessageBox()
|
||||
{
|
||||
MessageBoxResult msgResult = MessageBoxes.ShowBtuTagInfoOkCancelMessageBox();
|
||||
if (msgResult.Equals(MessageBoxResult.OK))
|
||||
{
|
||||
string urlString = Constants.PathBTUTag_Info;
|
||||
Uri url = new Uri(urlString as string, UriKind.Relative);
|
||||
this.NavigationService.Navigate(url);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,7 @@
|
||||
xmlns:lui="clr-namespace:CampusAppWP8.Utility.Lui.Button"
|
||||
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"
|
||||
mc:Ignorable="d"
|
||||
FontFamily="{StaticResource PhoneFontFamilyNormal}"
|
||||
FontSize="{StaticResource PhoneFontSizeNormal}"
|
||||
@@ -16,13 +17,21 @@
|
||||
|
||||
<!--LayoutRoot ist das Stammraster, in dem alle anderen Seiteninhalte platziert werden-->
|
||||
<Grid x:Name="LayoutRoot" Background="Transparent">
|
||||
<ProgressBar Name="ProgressBar" Visibility="Collapsed" IsIndeterminate="True"/>
|
||||
<phone:Pivot Name="StudentCouncilPivot" Title="{Binding Path=LocalizedResources.ApplicationTitle, Source={StaticResource LocalizedStrings}}">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!--header-->
|
||||
<header:DefaultHeader x:Name="DefHeader" Grid.Row="0" HeaderName="{Binding Path=LocalizedResources.OSAApp_Title, Source={StaticResource LocalizedStrings}}"/>
|
||||
|
||||
<!--pivot-->
|
||||
<phone:Pivot Name="StudentCouncilPivot" Grid.Row="1">
|
||||
<phone:Pivot.HeaderTemplate>
|
||||
|
||||
<DataTemplate>
|
||||
<StackPanel>
|
||||
<TextBlock Text="{Binding Key}" />
|
||||
<TextBlock Text="{Binding Key}" Margin="0,-36,0,0"/>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
|
||||
@@ -38,13 +47,17 @@
|
||||
</ListBox.ItemContainerStyle>
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel>
|
||||
<lui:ToggleButton Content="{Binding Name}" ToggleContentTag="{Binding Path=Constants.ToggleContent, Source={StaticResource Const}}" Style="{StaticResource ListButtonStyle}"/>
|
||||
<StackPanel Tag="{Binding Path=Constants.ToggleContent, Source={StaticResource Const}}" Orientation="Horizontal" HorizontalAlignment="Center" Visibility="Collapsed">
|
||||
<lui:LinkButton Height="75" Url="{Binding Url}" />
|
||||
<lui:EmailButton Height="75" EmailAddress="{Binding Email}"/>
|
||||
<Border Style="{StaticResource ListButtonBorder}">
|
||||
<StackPanel>
|
||||
<lui:ToggleButton ToggleContentTag="{Binding Path=Constants.ToggleContent, Source={StaticResource Const}}" Style="{StaticResource ListButtonNoneBorder}" >
|
||||
<TextBlock Text="{Binding Name}" TextWrapping="Wrap"/>
|
||||
</lui:ToggleButton>
|
||||
<StackPanel Tag="{Binding Path=Constants.ToggleContent, Source={StaticResource Const}}" Orientation="Horizontal" HorizontalAlignment="Center" Visibility="Collapsed">
|
||||
<lui:LinkButton Height="100" Url="{Binding Url}" />
|
||||
<lui:EmailButton Height="100" EmailAddress="{Binding Email}"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
|
||||
@@ -54,12 +54,18 @@ namespace CampusAppWP8.Pages.StudentCouncil
|
||||
protected override void OnNavigatedTo(NavigationEventArgs e)
|
||||
{
|
||||
base.OnNavigatedTo(e);
|
||||
|
||||
if (this.Orientation.Equals(PageOrientation.Landscape) || this.Orientation.Equals(PageOrientation.LandscapeLeft) || this.Orientation.Equals(PageOrientation.LandscapeRight))
|
||||
{
|
||||
ApplicationBar.Mode = Microsoft.Phone.Shell.ApplicationBarMode.Default;
|
||||
}
|
||||
|
||||
if (this.feed == null)
|
||||
{
|
||||
this.InitializeFeed();
|
||||
}
|
||||
|
||||
this.ProgressBar.Visibility = System.Windows.Visibility.Visible;
|
||||
this.DefHeader.ProgressVisibility = System.Windows.Visibility.Visible;
|
||||
this.feed.LoadData(Utilities.GetLoadModus<CampusAppWPortalLib8.Model.StudentCouncil.StudentCouncilListModel>());
|
||||
}
|
||||
|
||||
@@ -72,6 +78,26 @@ namespace CampusAppWP8.Pages.StudentCouncil
|
||||
this.feed.SaveData();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Override the OnOrientationChanged method.
|
||||
/// </summary>
|
||||
/// <param name="e">orientation changed args.</param>
|
||||
protected override void OnOrientationChanged(OrientationChangedEventArgs e)
|
||||
{
|
||||
if (e.Orientation == PageOrientation.Landscape
|
||||
|| e.Orientation == PageOrientation.LandscapeLeft
|
||||
|| e.Orientation == PageOrientation.LandscapeRight)
|
||||
{
|
||||
ApplicationBar.Mode = Microsoft.Phone.Shell.ApplicationBarMode.Default;
|
||||
}
|
||||
else
|
||||
{
|
||||
ApplicationBar.Mode = Microsoft.Phone.Shell.ApplicationBarMode.Minimized;
|
||||
}
|
||||
|
||||
base.OnOrientationChanged(e);
|
||||
}
|
||||
|
||||
#endregion
|
||||
#region private
|
||||
|
||||
@@ -92,7 +118,7 @@ namespace CampusAppWP8.Pages.StudentCouncil
|
||||
private void FeedIsReady()
|
||||
{
|
||||
this.SetupStudentCouncilPivot();
|
||||
this.ProgressBar.Visibility = System.Windows.Visibility.Collapsed;
|
||||
this.DefHeader.ProgressVisibility = System.Windows.Visibility.Collapsed;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -111,7 +137,7 @@ namespace CampusAppWP8.Pages.StudentCouncil
|
||||
/// <param name="e">event args</param>
|
||||
private void StudentForceUpdate_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.ProgressBar.Visibility = System.Windows.Visibility.Visible;
|
||||
this.DefHeader.ProgressVisibility = System.Windows.Visibility.Visible;
|
||||
this.feed.ForceWebUpdate();
|
||||
}
|
||||
|
||||
@@ -130,7 +156,7 @@ namespace CampusAppWP8.Pages.StudentCouncil
|
||||
private void FeedIsFailFile()
|
||||
{
|
||||
MessageBoxResult result = MessageBoxes.ShowMainModelErrorMessageBox(AppResources.MsgBox_ErrorMainModelLoadFile);
|
||||
this.ProgressBar.Visibility = System.Windows.Visibility.Collapsed;
|
||||
this.DefHeader.ProgressVisibility = System.Windows.Visibility.Collapsed;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||