示例#1
0
        public MainWindow(string[] args)
        {
            //Disconnect Finsemble properly if Unhandled Exception happens. Otherwise you can disrupt your workspace.
            Application.Current.DispatcherUnhandledException += Current_DispatcherUnhandledException;

            //Example how to handle window closing event
            Closing += MainWindow_Closing;

            //Ensure that your window has been created (so that its window handle exists) before connecting to Finsemble.
            var handle = new WindowInteropHelper(this).EnsureHandle();

            FSBL               = new FinsembleWPF(this, handle.ToString("X"), args); // Finsemble needs the command line arguments to connect and also this Window handle to manage snapping, docking etc.
            FSBL.Connected    += Finsemble_Connected;
            FSBL.Disconnected += FSBL_Disconnected;
            var connectTask = FSBL.Connect("WPFExampleCore", JWK);
        }
 /// <summary>
 /// The ConnectToFinsemble.
 /// </summary>
 /// <param name="args">Command line parameters <see cref="string"/>.</param>
 private async void ConnectToFinsemble(string[] args)
 {
     FSBL            = new FinsembleWPF(this, new WindowInteropHelper(this).Handle.ToString("X"), args);
     FSBL.Connected += Finsemble_Connected;
     await FSBL.Connect("WPFMultiWindowExampleCore", JWK);
 }