Fix server-client connection.

This commit is contained in:
Burak Kaan Köse
2024-07-17 00:20:40 +02:00
parent 06d85594d8
commit ad1c7e1fd3
7 changed files with 72 additions and 48 deletions

View File

@@ -11,7 +11,6 @@ namespace Wino.Server
{
base.OnStartup(e);
//create the notifyicon (it's a resource declared in NotifyIconResources.xaml
notifyIcon = (TaskbarIcon)FindResource("NotifyIcon");
notifyIcon.ForceCreate(enablesEfficiencyMode: true);
}

View File

@@ -1,6 +1,7 @@
using System;
using Windows.ApplicationModel;
using Windows.ApplicationModel.AppService;
using Windows.Foundation.Collections;
namespace Wino.Server
{
@@ -35,6 +36,13 @@ namespace Wino.Server
}
}
public async void SendMessage()
{
var set = new ValueSet();
set.Add("Hello", "World");
await connection.SendMessageAsync(set);
}
private void OnConnectionClosed(AppServiceConnection sender, AppServiceClosedEventArgs args)
{
// TODO: Handle connection closed.

View File

@@ -11,6 +11,7 @@ namespace Wino.Server
[RelayCommand]
public void LaunchWino()
{
_context.SendMessage();
}
/// <summary>