怎么用WPF实现微信公众号多客服功能-创新互联-成都快上网建站

怎么用WPF实现微信公众号多客服功能-创新互联

这篇文章给大家分享的是有关怎么用WPF实现微信公众号多客服功能的内容。小编觉得挺实用的,因此分享给大家做个参考,一起跟随小编过来看看吧。

为铜梁等地区用户提供了全套网页设计制作服务,及铜梁网站建设行业解决方案。主营业务为成都做网站、网站建设、铜梁网站设计,以传统方式定制建设网站,并提供域名空间备案等一条龙服务,秉承以专业、用心的态度为用户提供真诚的服务。我们深信只要达到每一位用户的要求,就会得到认可,从而选择与我们长期合作。这样,我们也可以走得更远!

原文标题:用WPF实现微信公众号多客服功能

简介:

这是利用WPF作为前端技术,实现桌面版微信多客服系统。项目采用Prism作为前端框架,采用MVVM模式好的对UI和逻辑代码分离,使用MefBootstrapper集成的MEF IOC容器,解耦各模块对象。合理利用 IEventAggregator 实现事件和交互。文章在介绍对应功能时候会给出相关实现的参考,读者可以参考改进,引入到自己的项目中。

程序运行界面及功能预览:

怎么用WPF实现微信公众号多客服功能

一、登陆:

功能:支持记住用户和用户设置,可选择记住用户密码。

怎么用WPF实现微信公众号多客服功能

实现相关:

自定义登陆窗口,引入Microsoft.Windows.Shell。可参考 WPF Custom Chrome Library 和  MSDN WindowChrome Class 有相关自定义窗口实现。

最小化、较大化、关闭按钮功能实现可参考上面的例子。

登陆按钮,自定义Style,重写Button的Template,参考代码如下:

怎么用WPF实现微信公众号多客服功能怎么用WPF实现微信公众号多客服功能

 
        
            
                
                    
                        
                        
                        
                    
                    
                        
                            
                            
                        
                        
                            
                            
                        
                    
                
            
        
    

View Code

记住密码,采用 XmlSerializer 把用户信息序列化到本地xml配置文件中,程序启动时加载该xml配置文件。用法 MSDN XmlSerializer


二、聊天窗口,信息发送

功能:文字发送,表情发送,图片发送,屏幕截图,快捷回复

怎么用WPF实现微信公众号多客服功能

RichTextBox 相关实现:文字,表情,图片所有输入都是在富文本框 里实现,因此针对 TextChanged 事件对输入进行一系列处理。

文字:不用做任何处理。

表情:文本框里输入的是表情的转义符号,然后根据转义符号找到对应表情图片进行替换。InlineUIContainer

Gif 动态图:WPF中不支持Gif,所以要编写自定义用户控件作为用来显示gif表情。参考 周银辉 [WPF疑难]在WPF中显示动态GIF

怎么用WPF实现微信公众号多客服功能

截图功能:源码在网上找到的,是Winform的一个截图。做了小许修改引进到项目。

参考:C# 实现完整功能的截图控件(4)-完整版 http://www.php.cn/

三、客户列表

控件为 TabControl,重写了TabControl 的Style 和 TabItem的Style

怎么用WPF实现微信公众号多客服功能怎么用WPF实现微信公众号多客服功能

    
        
        
        
        
        
        
            
                
                    
                        
                            
                            
                        
                        
                            
                            
                        
                        
                        
                            
                        
                    
                    
                        
                            
                        
                    
                
            
        
    

    
        
        
        
        
        
        
        
            
                
                    
                        
                            
                                
                                
                                    
                                
                            
                        
                    
                    
                        
                            
                        
                        
                            
                            
                            
                            
                        
                        
                            
                                
                                
                            
                            
                        

                    
                
            
        
    

View Code

怎么用WPF实现微信公众号多客服功能

四、快捷回复面板

应用 TreeView 加 HierarchicalDataTemplate 实现树形列表。

怎么用WPF实现微信公众号多客服功能

五、转接客户

自定义转接客户窗口,样式Xaml代码如下:

怎么用WPF实现微信公众号多客服功能怎么用WPF实现微信公众号多客服功能


                        
                        
                        
                            
                                
                                    
                                        
                                            
                                            
                                        
                                        
                                            
                                                
                                                    
                                                    
                                                
                                            
                                            
                                                
                                                
                                                    
                                                    
                                                        
                                                    
                                                
                                            
                                        

                                        
                                            
                                                
                                            
                                        
                                    
                                
                            
                        
                    

View Code

转接客户列表,样式Xaml代码如下:

怎么用WPF实现微信公众号多客服功能怎么用WPF实现微信公众号多客服功能

    
        
        
        
        
        
        
        
        
        
            
                
                    
                        
                            
                                
                                    
                                        
                                        
                                        
                                    
                                    状态
                                    工号
                                    昵称
                                
                            
                            
                                
                            
                        
                    
                    
                        
                            
                        
                    
                
            
        
    
    
        
        
        
        
        
            
                
                    
                        
                            
                                
                                
                                
                            

                            
                                
                                    
                                        
                                        
                                    
                                
                                
                            
                            
                                
                            
                            
                                
                            
                        
                    
                    
                        
                            
                            
                        
                        
                            
                                
                                
                            
                            
                        
                        
                            
                        
                    
                
            
        
    

View Code

怎么用WPF实现微信公众号多客服功能

关于以上控件的事件与命令,引进System.Windows.Interactivity.

在Xmal中导入命名控件 xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"

使用代码如下:

怎么用WPF实现微信公众号多客服功能怎么用WPF实现微信公众号多客服功能

                
                    
                        
                            
                        
                    
                

View Code

系统运行截图:

怎么用WPF实现微信公众号多客服功能

感谢各位的阅读!关于“怎么用WPF实现微信公众号多客服功能”这篇文章就分享到这里了,希望以上内容可以对大家有一定的帮助,让大家可以学到更多知识,如果觉得文章不错,可以把它分享出去让更多的人看到吧!


当前文章:怎么用WPF实现微信公众号多客服功能-创新互联
分享网址:http://kswjz.com/article/copdpj.html
扫二维码与项目经理沟通

我们在微信上24小时期待你的声音

解答本文疑问/技术咨询/运营咨询/技术建议/互联网交流