WPF显示富文本emoji表情+文本(类似微信)

祝大家端午节安康!

WPF开发者QQ群: 340500857 

前言 

      有小伙伴需要实现类似微信一样的气泡聊天emoji表情+文本。

欢迎转发、分享、点赞,谢谢大家~。  

效果预览(更多效果请下载源码体验):

一、EmojiAndTextControl.cs代码如下:

/**Github https://github.com/yanjinhuagood/WPFDevelopers.git码云 https://gitee.com/yanjinhua/WPFDevelopers.git**/
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Shapes;namespace WpfChatEmojiText
{[TemplatePart(Name = TextBlockTemplateName, Type = typeof(TextBlock))][TemplatePart(Name = WrapPanelLeftTemplateName, Type = typeof(WrapPanel))][TemplatePart(Name = BorderTemplateName, Type = typeof(Border))][TemplatePart(Name = WrapPanelRightTemplateName, Type = typeof(WrapPanel))][TemplatePart(Name = ImageBrushLeftTemplateName, Type = typeof(ImageBrush))][TemplatePart(Name = ImageBrushRightTemplateName, Type = typeof(ImageBrush))]public class EmojiAndTextControl: Control{private static readonly Type _typeofSelf = typeof(EmojiAndTextControl);private const string TextBlockTemplateName = "PART_TextBlock";private const string WrapPanelLeftTemplateName = "PART_Left";private const string BorderTemplateName = "PART_Border";private const string WrapPanelRightTemplateName = "PART_Right";private const string ImageBrushLeftTemplateName = "LeftUser";private const string ImageBrushRightTemplateName = "RightUser";private TextBlock m_textBlock;private WrapPanel leftWrapPanel;private Border border;private WrapPanel rightWrapPanel;private ImageBrush leftImageBrush;private ImageBrush rightImageBrush;private bool m_IgnoreChanges = false;public string Text{get { return (string)GetValue(TextProperty); }set { SetValue(TextProperty, value); }}static EmojiAndTextControl(){DefaultStyleKeyProperty.OverrideMetadata(_typeofSelf, new FrameworkPropertyMetadata(_typeofSelf));}public override void OnApplyTemplate(){base.OnApplyTemplate();m_textBlock = GetTemplateChild(TextBlockTemplateName) as TextBlock;leftWrapPanel = GetTemplateChild(WrapPanelLeftTemplateName) as WrapPanel;border = GetTemplateChild(BorderTemplateName) as Border;rightWrapPanel = GetTemplateChild(WrapPanelRightTemplateName) as WrapPanel;leftImageBrush = GetTemplateChild(ImageBrushLeftTemplateName) as ImageBrush;rightImageBrush = GetTemplateChild(ImageBrushRightTemplateName) as ImageBrush;UpdateEmoji();UpdateIsRight();UpdateRightImageSource();UpdateLeftImageSource();}public static readonly DependencyProperty TextProperty =DependencyProperty.Register("Text", typeof(string), typeof(EmojiAndTextControl),new UIPropertyMetadata(string.Empty, OnTextChanged));static void OnTextChanged(DependencyObject d, DependencyPropertyChangedEventArgs e){EmojiAndTextControl emoji = (EmojiAndTextControl)d;emoji.UpdateEmoji();}void UpdateEmoji(){if (m_textBlock == null) return;if (!m_IgnoreChanges){m_IgnoreChanges = true;//EmojiHelper.ParseText(m_textBlock);EmojiHelperLibrary.EmojiHelper.Instance.ParseText(m_textBlock);m_IgnoreChanges = false;}}public bool IsRight{get { return (bool)GetValue(IsRightProperty); }set { SetValue(IsRightProperty, value); }}public static readonly DependencyProperty IsRightProperty =DependencyProperty.Register("IsRight", typeof(bool), typeof(EmojiAndTextControl), new UIPropertyMetadata(OnIsRightChanged));static void OnIsRightChanged(DependencyObject d, DependencyPropertyChangedEventArgs e){EmojiAndTextControl control = (EmojiAndTextControl)d;control.UpdateIsRight();}void UpdateIsRight(){if (leftWrapPanel == null||border == null||rightWrapPanel == null) return;if (!IsRight){leftWrapPanel.Visibility = Visibility.Visible;border.Background = Brushes.White;rightWrapPanel.Visibility = Visibility.Collapsed;}}public ImageSource LeftImageSource{get { return (ImageSource)GetValue(LeftImageSourceProperty); }set { SetValue(LeftImageSourceProperty, value); }}public static readonly DependencyProperty LeftImageSourceProperty =DependencyProperty.Register("LeftImageSource", typeof(ImageSource), typeof(EmojiAndTextControl), new UIPropertyMetadata(OnLeftImageSourceChanged));private static void OnLeftImageSourceChanged(DependencyObject d, DependencyPropertyChangedEventArgs e){EmojiAndTextControl control = (EmojiAndTextControl)d;control.UpdateLeftImageSource();}void UpdateLeftImageSource(){if (leftImageBrush == null) return;leftImageBrush.ImageSource = LeftImageSource;}public ImageSource RightImageSource{get { return (ImageSource)GetValue(RightImageSourceProperty); }set { SetValue(RightImageSourceProperty, value); }}public static readonly DependencyProperty RightImageSourceProperty =DependencyProperty.Register("RightImageSource", typeof(ImageSource), typeof(EmojiAndTextControl), new UIPropertyMetadata(OnRightImageSourceChanged));private static void OnRightImageSourceChanged(DependencyObject d, DependencyPropertyChangedEventArgs e){EmojiAndTextControl control = (EmojiAndTextControl)d;control.UpdateRightImageSource();}void UpdateRightImageSource(){if (rightImageBrush == null) return;rightImageBrush.ImageSource = RightImageSource;}}
}

二、EmojiAndTextControlStyle.xaml代码如下:

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:local="clr-namespace:WpfChatEmojiText"><Style TargetType="local:EmojiAndTextControl"><Setter Property="Template"><Setter.Value><ControlTemplate TargetType="local:EmojiAndTextControl"><Grid><Grid.ColumnDefinitions><ColumnDefinition Width="Auto"/><ColumnDefinition/><ColumnDefinition Width="Auto"/></Grid.ColumnDefinitions><WrapPanel Grid.Column="0" Name="PART_Left" Visibility="Collapsed"><Border Width="35" Height="35" VerticalAlignment="Top"Margin="0,10"CornerRadius="4"UseLayoutRounding="True"><Border.Background><ImageBrush x:Name="LeftUser"ImageSource="{TemplateBinding LeftImageSource}" RenderOptions.BitmapScalingMode="LowQuality " Stretch="Fill"/></Border.Background></Border><Path Data="M365.714 256v512q0 14.857-10.857 25.714t-25.714 10.857-25.714-10.857l-256-256q-10.857-10.857-10.857-25.714t10.857-25.714l256-256q10.857-10.857 25.714-10.857t25.714 10.857 10.857 25.714z"Fill="White" Width="10" Height="10" Stretch="Fill"StrokeThickness="0" Grid.Column="1"VerticalAlignment="Top" Margin="0,20,-14,0"UseLayoutRounding="True" SnapsToDevicePixels="True"/></WrapPanel><Border CornerRadius="4" Background="#9EEA6A"UseLayoutRounding="True" SnapsToDevicePixels="True"Grid.Column="1" Margin="10"Name="PART_Border"><TextBlock Name="PART_TextBlock" FontSize="15" Text="{TemplateBinding Text}"Padding="6" TextWrapping="Wrap" VerticalAlignment="Center"/></Border><WrapPanel Grid.Column="2" Name="PART_Right"><Path Data="M329.143 512q0 14.857-10.857 25.714l-256 256q-10.857 10.857-25.714 10.857t-25.714-10.857-10.857-25.714v-512q0-14.857 10.857-25.714t25.714-10.857 25.714 10.857l256 256q10.857 10.857 10.857 25.714z"Fill="#9EEA6A" Width="10" Height="10" Stretch="Fill"StrokeThickness="0" VerticalAlignment="Top" Margin="-14,20,0,0"UseLayoutRounding="True" SnapsToDevicePixels="True"/><Border Width="35" Height="35"VerticalAlignment="Top"Margin="0,10"CornerRadius="4"UseLayoutRounding="True"><Border.Background><ImageBrush x:Name="RightUser"ImageSource="{TemplateBinding RightImageSource}" RenderOptions.BitmapScalingMode="LowQuality" Stretch="Fill"/></Border.Background></Border></WrapPanel></Grid><!--<ControlTemplate.Triggers><DataTrigger Binding="{Binding IsRight}" Value="false"><Setter Property="Visibility" TargetName="PART_Left" Value="Visible"/><Setter Property="Background" TargetName="PART_Border" Value="White"/><Setter Property="Visibility" TargetName="PART_Right" Value="Collapsed"/></DataTrigger></ControlTemplate.Triggers>--></ControlTemplate></Setter.Value></Setter>
</Style>
</ResourceDictionary>

三、MainWindow.xaml代码如下

<Window x:Class="WpfChatEmojiText.MainWindow"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:d="http://schemas.microsoft.com/expression/blend/2008"xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"xmlns:local="clr-namespace:WpfChatEmojiText"mc:Ignorable="d"Title="WPFDevelopers" Height="800" Width="800"TextOptions.TextFormattingMode="Display" UseLayoutRounding="True"SnapsToDevicePixels="True" RenderOptions.BitmapScalingMode="NearestNeighbor"><UniformGrid Columns="2"><Grid Margin="10,0"><Grid.RowDefinitions><RowDefinition/><RowDefinition Height="100"/></Grid.RowDefinitions><RichTextBox x:Name="_LeftChat" IsReadOnly="True"><RichTextBox.Background><ImageBrush ImageSource="Images\Left.jpg" Stretch="Fill"/></RichTextBox.Background></RichTextBox><Grid Grid.Row="1"><Grid.RowDefinitions><RowDefinition Height="Auto"/><RowDefinition/></Grid.RowDefinitions><ToggleButton x:Name="LeftButtonEmoji" Margin="10,0" Content="Emoji" Width="40" HorizontalAlignment="Left"/><Popup Placement="Top" PlacementTarget="{Binding ElementName=LeftButtonEmoji}" IsOpen="{Binding ElementName=LeftButtonEmoji,Path=IsChecked}" AllowsTransparency="True" VerticalOffset="-4"><Border Margin="10" Background="White" CornerRadius="4"Width="76"><Border.Effect><DropShadowEffect ShadowDepth="0" BlurRadius="10" Opacity="0.2" Color="#80000000"/></Border.Effect><ItemsControl ItemsSource="{Binding EmojiArray,RelativeSource={RelativeSource AncestorType=local:MainWindow}}"><ItemsControl.ItemTemplate><DataTemplate><Border x:Name="PART_Border" CornerRadius="2"PreviewMouseLeftButtonDown="PART_Border_PreviewMouseLeftButtonDown"Tag="{Binding Key}"><Image Source="{Binding Value}" ToolTip="{Binding Name}"Width="30" Height="30" Margin="4"IsHitTestVisible="True"/></Border><DataTemplate.Triggers><Trigger Property="IsMouseOver" Value="True"><Setter Property="Background" TargetName="PART_Border" Value="#FFD8D1D1"/></Trigger></DataTemplate.Triggers></DataTemplate></ItemsControl.ItemTemplate><ItemsControl.ItemsPanel><ItemsPanelTemplate><WrapPanel/></ItemsPanelTemplate></ItemsControl.ItemsPanel></ItemsControl></Border></Popup><Grid Grid.Row="1"><Grid.ColumnDefinitions><ColumnDefinition/><ColumnDefinition Width="Auto"/></Grid.ColumnDefinitions><TextBox x:Name="LeftInput"/><Button Grid.Column="1" Content="发送" x:Name="LeftSend" Click="LeftSend_Click"></Button></Grid></Grid></Grid><Grid Margin="10,0"><Grid.RowDefinitions><RowDefinition/><RowDefinition Height="100"/></Grid.RowDefinitions><RichTextBox x:Name="_RightChat" IsReadOnly="True"><RichTextBox.Background><ImageBrush ImageSource="Images\Right.jpg" Stretch="Fill"/></RichTextBox.Background></RichTextBox><Grid Grid.Row="1"><Grid.RowDefinitions><RowDefinition Height="Auto"/><RowDefinition/></Grid.RowDefinitions><ToggleButton x:Name="RightButtonEmoji" Margin="10,0" Content="Emoji" Width="40" HorizontalAlignment="Left"/><Popup Placement="Top" PlacementTarget="{Binding ElementName=RightButtonEmoji}" IsOpen="{Binding ElementName=RightButtonEmoji,Path=IsChecked}" AllowsTransparency="True" VerticalOffset="-4"><Border Margin="10" Background="White" CornerRadius="4"Width="76"><Border.Effect><DropShadowEffect ShadowDepth="0" BlurRadius="10" Opacity="0.2" Color="#80000000"/></Border.Effect><ItemsControl ItemsSource="{Binding EmojiArray,RelativeSource={RelativeSource AncestorType=local:MainWindow}}"><ItemsControl.ItemTemplate><DataTemplate><Border x:Name="PART_Border" CornerRadius="2"PreviewMouseLeftButtonDown="PART_Border_RightPreviewMouseLeftButtonDown"Tag="{Binding Key}"><Image Source="{Binding Value}" ToolTip="{Binding Name}"Width="30" Height="30" Margin="4"IsHitTestVisible="True"/></Border><DataTemplate.Triggers><Trigger Property="IsMouseOver" Value="True"><Setter Property="Background" TargetName="PART_Border" Value="#FFD8D1D1"/></Trigger></DataTemplate.Triggers></DataTemplate></ItemsControl.ItemTemplate><ItemsControl.ItemsPanel><ItemsPanelTemplate><WrapPanel/></ItemsPanelTemplate></ItemsControl.ItemsPanel></ItemsControl></Border></Popup><Grid Grid.Row="1"><Grid.ColumnDefinitions><ColumnDefinition/><ColumnDefinition Width="Auto"/></Grid.ColumnDefinitions><TextBox x:Name="RightInput"/><Button Grid.Column="1" Content="发送" x:Name="RightSend" Click="RightSend_Click"></Button></Grid></Grid></Grid></UniformGrid>
</Window>

四、MainWindow.cs.xaml代码如下

using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;namespace WpfChatEmojiText
{/// <summary>/// MainWindow.xaml 的交互逻辑/// </summary>public partial class MainWindow : Window{public IEnumerable EmojiArray{get { return (IEnumerable)GetValue(EmojiArrayProperty); }set { SetValue(EmojiArrayProperty, value); }}public static readonly DependencyProperty EmojiArrayProperty =DependencyProperty.Register("EmojiArray", typeof(IEnumerable), typeof(MainWindow), new PropertyMetadata(null));public MainWindow(){InitializeComponent();var emojiModels = new List<EmojiModel>();EmojiHelperLibrary.EmojiHelper.Instance._emojiHeight = 30;EmojiHelperLibrary.EmojiHelper.Instance._emojiWidth = 30;var m_Emojis = new Dictionary<string, string>();var emojiPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "emoji");var directory = new DirectoryInfo(emojiPath);foreach (var item in directory.GetFiles()){var _key = $"[{Path.GetFileNameWithoutExtension(item.Name)}]";m_Emojis.Add(_key, item.FullName);emojiModels.Add(new EmojiModel { Name = Path.GetFileNameWithoutExtension(item.Name), Key = _key, Value = item.FullName });}EmojiHelperLibrary.EmojiHelper.Instance.m_Emojis = m_Emojis;EmojiArray = emojiModels;}private void PART_Border_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e){LeftButtonEmoji.IsChecked = false;var send = sender as Border;LeftInput.Text += send.Tag.ToString();LeftInput.Focus();LeftInput.SelectionStart = LeftInput.Text.Length;}private void LeftSend_Click(object sender, RoutedEventArgs e){LeftChat();}void LeftChat(){var leftText = new EmojiAndTextControl();leftText.IsRight = true;leftText.RightImageSource = new BitmapImage(new Uri("pack://application:,,,/Images/UserImages/jingtao.png"));leftText.Text = LeftInput.Text;var leftPara = new Paragraph();leftPara.TextAlignment = TextAlignment.Right;leftPara.Inlines.Add(leftText);_LeftChat.Document.Blocks.Add(leftPara);var rightText = new EmojiAndTextControl();rightText.IsRight = false;rightText.LeftImageSource = new BitmapImage(new Uri("pack://application:,,,/Images/UserImages/jingtao.png"));rightText.Text = LeftInput.Text;var rightPara = new Paragraph();rightPara.TextAlignment = TextAlignment.Left;rightPara.Inlines.Add(rightText);_RightChat.Document.Blocks.Add(rightPara);LeftInput.Text = string.Empty;LeftInput.Focus();}void RightChat(){var leftText = new EmojiAndTextControl();leftText.IsRight = true;leftText.RightImageSource = new BitmapImage(new Uri("pack://application:,,,/Images/UserImages/yanjinhua.png"));leftText.Text = RightInput.Text;var leftPara = new Paragraph();leftPara.TextAlignment = TextAlignment.Right;leftPara.Inlines.Add(leftText);_RightChat.Document.Blocks.Add(leftPara);var rightText = new EmojiAndTextControl();rightText.IsRight = false;rightText.LeftImageSource = new BitmapImage(new Uri("pack://application:,,,/Images/UserImages/yanjinhua.png"));rightText.Text = RightInput.Text;var rightPara = new Paragraph();rightPara.TextAlignment = TextAlignment.Left;rightPara.Inlines.Add(rightText);_LeftChat.Document.Blocks.Add(rightPara);RightInput.Text = string.Empty;RightInput.Focus();}private void RightSend_Click(object sender, RoutedEventArgs e){RightChat();}private void PART_Border_RightPreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e){RightButtonEmoji.IsChecked = false;var send = sender as Border;RightInput.Text += send.Tag.ToString();RightInput.Focus();RightInput.SelectionStart = RightInput.Text.Length;}}public class EmojiModel{public string Name { get; set; }public string Key { get; set; }public string Value { get; set; }}
}

源码地址

github:https://github.com/yanjinhuagood/WPFDevelopers.git

gitee:https://gitee.com/yanjinhua/WPFDevelopers.git

WPF开发者QQ群: 340500857 

blogs: https://www.cnblogs.com/yanjinhua

Github:https://github.com/yanjinhuagood

出处:https://www.cnblogs.com/yanjinhua

版权:本作品采用「署名-非商业性使用-相同方式共享 4.0 国际」许可协议进行许可。

转载请著名作者 出处 https://github.com/yanjinhuagood

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/301670.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

要孩子逻辑清晰、善于思考,别忽视空间想象力的游戏锻炼!

▲数据汪特别推荐点击上图进入玩酷屋在之前的文章时&#xff0c;马斯提到数学存在一种现象叫“梯次掉队”&#xff0c;原因在于孩子的数学思维地基没有打牢。&#xff08;传送门&#xff09;提到初中孩子需要空间想象能力时&#xff0c;很多父母疑惑为何需要&#xff1f;关于这…

公摊面积取消闹乌龙,历史学家李学勤逝世,微软员工抗议国防大单,前摩拜CEO后花68万上学,这就是今天的大新闻。...

今天是2月25日农历正月廿一今天星期一大家看起来都好像很兴奋下面是今天的大新闻“公摊面积”要取消? 央视&#xff1a;这是错误理解(今日头条)近日有关“公摊面积”的新闻被刷屏。那么&#xff0c;这是否意味着&#xff0c;住宅交易面积将从建筑面积变为套内面积&#xff1f;…

快手春节活动奖励未到账,被羊毛党投诉上了全国12315平台

全世界只有3.14 % 的人关注了数据与算法之美在这个获客成本越来越高的互联网时代下&#xff0c;通过现金激励的方式来拉新已经成为众多中国互联网公司的惯用手法了。今年春节&#xff0c;短视频公司快手就推出了“上快手&#xff0c;分6亿现金”的红包活动。在活动期间&#xf…

通过脚本案例学习shell(二) --- 通过线性显示/etc/passwd内容了解while read用法

通过脚本案例学习shell&#xff08;二&#xff09;--- 通过线性显示/etc/passwd内容了解while read用法 版权声明&#xff1a; 本文遵循“署名非商业性使用相同方式共享 2.5 中国大陆”协议您可以自由复制、发行、展览、表演、放映、广播或通过信息网络传播本作品您可以根据本…

上几个WebAPI就算微服务架构?Too Young!

毋庸置疑&#xff0c;当下是微服务云原生的时代&#xff0c;这是最坏的时代&#xff0c;也是最好的时代&#xff01;机遇和挑战并行&#xff0c;技术人之间的差距在逐渐拉到&#xff01;两极分化严重早在2015年&#xff0c;微服务就已经被诸多大企业认可和推行&#xff0c;被称…

雨雪出行伴侣,优质PVC时尚鞋套,防滑/防水更耐磨

▲数据汪特别推荐点击上图进入玩酷屋随着消费升级越来越多的人愿意购买价格不菲的鞋款大街小巷里涌现出越来越多的Sneakerhead&#xff08;俗称&#xff1a;鞋子发烧友&#xff09;就比如小木每次刚入手一双新鞋就高高兴兴穿出门然而终究免不了碰上“新鞋魔咒”再怎么小心都会被…

又到618,.NET 千万级秒杀架构到底有多牛

年年618&#xff0c;次次高并发。其实这不仅仅是对618下各大电商平台的考验&#xff0c;更是如今每一个互联网应用上线后&#xff0c;会遇到的一个严峻的考验&#xff0c;渡得过 965&#xff0c;渡不过 996。在这个极速膨胀的互联网世界里&#xff0c; .NET 5 正是为了应对与解…

灯泡里的钨丝是怎么放进去的,这个视频解开我20多年的疑惑!

全世界只有3.14 % 的人关注了数据与算法之美白炽灯渐渐从我们的视线里消失了&#xff0c;不得不说这个一个伟大的发明&#xff0c;试想一下要是没有灯&#xff0c;只点蜡烛会有多少人抓狂&#xff0c;那么你知道灯泡里的钨丝是怎么放进去的吗&#xff0c;这个视频给你答案。灯泡…

渤海发现大油田,证券会提示风险,微博回应流量造假,刘国梁制定史上最严奖惩体系,这就是今天的大新闻。...

今天是2月26日农历正月廿二今天星期二有点小忙下面是今天的大新闻渤海发现可供百万人用百年的大油田&#xff08;中化新网&#xff09;中国海油昨天(25日)对外宣布&#xff0c;位于我国渤海海域的渤中19-6气田&#xff0c;测试获得优质高产油气流&#xff0c;确定天然气探明地质…

SQLite.NET (32位) 在64位环境中无法正常调试

解决方法&#xff1a; 1、更换64的DLL 2、在Vs开发环境中&#xff0c;在项目属性里按下图操作&#xff0c;更改目标平台为 x86。 转载于:https://www.cnblogs.com/08shiyan/archive/2013/03/15/2961096.html

华为交换机linux版本号,Cisco和华为交换机常用配置命令总结

Cisco和华为交换机常用配置命令总结一、调试命令思科&#xff1a;Switch#show run 显示所有配置命令Switch#show ip inter brief 显示所有接口状态Switch#show vlan brief 显示所有VLAN的信息Switch#show version 显示版本信息华为&#xff1a;[Quidway]dis cur 显示…

WPF实现消息中心

↑↑↑点击上方蓝字关注我一、概要本文将讲解基于WPF实现一个消息中心的功能&#xff0c;比如常见的软件当中会经常收到服务端推送的“新闻”、“公告”等消息。这个时候就需要对这个需求进行分析了。功能分析如下&#xff1a;•消息内容显示。•消息管理增、删、批量删除。•消…

学Android的学习规划

为什么80%的码农都做不了架构师&#xff1f;>>> 客观地讲&#xff0c;会分为两条线来处理 学术线&#xff1a; 从学术上讲&#xff0c;Android分为几个模块是需要我循序渐进的&#xff1a; 初印象&#xff1a;IDE中Android各项结构 初印象&#xff1a;Android结…

每日一笑 | IE的反射弧也太长了吧......

全世界只有3.14 % 的人关注了数据与算法之美&#xff08;图片来源于网络&#xff0c;侵权删&#xff09;

WPF 用Popup做下拉菜单

今天无聊时看到必应搜索首页的菜单挺好&#xff0c;于是想着模仿一下。。写着写着发现和我之前做的一个MenuItem很像&#xff0c;干脆直接拿来用了。。。看看效果&#xff1a;上图是bing.com首页右上角的下拉菜单&#xff0c;今天就来做了一个这样的。。我承认我偷懒了&#xf…

程序猿都在关注的6个优质公众号

CSDN学院▲长按图片识别二维码关注简介&#xff1a;CSDN学院&#xff0c;中国IT人必备的职业提升平台。在这里&#xff0c;看前辈文章&#xff0c;听专家分享&#xff0c;做一线项目&#xff0c;无畏场景&#xff0c;不限时间的紧跟前沿技术脚步。你的技术进阶之路&#xff0c;…

聊一聊.NET Core结合Nacos实现配置加解密

背景 当我们把应用的配置都放到配置中心后&#xff0c;很多人会想到这样一个问题&#xff0c;配置里面有敏感的信息要怎么处理呢&#xff1f;信息既然敏感的话&#xff0c;那么加个密就好了嘛&#xff0c;相信大部分人的第一感觉都是这个&#xff0c;确实这个是最简单也是最合适…

给孩子讲100个科学道理,不如带他做这些趣味实验!

▲数据汪特别推荐点击上图进入玩酷屋玩具和学习看似是两个对立的东西&#xff0c;孩子天性爱玩&#xff0c;家长却希望孩子能多学习。不一定非要啃课本才能汲取知识&#xff0c;有时候&#xff0c;在轻松有趣的游戏中也能学到课堂上学不到的知识。让学习变得有趣、高效——给孩…

linux服务器出现黄,linux服务器出现严重故障后的原因以及解决方法

linux服务器出现严重故障后的原因以及解决方法发布时间&#xff1a;2011-11-24 16:32:18 作者&#xff1a;佚名 我要评论linux服务器出现严重故障后的解决方法&#xff0c;本文为大家介绍四个步骤解决linux服务器严重故障。1、把系统安装光盘插入&#xff0c;重启机器&…

史上最污技术解读,我竟然秒懂了!

全世界只有3.14 % 的人关注了数据与算法之美或许有不少人对热备&#xff0c;冷备&#xff0c;云备了解不深。今天&#xff0c;数据汪就给大伙科普一下 IT 行业各种备份术语&#xff0c;以后别闹笑话了。1.冷备份假设你是一位女性&#xff0c;你有一位男朋友&#xff0c;于此同时…