Small fixes for UWP apps, mainly polish.

-Move command button in status bar
-fix a ui thread exception
-clean up Publisher server list
This commit is contained in:
Martin Regen
2016-09-19 14:04:41 +02:00
parent 9cfd122255
commit 92ff201f4e
5 changed files with 41 additions and 32 deletions
@@ -33,6 +33,7 @@ using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using Windows.UI.Core;
using Windows.UI.Xaml.Controls;
namespace Opc.Ua.Client.Controls
@@ -190,12 +191,23 @@ namespace Opc.Ua.Client.Controls
// return new item.
return listItem;
}
/// <summary>
/// Updates the list of servers displayed in the control.
/// </summary>
private void OnUpdateServers(object state)
private async void OnUpdateServers(object state)
{
if (!Dispatcher.HasThreadAccess)
{
await Dispatcher.RunAsync(
CoreDispatcherPriority.Normal,
() =>
{
OnUpdateServers(state);
});
return;
}
ItemsLV.Items.Clear();
ApplicationDescriptionCollection servers = state as ApplicationDescriptionCollection;
@@ -7,8 +7,8 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" >
<ComboBox x:Name="EndpointCB" KeyDown="EndpointCB_KeyDown" HorizontalAlignment="Stretch" Margin="10,10,110,0" VerticalAlignment="Top" SelectionChanged="EndpointCB_SelectionChanged" PointerPressed="EndpointCB_PointerPressed"/>
<ComboBox x:Name="EndpointCB" KeyDown="EndpointCB_KeyDown" HorizontalAlignment="Stretch" Margin="10,10,120,0" VerticalAlignment="Top" SelectionChanged="EndpointCB_SelectionChanged" PointerPressed="EndpointCB_PointerPressed"/>
<Button x:Name="ConnectB" Content="Connect" HorizontalAlignment="Right" Height="30" VerticalAlignment="Top" Width="100" Margin="0,10,10,0" Click="ConnectButton_Click" />
<TextBox x:Name="InputTB" HorizontalAlignment="Stretch" Margin="10,10,110,0" TextWrapping="Wrap" Text="TextBox" VerticalAlignment="Top" Visibility="Collapsed" LostFocus="InputTB_LostFocus" KeyDown="InputTB_KeyDown"/>
<TextBox x:Name="InputTB" HorizontalAlignment="Stretch" Margin="10,10,120,0" TextWrapping="Wrap" Text="TextBox" VerticalAlignment="Top" Visibility="Collapsed" LostFocus="InputTB_LostFocus" KeyDown="InputTB_KeyDown"/>
</Grid>
</UserControl>