NmeaParser/src/SampleApp.WinDesktop/GsaControl.xaml.cs

47 lines
1.2 KiB
C#
Raw Normal View History

using NmeaParser.Messages;
2014-11-15 09:10:24 +01:00
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 SampleApp.WinDesktop
{
/// <summary>
2020-01-29 07:56:18 +01:00
/// Interaction logic for GpgsaControl.xaml
2014-11-15 09:10:24 +01:00
/// </summary>
2020-01-29 07:56:18 +01:00
public partial class GsaControl : UserControl
2014-11-15 09:10:24 +01:00
{
2020-01-29 07:56:18 +01:00
public GsaControl()
2014-11-15 09:10:24 +01:00
{
InitializeComponent();
}
2020-01-29 07:56:18 +01:00
public Gsa Message
2014-11-15 09:10:24 +01:00
{
2020-01-29 07:56:18 +01:00
get { return (Gsa)GetValue(MessageProperty); }
2014-11-15 09:10:24 +01:00
set { SetValue(MessageProperty, value); }
}
public static readonly DependencyProperty MessageProperty =
2020-07-29 22:24:05 +02:00
DependencyProperty.Register(nameof(Message), typeof(Gsa), typeof(GsaControl), new PropertyMetadata(null, (d, e) => ((GsaControl)d).OnGsaPropertyChanged(e)));
private void OnGsaPropertyChanged(DependencyPropertyChangedEventArgs e)
{
if (Message == null)
vehicles.Value = null;
else
vehicles.Value = string.Join(",", Message?.SatelliteIDs);
2020-07-29 22:24:05 +02:00
}
}
2014-11-15 09:10:24 +01:00
}