From bbc6269ed11ad7f17e09cacdf66c141433b30304 Mon Sep 17 00:00:00 2001 From: stubbfel Date: Thu, 20 Jun 2013 13:11:27 +0200 Subject: [PATCH 1/6] add search icon #51 --- CampusAppWP8/CampusAppWP8/Pages/Campusmap/CampusMapPage.xaml | 2 +- CampusAppWP8/CampusAppWP8/Properties/WMAppManifest.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CampusAppWP8/CampusAppWP8/Pages/Campusmap/CampusMapPage.xaml b/CampusAppWP8/CampusAppWP8/Pages/Campusmap/CampusMapPage.xaml index 7919009f..547c169a 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Campusmap/CampusMapPage.xaml +++ b/CampusAppWP8/CampusAppWP8/Pages/Campusmap/CampusMapPage.xaml @@ -39,7 +39,7 @@ - + diff --git a/CampusAppWP8/CampusAppWP8/Properties/WMAppManifest.xml b/CampusAppWP8/CampusAppWP8/Properties/WMAppManifest.xml index f4b319d3..856d2330 100644 --- a/CampusAppWP8/CampusAppWP8/Properties/WMAppManifest.xml +++ b/CampusAppWP8/CampusAppWP8/Properties/WMAppManifest.xml @@ -13,7 +13,7 @@ - + From c5ea5354895f2b63bdc2669029e86d51e0819d88 Mon Sep 17 00:00:00 2001 From: stubbfel Date: Thu, 20 Jun 2013 15:56:13 +0200 Subject: [PATCH 2/6] finish day --- CampusAppWP8/CampusAppWP8/Assets/testmap.png | Bin 0 -> 10229 bytes CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj | 1 + .../Pages/Campusmap/CampusMapPage.xaml | 16 ++++++++++++++-- .../Pages/Campusmap/CampusMapPage.xaml.cs | 3 +++ 4 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 CampusAppWP8/CampusAppWP8/Assets/testmap.png diff --git a/CampusAppWP8/CampusAppWP8/Assets/testmap.png b/CampusAppWP8/CampusAppWP8/Assets/testmap.png new file mode 100644 index 0000000000000000000000000000000000000000..a2cdfad3ed2805221012ad507a40587f4c033939 GIT binary patch literal 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&BXDQ)=eX?#tA`)ryN%QV#uH*@s-W`NT62K!r?2NIRvET1T@Zp6@dl*4BI^BX2} zo^}Y$hjrwSZSHb^edWR7<$7+*&XsuQJ)c<3>=(K3hJLfS;8VtkRFUV>flK28&i1cz zyUy|`&{FjO#oUK7QkCz685kHCJYD@<);T3K0RS{nqs9OL literal 0 HcmV?d00001 diff --git a/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj b/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj index d8a484bf..7abfac75 100644 --- a/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj +++ b/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj @@ -282,6 +282,7 @@ + PreserveNewest diff --git a/CampusAppWP8/CampusAppWP8/Pages/Campusmap/CampusMapPage.xaml b/CampusAppWP8/CampusAppWP8/Pages/Campusmap/CampusMapPage.xaml index 547c169a..3dec5811 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Campusmap/CampusMapPage.xaml +++ b/CampusAppWP8/CampusAppWP8/Pages/Campusmap/CampusMapPage.xaml @@ -41,11 +41,23 @@ - + + + + + + + + + + + + + diff --git a/CampusAppWP8/CampusAppWP8/Pages/Campusmap/CampusMapPage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/Campusmap/CampusMapPage.xaml.cs index 9e4cd703..ca9aebd8 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Campusmap/CampusMapPage.xaml.cs +++ b/CampusAppWP8/CampusAppWP8/Pages/Campusmap/CampusMapPage.xaml.cs @@ -7,6 +7,7 @@ using System.Windows.Controls; using System.Windows.Navigation; using Microsoft.Phone.Controls; using Microsoft.Phone.Shell; +using System.Windows.Media; namespace CampusAppWP8.Pages.Campusmap { @@ -15,6 +16,8 @@ namespace CampusAppWP8.Pages.Campusmap public CampusMapPage() { InitializeComponent(); + test.SetValue(H, 800); + } private void PhoneApplicationPage_OrientationChanged(object sender, OrientationChangedEventArgs e) From 811ad35fa98652e0ad5e54da041a67d640bb39ae Mon Sep 17 00:00:00 2001 From: stubbfel Date: Fri, 21 Jun 2013 12:37:17 +0200 Subject: [PATCH 3/6] add mapmodel --- CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj | 1 + .../CampusAppWP8/Model/Campusmap/MapModel.cs | 62 +++++++++++++++++++ .../Pages/Campusmap/CampusMapPage.xaml | 16 ++--- .../Pages/Campusmap/CampusMapPage.xaml.cs | 23 ++++++- 4 files changed, 93 insertions(+), 9 deletions(-) create mode 100644 CampusAppWP8/CampusAppWP8/Model/Campusmap/MapModel.cs diff --git a/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj b/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj index 7abfac75..ab5540fc 100644 --- a/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj +++ b/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj @@ -97,6 +97,7 @@ App.xaml + diff --git a/CampusAppWP8/CampusAppWP8/Model/Campusmap/MapModel.cs b/CampusAppWP8/CampusAppWP8/Model/Campusmap/MapModel.cs new file mode 100644 index 00000000..e425178e --- /dev/null +++ b/CampusAppWP8/CampusAppWP8/Model/Campusmap/MapModel.cs @@ -0,0 +1,62 @@ +//----------------------------------------------------------------------- +// +// Company copyright tag. +// +// stubbfel +// 20.06.2013 +//---------------------------------------------------------------------- +namespace CampusAppWP8.Model.Campusmap +{ + using System; + using System.Collections.Generic; + using System.Linq; + using System.Text; + using System.Threading.Tasks; + using System.Windows; + + + public class MapModel + { + + public MapModel() + { + } + + public string ImageSource { get; set; } + public double ImageWidth { get; set; } + public double ImageHeight { get; set; } + + public double MapOffsetX { get; set; } + public double MapOffsetY { get; set; } + + public Point RefPoint { get; set; } + + public Point GetMapPoint(double x, double y) + { + x += this.MapOffsetX; + y += this.MapOffsetY; + return new Point(x, y); + } + + public Point GetMapPoint(Point point) + { + + return this.GetMapPoint(point.X, point.Y); + } + + public Point GetMapFromRefPoint(Point point) + { + + return this.GetMapFromRefPoint(point.X, point.Y); + } + + public Point GetMapFromRefPoint(double x, double y) + { + x += this.RefPoint.X; + x += this.MapOffsetX; + y += this.RefPoint.Y; + y += this.MapOffsetY; + return new Point(x, y); + } + } +} diff --git a/CampusAppWP8/CampusAppWP8/Pages/Campusmap/CampusMapPage.xaml b/CampusAppWP8/CampusAppWP8/Pages/Campusmap/CampusMapPage.xaml index 3dec5811..def4011f 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Campusmap/CampusMapPage.xaml +++ b/CampusAppWP8/CampusAppWP8/Pages/Campusmap/CampusMapPage.xaml @@ -39,23 +39,25 @@ - + - - + + - + - - - + + + diff --git a/CampusAppWP8/CampusAppWP8/Pages/Campusmap/CampusMapPage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/Campusmap/CampusMapPage.xaml.cs index ca9aebd8..40f7e811 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Campusmap/CampusMapPage.xaml.cs +++ b/CampusAppWP8/CampusAppWP8/Pages/Campusmap/CampusMapPage.xaml.cs @@ -8,20 +8,39 @@ using System.Windows.Navigation; using Microsoft.Phone.Controls; using Microsoft.Phone.Shell; using System.Windows.Media; +using CampusAppWP8.Model.Campusmap; namespace CampusAppWP8.Pages.Campusmap { public partial class CampusMapPage : PhoneApplicationPage { + private MapModel map; public CampusMapPage() { InitializeComponent(); - test.SetValue(H, 800); - + this.map = new MapModel() { ImageSource = "/Assets/testmap.png", ImageWidth = 2000, ImageHeight = 2000, MapOffsetX = -228, MapOffsetY = -300, RefPoint = new Point(1000, 1000) }; + this.MapCanvas.DataContext = map; } private void PhoneApplicationPage_OrientationChanged(object sender, OrientationChangedEventArgs e) { + //test.ScrollToVerticalOffset(800); + } + + /// + /// Methods overrides the OnNavigatedTo-Method + /// + /// some NavigationEventArgs + protected override void OnNavigatedTo(NavigationEventArgs e) + { + base.OnNavigatedTo(e); + } + + private void Button_Click(object sender, RoutedEventArgs e) + { + Point scrollPoint = map.GetMapFromRefPoint(0,0); + MapScroller.ScrollToVerticalOffset(scrollPoint.Y); + MapScroller.ScrollToHorizontalOffset(scrollPoint.X); } } } \ No newline at end of file From 709f7fc289b0ea3e197f96781c37f905c8cc8e4c Mon Sep 17 00:00:00 2001 From: stubbfel Date: Fri, 21 Jun 2013 13:02:13 +0200 Subject: [PATCH 4/6] end of day2 #51 --- CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj | 1 + .../Model/Campusmap/MapPinModel.cs | 25 +++++++++++++++++++ .../Pages/Campusmap/CampusMapPage.xaml | 2 +- .../Pages/Campusmap/CampusMapPage.xaml.cs | 7 ++++++ 4 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 CampusAppWP8/CampusAppWP8/Model/Campusmap/MapPinModel.cs diff --git a/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj b/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj index ab5540fc..fa8f4720 100644 --- a/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj +++ b/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj @@ -98,6 +98,7 @@ + diff --git a/CampusAppWP8/CampusAppWP8/Model/Campusmap/MapPinModel.cs b/CampusAppWP8/CampusAppWP8/Model/Campusmap/MapPinModel.cs new file mode 100644 index 00000000..5f5374a2 --- /dev/null +++ b/CampusAppWP8/CampusAppWP8/Model/Campusmap/MapPinModel.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; + +namespace CampusAppWP8.Model.Campusmap +{ + public class MapPinModel + { + public MapPinModel() + { + } + + public string ImageSource { get; set; } + public double ImageWidth { get; set; } + public double ImageHeight { get; set; } + + public double MapOffsetX { get; set; } + public double MapOffsetY { get; set; } + + public Point Position { get; set; } + } +} diff --git a/CampusAppWP8/CampusAppWP8/Pages/Campusmap/CampusMapPage.xaml b/CampusAppWP8/CampusAppWP8/Pages/Campusmap/CampusMapPage.xaml index def4011f..698435f8 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Campusmap/CampusMapPage.xaml +++ b/CampusAppWP8/CampusAppWP8/Pages/Campusmap/CampusMapPage.xaml @@ -57,7 +57,7 @@ - + diff --git a/CampusAppWP8/CampusAppWP8/Pages/Campusmap/CampusMapPage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/Campusmap/CampusMapPage.xaml.cs index 40f7e811..570aeca0 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Campusmap/CampusMapPage.xaml.cs +++ b/CampusAppWP8/CampusAppWP8/Pages/Campusmap/CampusMapPage.xaml.cs @@ -9,6 +9,7 @@ using Microsoft.Phone.Controls; using Microsoft.Phone.Shell; using System.Windows.Media; using CampusAppWP8.Model.Campusmap; +using System.Windows.Media.Imaging; namespace CampusAppWP8.Pages.Campusmap { @@ -19,7 +20,13 @@ namespace CampusAppWP8.Pages.Campusmap { InitializeComponent(); this.map = new MapModel() { ImageSource = "/Assets/testmap.png", ImageWidth = 2000, ImageHeight = 2000, MapOffsetX = -228, MapOffsetY = -300, RefPoint = new Point(1000, 1000) }; + MapPinModel pin = new MapPinModel() { ImageSource = "/Assets/icons/search_159_light.png", ImageWidth = 60, ImageHeight = 60, MapOffsetX = -24, MapOffsetY = -24, Position = new Point(1000, 1000) }; + Image pinImg =new Image() { Source = new BitmapImage((new Uri(pin.ImageSource,UriKind.Relative))), Width = pin.ImageWidth}; + // this.MapCanvas.SetLeft(pinImg,500); this.MapCanvas.DataContext = map; + MapCanvas.Children.Add(pinImg); + Image img = new Image(); + } private void PhoneApplicationPage_OrientationChanged(object sender, OrientationChangedEventArgs e) From 7ee3fa55350577b276fa2a2d93f831905a54bac6 Mon Sep 17 00:00:00 2001 From: stubbfel Date: Mon, 24 Jun 2013 13:27:16 +0200 Subject: [PATCH 5/6] finish testmap --- .../CampusAppWP8/Model/Campusmap/MapModel.cs | 163 +++++++++++++++--- .../Model/Campusmap/MapPinModel.cs | 101 +++++++++-- .../Pages/Campusmap/CampusMapPage.xaml | 6 +- .../Pages/Campusmap/CampusMapPage.xaml.cs | 16 +- 4 files changed, 241 insertions(+), 45 deletions(-) diff --git a/CampusAppWP8/CampusAppWP8/Model/Campusmap/MapModel.cs b/CampusAppWP8/CampusAppWP8/Model/Campusmap/MapModel.cs index e425178e..11d1b322 100644 --- a/CampusAppWP8/CampusAppWP8/Model/Campusmap/MapModel.cs +++ b/CampusAppWP8/CampusAppWP8/Model/Campusmap/MapModel.cs @@ -1,62 +1,177 @@ //----------------------------------------------------------------------- -// +// // Company copyright tag. // // stubbfel -// 20.06.2013 +// 24.06.2013 //---------------------------------------------------------------------- namespace CampusAppWP8.Model.Campusmap { using System; - using System.Collections.Generic; - using System.Linq; - using System.Text; - using System.Threading.Tasks; using System.Windows; + using System.Windows.Controls; + using System.Windows.Media.Imaging; - + /// + /// This Class manage the properties of a Map + /// public class MapModel { + #region Constructors + /// + /// Initializes a new instance of the class. + /// public MapModel() { } + #endregion + + #region Property + + /// + /// Gets or sets the ImageSource of the map + /// public string ImageSource { get; set; } + + /// + /// Gets or sets the ImageWidth of the map + /// public double ImageWidth { get; set; } + + /// + /// Gets or sets the ImageHeight of the map + /// public double ImageHeight { get; set; } - public double MapOffsetX { get; set; } - public double MapOffsetY { get; set; } + /// + /// Gets or sets the ImageOffsetX of the map + /// + public double MapImageOffsetX { get; set; } + /// + /// Gets or sets the ImageOffsetY of the map + /// + public double MapImageOffsetY { get; set; } + + /// + /// Gets or sets the GeoOffsetX of the map + /// + public double GeoOffsetX { get; set; } + + /// + /// Gets or sets the GeoOffsetY of the map + /// + public double GeoOffsetY { get; set; } + + /// + /// Gets or sets the Scale (to pixel) of the map + /// + public double Scale { get; set; } + + /// + /// Gets or sets the reference point + /// public Point RefPoint { get; set; } - public Point GetMapPoint(double x, double y) + #endregion + + #region Methods + + /// + /// Method calculate the coordinates of ScrollToOffsets point + /// + /// input point + /// point (in pixel) + public Point GetScrollPoint(Point point) { - x += this.MapOffsetX; - y += this.MapOffsetY; + return this.GetScrollPoint(point.X, point.Y); + } + + /// + /// Method calculate the coordinates of ScrollToOffsets point + /// + /// the input-point will be shown in the center + /// x - coordinate + /// y - coordinate + /// point (in pixel) + public Point GetScrollPoint(double x, double y) + { + x = this.RefPoint.X + this.MapImageOffsetX + x; + y = this.RefPoint.Y + this.MapImageOffsetY - y; return new Point(x, y); } - public Point GetMapPoint(Point point) + /// + /// Method create in image, which can show at a certain position + /// + /// the x- coordinate + /// the y-coordinate + /// image of the pin + public Image AddPin(double x, double y) { - - return this.GetMapPoint(point.X, point.Y); + Point position = new Point(x, y); + return this.AddPin(position); } - public Point GetMapFromRefPoint(Point point) + /// + /// Method create in image, which can show at a certain position depend of the + /// + /// the x-coordinate + /// the y-coordinate + /// image of the pin + public Image AddPinFromRefPoint(double x, double y) { - - return this.GetMapFromRefPoint(point.X, point.Y); + Point position = new Point(this.RefPoint.X + x, this.RefPoint.Y - y); + return this.AddPin(position); } - public Point GetMapFromRefPoint(double x, double y) + /// + /// Method create in image, which can show at a certain position depend of the + /// + /// input point + /// image of the pin + public Image AddPinFromRefPoint(Point position) { - x += this.RefPoint.X; - x += this.MapOffsetX; - y += this.RefPoint.Y; - y += this.MapOffsetY; - return new Point(x, y); + return this.AddPinFromRefPoint(position.X, position.Y); } + + /// + /// Method create in image, which can show at a certain position + /// + /// input point + /// image of the pin + public Image AddPin(Point position) + { + MapPinModel pin = new MapPinModel() { Position = position }; + Image pinImg = new Image() { Source = new BitmapImage(new Uri(pin.ImageSource, UriKind.Relative)), Width = pin.ImageWidth }; + Canvas.SetTop(pinImg, pin.Position.Y); + Canvas.SetLeft(pinImg, pin.Position.X); + return pinImg; + } + + /// + /// Convert a coordinates to coordinates which address pixels + /// + /// the x-coordinate + /// the y-coordinate + /// Point in pixel-size + public Point ConverToPixelPoint(double x, double y) + { + return new Point { X = this.Scale * x, Y = this.Scale * y }; + } + + /// + /// Convert a coordinates to coordinates which address pixels + /// + /// not scaled point + /// Point in pixel-size + public Point ConverToPixelPoint(Point point) + { + return this.ConverToPixelPoint(point.X, point.Y); + } + + #endregion } } diff --git a/CampusAppWP8/CampusAppWP8/Model/Campusmap/MapPinModel.cs b/CampusAppWP8/CampusAppWP8/Model/Campusmap/MapPinModel.cs index 5f5374a2..8e9b131a 100644 --- a/CampusAppWP8/CampusAppWP8/Model/Campusmap/MapPinModel.cs +++ b/CampusAppWP8/CampusAppWP8/Model/Campusmap/MapPinModel.cs @@ -1,25 +1,106 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; - +//----------------------------------------------------------------------- +// +// Company copyright tag. +// +// stubbfel +// 24.06.2013 +//---------------------------------------------------------------------- namespace CampusAppWP8.Model.Campusmap { + using System.Windows; + + /// + /// This Class manage the properties of a MapPin + /// public class MapPinModel { + #region Member + + /// + /// Variable of the actual position of the pin + /// + private Point position; + + #endregion + #region Constructor + /// + /// Initializes a new instance of the class. + /// public MapPinModel() { + this.ImageSource = "/Assets/icons/search_159_light.png"; + this.ImageWidth = 60; + this.ImageHeight = 60; + this.PinImageOffsetX = -24; + this.PinImageOffsetY = -24; } + #endregion + + #region Property + + /// + /// Gets or sets the ImageSource of the pin + /// public string ImageSource { get; set; } + + /// + /// Gets or sets the ImageWidth of the pin + /// public double ImageWidth { get; set; } + + /// + /// Gets or sets the ImageHeight of the pin + /// public double ImageHeight { get; set; } - public double MapOffsetX { get; set; } - public double MapOffsetY { get; set; } + /// + /// Gets or sets the ImageOffsetX of the pin + /// + public double PinImageOffsetX { get; set; } - public Point Position { get; set; } + /// + /// Gets or sets the ImageOffsetY of the pin + /// + public double PinImageOffsetY { get; set; } + + /// + /// Gets or sets position of the pin + /// + public Point Position + { + get + { + return this.position; + } + + set + { + // null assert + if (value == null) + { + return; + } + + if (this.position == null) + { + this.position = value; + return; + } + + // check the x-value + if (value.X + this.PinImageOffsetX != this.position.X) + { + this.position.X = value.X + this.PinImageOffsetX; + } + + // check the y-value + if (value.Y + this.PinImageOffsetY != this.position.Y) + { + this.position.Y = value.Y + this.PinImageOffsetY; + } + } + } + #endregion } } diff --git a/CampusAppWP8/CampusAppWP8/Pages/Campusmap/CampusMapPage.xaml b/CampusAppWP8/CampusAppWP8/Pages/Campusmap/CampusMapPage.xaml index 698435f8..007f88af 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Campusmap/CampusMapPage.xaml +++ b/CampusAppWP8/CampusAppWP8/Pages/Campusmap/CampusMapPage.xaml @@ -35,11 +35,13 @@ + - - diff --git a/CampusAppWP8/CampusAppWP8/Pages/Campusmap/CampusMapPage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/Campusmap/CampusMapPage.xaml.cs index 570aeca0..2c6d8535 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Campusmap/CampusMapPage.xaml.cs +++ b/CampusAppWP8/CampusAppWP8/Pages/Campusmap/CampusMapPage.xaml.cs @@ -19,19 +19,13 @@ namespace CampusAppWP8.Pages.Campusmap public CampusMapPage() { InitializeComponent(); - this.map = new MapModel() { ImageSource = "/Assets/testmap.png", ImageWidth = 2000, ImageHeight = 2000, MapOffsetX = -228, MapOffsetY = -300, RefPoint = new Point(1000, 1000) }; - MapPinModel pin = new MapPinModel() { ImageSource = "/Assets/icons/search_159_light.png", ImageWidth = 60, ImageHeight = 60, MapOffsetX = -24, MapOffsetY = -24, Position = new Point(1000, 1000) }; - Image pinImg =new Image() { Source = new BitmapImage((new Uri(pin.ImageSource,UriKind.Relative))), Width = pin.ImageWidth}; - // this.MapCanvas.SetLeft(pinImg,500); + this.map = new MapModel() { ImageSource = "/Assets/testmap.png", ImageWidth = 2000, ImageHeight = 2000, MapImageOffsetX = -228, MapImageOffsetY = -300, RefPoint = new Point(1000, 1000), Scale = 20}; this.MapCanvas.DataContext = map; - MapCanvas.Children.Add(pinImg); - Image img = new Image(); } private void PhoneApplicationPage_OrientationChanged(object sender, OrientationChangedEventArgs e) { - //test.ScrollToVerticalOffset(800); } /// @@ -45,9 +39,13 @@ namespace CampusAppWP8.Pages.Campusmap private void Button_Click(object sender, RoutedEventArgs e) { - Point scrollPoint = map.GetMapFromRefPoint(0,0); + MapCanvas.Children.Clear(); + Point scrollPoint = map.GetScrollPoint(map.ConverToPixelPoint(double.Parse(XPoint.Text), double.Parse(YPoint.Text))); + MapCanvas.Children.Add(map.AddPinFromRefPoint(map.ConverToPixelPoint(double.Parse(XPoint.Text), double.Parse(YPoint.Text)))); + MapScroller.ScrollToVerticalOffset(scrollPoint.Y); - MapScroller.ScrollToHorizontalOffset(scrollPoint.X); + MapScroller.ScrollToHorizontalOffset(scrollPoint.X); + } } } \ No newline at end of file From 94a12f2a77260b52be72688c98976afb2d24ee2c Mon Sep 17 00:00:00 2001 From: stubbfel Date: Mon, 24 Jun 2013 13:50:24 +0200 Subject: [PATCH 6/6] change icon source of lecture and map --- CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj | 24 ------------------- .../Pages/Campusmap/CampusMapPage.xaml | 14 +++-------- .../Pages/Lecture/LecturePage.xaml | 3 +-- .../Pages/Lecture/LecturePage.xaml.cs | 4 ---- .../CampusAppWP8/Properties/WMAppManifest.xml | 2 +- 5 files changed, 5 insertions(+), 42 deletions(-) diff --git a/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj b/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj index fdc628fd..4e29b502 100644 --- a/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj +++ b/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj @@ -291,30 +291,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - PreserveNewest diff --git a/CampusAppWP8/CampusAppWP8/Pages/Campusmap/CampusMapPage.xaml b/CampusAppWP8/CampusAppWP8/Pages/Campusmap/CampusMapPage.xaml index 007f88af..2aa7d7f9 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Campusmap/CampusMapPage.xaml +++ b/CampusAppWP8/CampusAppWP8/Pages/Campusmap/CampusMapPage.xaml @@ -39,17 +39,12 @@ - - + + - @@ -57,9 +52,6 @@ - - - diff --git a/CampusAppWP8/CampusAppWP8/Pages/Lecture/LecturePage.xaml b/CampusAppWP8/CampusAppWP8/Pages/Lecture/LecturePage.xaml index d42a5df4..f0454ac3 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Lecture/LecturePage.xaml +++ b/CampusAppWP8/CampusAppWP8/Pages/Lecture/LecturePage.xaml @@ -159,8 +159,7 @@ diff --git a/CampusAppWP8/CampusAppWP8/Pages/Lecture/LecturePage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/Lecture/LecturePage.xaml.cs index 0a689cdc..779ba594 100644 --- a/CampusAppWP8/CampusAppWP8/Pages/Lecture/LecturePage.xaml.cs +++ b/CampusAppWP8/CampusAppWP8/Pages/Lecture/LecturePage.xaml.cs @@ -50,10 +50,6 @@ namespace CampusAppWP8.Pages.Lecture this.InitializeComponent(); this.LoadPageModel(); this.SetupListPickers(); - if ((Visibility)Application.Current.Resources["PhoneDarkThemeVisibility"] == Visibility.Visible) - { - this.SearchButtonImg.Source = new BitmapImage(new Uri("/Assets/icons/search_159_dark.png", UriKind.Relative)); - } } #endregion diff --git a/CampusAppWP8/CampusAppWP8/Properties/WMAppManifest.xml b/CampusAppWP8/CampusAppWP8/Properties/WMAppManifest.xml index 856d2330..f4b319d3 100644 --- a/CampusAppWP8/CampusAppWP8/Properties/WMAppManifest.xml +++ b/CampusAppWP8/CampusAppWP8/Properties/WMAppManifest.xml @@ -13,7 +13,7 @@ - +