SignalR client hosted in a WPF application. The client lets the user pick a user name, connect to the server asynchronously to not block the UI thread, and send chat messages to all connected clients whether they are hosted in WinForms, WPF, or a web application. For simplicity, MVVM will not be used for this sample.
Inheritance: System.Windows.Window
Exemplo n.º 1
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.Main = ((WPFClient.MainWindow)(target));
                return;

            case 2:
                this.Titlebar = ((System.Windows.Controls.Grid)(target));
                return;

            case 3:
                this.TitleBar = ((System.Windows.Shapes.Rectangle)(target));
                return;

            case 4:
                this.CloseButton = ((System.Windows.Shapes.Rectangle)(target));
                return;

            case 5:
                this.WindowStateButton = ((System.Windows.Shapes.Rectangle)(target));
                return;

            case 6:
                this.MinimiseButton = ((System.Windows.Shapes.Rectangle)(target));
                return;

            case 7:
                this.WindowTitle = ((System.Windows.Controls.Label)(target));
                return;

            case 8:
                this.LbChat = ((System.Windows.Controls.ListBox)(target));
                return;

            case 9:
                this.TxbInput = ((System.Windows.Controls.TextBox)(target));

            #line 52 "..\..\MainWindow.xaml"
                this.TxbInput.KeyDown += new System.Windows.Input.KeyEventHandler(this.TxbInput_KeyDown);

            #line default
            #line hidden
                return;

            case 10:
                this.ListBoxOnline = ((System.Windows.Controls.ListBox)(target));
                return;
            }
            this._contentLoaded = true;
        }
Exemplo n.º 2
0
 public MainWindow()
 {
     _reference = this;
     InitializeComponent();
 }