You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
97 lines
2.5 KiB
97 lines
2.5 KiB
using Business;
|
|
using Modèle;
|
|
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.Data;
|
|
using System.Windows.Documents;
|
|
using System.Windows.Input;
|
|
using System.Windows.Media;
|
|
using System.Windows.Media.Imaging;
|
|
using System.Windows.Navigation;
|
|
using System.Windows.Shapes;
|
|
|
|
namespace WpfApp1
|
|
{
|
|
/// <summary>
|
|
/// Logique d'interaction pour UserControlPosition.xaml
|
|
/// </summary>
|
|
public partial class UserControlPosition : UserControl
|
|
{
|
|
/// <summary>
|
|
/// Le userControl que l'on aurait utilisé pour afficher les zones des requins sur la carte
|
|
/// </summary>
|
|
public UserControlPosition()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
|
|
private Position _pos;
|
|
/// <summary>
|
|
/// Position qui permet de mettre à jour l'affichage
|
|
/// </summary>
|
|
public Position position
|
|
{
|
|
get { return _pos; }
|
|
set
|
|
{
|
|
_pos = value;
|
|
UpdateUi(_pos);
|
|
}
|
|
}
|
|
|
|
private double _widthImage;
|
|
/// <summary>
|
|
/// La largeur de la carte
|
|
/// </summary>
|
|
public double widthImage
|
|
{
|
|
get { return _widthImage; }
|
|
set
|
|
{
|
|
_widthImage = value;
|
|
}
|
|
}
|
|
private double _heightImage;
|
|
|
|
/// <summary>
|
|
/// La hauteur de la carte
|
|
/// </summary>
|
|
public double heightImage
|
|
{
|
|
get { return _heightImage; }
|
|
set
|
|
{
|
|
_heightImage = value;
|
|
}
|
|
}
|
|
|
|
|
|
private void Ellipse_MouseDown(object sender, MouseButtonEventArgs e)
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
private void UpdateUi(Position pos)
|
|
{
|
|
|
|
double middleWidth = widthImage / 2;
|
|
double middleHeight = heightImage / 2;
|
|
double coefWidth = widthImage/90;
|
|
double coefHeight = heightImage/90;
|
|
Canvas.SetTop(Ellipse, middleHeight + coefHeight * pos.LattitudeFin);
|
|
Canvas.SetLeft(Ellipse, middleWidth + coefWidth * pos.LongitudeDeb);
|
|
Ellipse.Width = (pos.LongitudeFin - pos.LongitudeDeb) * coefWidth;
|
|
Ellipse.Height = (pos.LattitudeFin - pos.LattitudeDeb) * coefHeight;
|
|
Ellipse.Fill = System.Windows.Media.Brushes.Red;
|
|
}
|
|
}
|
|
}
|