WPF+WCF Step by step Create audio Chat room (ii): text chat and whiteboard sharing

Source: Internet
Author: User
Tags xmlns

This article will describe the implementation of the WPF UI and duplex communication in WCF. Realize the chat function of the text part and realize the function of sharing whiteboard.

Painting the WPF interface is actually a hassle. Although WPF, like WindowsForm, can drag a control anywhere, it is there. We are developing asp.net projects from the original table layout, to the current popular div+css layout. These require careful design by designers. The layout of this program I use grid and StackPanel two ways. Gird HTML-like table layout, StackPanel is just like its literal "stack panel".

UI implementations for WPF

First, create a new WPF application and rename it to Zqlchart. Add a UserControl to implement the login form, which is a stackpanel layout. The XAML code is as follows:

<usercontrol x:class= "Zqlchart.logincontrol"
Xmlns= "Http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x= "Http://schemas.microsoft.com/winfx/2006/xaml"
"210" width= "height=" loaded= "usercontrol_loaded" >
<StackPanel>
<border height= "borderbrush=" "#FFFFFFFF" borderthickness= "2,2,2,0" cornerradius= "5,5,0,0" >
<Border.Background>
<lineargradientbrush endpoint= "0.713,0.698" startpoint= "0.713,-0.139" >
<gradientstop color= "#FFFFFFFF" offset= "0.933"/>
<gradientstop color= "LightBlue" offset= "0.337"/>
</LinearGradientBrush>
</Border.Background>
<stackpanel name= "Infopanel" orientation= "Vertical" margin= "10,10,10,10" >
<stackpanel name= "Typepanel" orientation= "Horizontal" >
<radiobutton name= "Chattypeserver" fontsize= "margin=" "80,0,20,0"
Checked= "chattypeserver_checked" verticalcontentalignment= "Center" > Server </RadioButton>
<radiobutton name= "chattypeclient" fontsize= "checked=" chattypeclient_checked "verticalcontentalignment=" Center "> Client </RadioButton>
</StackPanel>
<stackpanel name= "Serverpanel" orientation= "horizontal" margin= "0,10,0,0" >
<label name= "Lblserver" fontsize= "width=" horizontalcontentalignment= "right" verticalcontentalignment= " Center "> Service end:</label>
<textbox height= "name=" Txtserver width= "160" fontsize= "Center" verticalcontentalignment=
</StackPanel>
<stackpanel name= "Usernamepanel" orientation= "horizontal" margin= "0,10,0,10" >
<label name= "Lblusername" fontsize= "width=" horizontalcontentalignment= "right" > Username:</label>
<textbox height= "name=" txtUserName width= "160" fontsize= "Center" verticalcontentalignment=
</StackPanel>
<stackpanel name= "Buttonpanel" orientation= "horizontal" horizontalalignment= "center" verticalalignment= "center" >
<button name= "Btnlogin" width= "fontsize=" margin= "10,10,10,10" click= "Btnlogin_click" > Connection </Button >
<button name= "Btncancel" width= "fontsize=" margin= "10,10,10,10" click= "Btncancel_click" > Cancel </Button >
</StackPanel>
</StackPanel>
</Border>
</StackPanel>
</UserControl>

The interface effect is as follows:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.