Sample fixes

This commit is contained in:
Morten Nielsen 2020-01-28 22:56:18 -08:00
parent dcfa839fa2
commit 61e54f1799
9 changed files with 32 additions and 32 deletions

View file

@ -1,4 +1,4 @@
<UserControl x:Class="SampleApp.WinDesktop.GpggaControl"
<UserControl x:Class="SampleApp.WinDesktop.GgaControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
@ -8,7 +8,7 @@
d:DesignHeight="300" d:DesignWidth="300">
<StackPanel DataContext="{Binding RelativeSource={RelativeSource AncestorType=UserControl}, Path=Message}">
<Border Background="CornflowerBlue" Padding="10" Margin="-10,-10,-10,5">
<TextBlock Text="GPGGA" FontSize="20" FontWeight="Bold" Foreground="White" />
<TextBlock Text="{Binding MessageType}" FontSize="20" FontWeight="Bold" Foreground="White" />
</Border>
<TextBlock Text="Location:" FontWeight="Bold" />
<TextBlock Text="{Binding Latitude, Mode=OneTime}" />

View file

@ -17,22 +17,22 @@ using System.Windows.Shapes;
namespace SampleApp.WinDesktop
{
/// <summary>
/// Interaction logic for GpggaControl.xaml
/// Interaction logic for GgaControl.xaml
/// </summary>
public partial class GpggaControl : UserControl
public partial class GgaControl : UserControl
{
public GpggaControl()
public GgaControl()
{
InitializeComponent();
}
public Gga Message
{
get { return (Gga)GetValue(GpggaProperty); }
set { SetValue(GpggaProperty, value); }
get { return (Gga)GetValue(MessageProperty); }
set { SetValue(MessageProperty, value); }
}
public static readonly DependencyProperty GpggaProperty =
DependencyProperty.Register("Message", typeof(Gga), typeof(GpggaControl), new PropertyMetadata(null));
public static readonly DependencyProperty MessageProperty =
DependencyProperty.Register(nameof(Message), typeof(Gga), typeof(GgaControl), new PropertyMetadata(null));
}
}

View file

@ -1,4 +1,4 @@
<UserControl x:Class="SampleApp.WinDesktop.GpgllControl"
<UserControl x:Class="SampleApp.WinDesktop.GllControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
@ -8,7 +8,7 @@
d:DesignHeight="300" d:DesignWidth="300">
<StackPanel DataContext="{Binding RelativeSource={RelativeSource AncestorType=UserControl}, Path=Message}">
<Border Background="CornflowerBlue" Padding="10" Margin="-10,-10,-10,5">
<TextBlock Text="GPGLL" FontSize="20" FontWeight="Bold" Foreground="White" />
<TextBlock Text="{Binding MessageType}" FontSize="20" FontWeight="Bold" Foreground="White" />
</Border>
<TextBlock Text="Location:" FontWeight="Bold" />
<TextBlock Text="{Binding Latitude, Mode=OneTime}" />

View file

@ -19,9 +19,9 @@ namespace SampleApp.WinDesktop
/// <summary>
/// Interaction logic for GpgllControl.xaml
/// </summary>
public partial class GpgllControl : UserControl
public partial class GllControl : UserControl
{
public GpgllControl()
public GllControl()
{
InitializeComponent();
}
@ -33,6 +33,6 @@ namespace SampleApp.WinDesktop
}
public static readonly DependencyProperty MessageProperty =
DependencyProperty.Register("Message", typeof(Gll), typeof(GpgllControl), new PropertyMetadata(null));
DependencyProperty.Register(nameof(Message), typeof(Gll), typeof(GllControl), new PropertyMetadata(null));
}
}

View file

@ -1,4 +1,4 @@
<UserControl x:Class="SampleApp.WinDesktop.GpgsaControl"
<UserControl x:Class="SampleApp.WinDesktop.GsaControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
@ -8,7 +8,7 @@
d:DesignHeight="300" d:DesignWidth="300">
<StackPanel DataContext="{Binding RelativeSource={RelativeSource AncestorType=UserControl}, Path=Message}">
<Border Background="CornflowerBlue" Padding="10" Margin="-10,-10,-10,5">
<TextBlock Text="GPGSA" FontSize="20" FontWeight="Bold" Foreground="White" />
<TextBlock Text="{Binding MessageType}" FontSize="20" FontWeight="Bold" Foreground="White" />
</Border>
<local:KeyValuePairControl Header="GPS Mode: " Value="{Binding Mode}"/>
<local:KeyValuePairControl Header="Fix Mode: " Value="{Binding Fix, Mode=OneTime}" />

View file

@ -19,20 +19,20 @@ namespace SampleApp.WinDesktop
/// <summary>
/// Interaction logic for GpgsaControl.xaml
/// </summary>
public partial class GpgsaControl : UserControl
public partial class GsaControl : UserControl
{
public GpgsaControl()
public GsaControl()
{
InitializeComponent();
}
public Gsa Message
{
get { return (Gsa)GetValue(GpgsaProperty); }
set { SetValue(GpgsaProperty, value); }
get { return (Gsa)GetValue(MessageProperty); }
set { SetValue(MessageProperty, value); }
}
public static readonly DependencyProperty GpgsaProperty =
DependencyProperty.Register("Message", typeof(Gsa), typeof(GpgsaControl), new PropertyMetadata(null));
public static readonly DependencyProperty MessageProperty =
DependencyProperty.Register(nameof(Message), typeof(Gsa), typeof(GsaControl), new PropertyMetadata(null));
}
}

View file

@ -23,10 +23,10 @@
<TabItem Header="GPS Info">
<ScrollViewer HorizontalScrollBarVisibility="Disabled" Background="#FFEEEEEE">
<WrapPanel x:Name="MessagePanel">
<local:GprmcControl x:Name="gprmcView" Style="{StaticResource card}" Visibility="{Binding Message, ElementName=gprmcView, Converter={StaticResource nullConv}}" />
<local:GpggaControl x:Name="gpggaView" Style="{StaticResource card}" Visibility="{Binding Message, ElementName=gpggaView, Converter={StaticResource nullConv}}" />
<local:GpgsaControl x:Name="gpgsaView" Style="{StaticResource card}" Visibility="{Binding Message, ElementName=gpgsaView, Converter={StaticResource nullConv}}" />
<local:GpgllControl x:Name="gpgllView" Style="{StaticResource card}" Visibility="{Binding Message, ElementName=gpgllView, Converter={StaticResource nullConv}}" />
<local:RmcControl x:Name="gprmcView" Style="{StaticResource card}" Visibility="{Binding Message, ElementName=gprmcView, Converter={StaticResource nullConv}}" />
<local:GgaControl x:Name="gpggaView" Style="{StaticResource card}" Visibility="{Binding Message, ElementName=gpggaView, Converter={StaticResource nullConv}}" />
<local:GsaControl x:Name="gpgsaView" Style="{StaticResource card}" Visibility="{Binding Message, ElementName=gpgsaView, Converter={StaticResource nullConv}}" />
<local:GllControl x:Name="gpgllView" Style="{StaticResource card}" Visibility="{Binding Message, ElementName=gpgllView, Converter={StaticResource nullConv}}" />
<local:PgrmeControl x:Name="pgrmeView" Style="{StaticResource card}" Visibility="{Binding Message, ElementName=pgrmeView, Converter={StaticResource nullConv}}" />
</WrapPanel>
</ScrollViewer>

View file

@ -1,4 +1,4 @@
<UserControl x:Class="SampleApp.WinDesktop.GprmcControl"
<UserControl x:Class="SampleApp.WinDesktop.RmcControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
@ -8,7 +8,7 @@
d:DesignHeight="300" d:DesignWidth="300">
<StackPanel DataContext="{Binding RelativeSource={RelativeSource AncestorType=UserControl}, Path=Message}">
<Border Background="CornflowerBlue" Padding="10" Margin="-10,-10,-10,5">
<TextBlock Text="GPRMC" FontSize="20" FontWeight="Bold" Foreground="White" />
<TextBlock Text="{Binding MessageType}" FontSize="20" FontWeight="Bold" Foreground="White" />
</Border>
<TextBlock Text="Location:" FontWeight="Bold" />
<TextBlock Text="{Binding Latitude, Mode=OneTime}" />

View file

@ -17,11 +17,11 @@ using System.Windows.Shapes;
namespace SampleApp.WinDesktop
{
/// <summary>
/// Interaction logic for GprmcControl.xaml
/// Interaction logic for RmcControl.xaml
/// </summary>
public partial class GprmcControl : UserControl
public partial class RmcControl : UserControl
{
public GprmcControl()
public RmcControl()
{
InitializeComponent();
}
@ -33,6 +33,6 @@ namespace SampleApp.WinDesktop
}
public static readonly DependencyProperty MessageProperty =
DependencyProperty.Register("Message", typeof(Rmc), typeof(GprmcControl), new PropertyMetadata(null));
DependencyProperty.Register(nameof(Message), typeof(Rmc), typeof(RmcControl), new PropertyMetadata(null));
}
}