107 lines
2.8 KiB
C#
107 lines
2.8 KiB
C#
//-----------------------------------------------------------------------
|
|
// <copyright file="MapPinModel.cs" company="BTU/IIT">
|
|
// Company copyright tag.
|
|
// </copyright>
|
|
// <author>stubbfel</author>
|
|
// <sience>24.06.2013</sience>
|
|
//----------------------------------------------------------------------
|
|
namespace CampusAppWP8.Model.Campusmap
|
|
{
|
|
using System.Windows;
|
|
|
|
/// <summary>
|
|
/// This Class manage the properties of a MapPin
|
|
/// </summary>
|
|
public class MapPinModel
|
|
{
|
|
#region Member
|
|
|
|
/// <summary>
|
|
/// Variable of the actual position of the pin
|
|
/// </summary>
|
|
private Point position;
|
|
|
|
#endregion
|
|
#region Constructor
|
|
/// <summary>
|
|
/// Initializes a new instance of the <see cref="MapPinModel" /> class.
|
|
/// </summary>
|
|
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
|
|
|
|
/// <summary>
|
|
/// Gets or sets the ImageSource of the pin
|
|
/// </summary>
|
|
public string ImageSource { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the ImageWidth of the pin
|
|
/// </summary>
|
|
public double ImageWidth { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the ImageHeight of the pin
|
|
/// </summary>
|
|
public double ImageHeight { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the ImageOffsetX of the pin
|
|
/// </summary>
|
|
public double PinImageOffsetX { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the ImageOffsetY of the pin
|
|
/// </summary>
|
|
public double PinImageOffsetY { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets position of the pin
|
|
/// </summary>
|
|
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
|
|
}
|
|
}
|