Ejemplo n.º 1
0
 public void Connect()
 {
     // Connect to the server-side view model.
     _dotnetify.ConnectAsync(
         nameof(HelloWorldVM),
         this,
         new VMConnectOptions {
         VMArg = new { Greetings = "Hello World!" }
     }
         );
 }
Ejemplo n.º 2
0
        public async Task ConnectAsync()
        {
            // Connect to the server-side view model.
            await _dotnetify.ConnectAsync(
                nameof(HelloWorldVM),
                this,
                new VMConnectOptions { VMArg = new { Greetings = "Hello World!" } }
                );

            _hubProxy.StateChanged += async(sender, state) =>
            {
                if (state == HubConnectionState.Connected)
                {
                    Dispose();
                    await ConnectAsync();
                }
            };
        }