当前位置: 首页 > news >正文

房地产图文制作网站企业建设网站有哪些费用

房地产图文制作网站,企业建设网站有哪些费用,广西柳州网站制作公司,代理服务器软件气泡提示框应用举例 有时候在我们开发的软件经常会遇到需要提示用户的地方#xff0c;为了让用户更直观#xff0c;快速了解提示信息#xff0c;使用简洁、好看又方便的气泡提示框显得更加方便#xff0c;更具人性化。如下面例子#xff1a;(当用户未输入账号时#xff0…气泡提示框应用举例 有时候在我们开发的软件经常会遇到需要提示用户的地方为了让用户更直观快速了解提示信息使用简洁、好看又方便的气泡提示框显得更加方便更具人性化。如下面例子(当用户未输入账号时气泡提示会在登录页面上方提示用户“请输入登录账号”用户点击其他地方或者在无操作一段时间后气泡会自动消失。根据不同类型的提示框字体颜色和图标也不一样。本例的气泡提示框可在不同窗体上显示。) 接下来就开始做一个有趣的气泡提示框吧(形状可自定义) 气泡提示框代码创建 新建气泡提示框窗体 新建一个气泡提示框窗体(之所以选择窗体是因为可以让它不附属于其他窗体可在任意窗体上运行)使用Popup控件作为提示框主体。在Popup控件中添加提示图标和提示信息通过InfoType依赖属性来设置其图标和信息背景颜色。 Window x:ClassBubblePrompt.PopupMessageWindowxmlnshttp://schemas.microsoft.com/winfx/2006/xaml/presentationxmlns:xhttp://schemas.microsoft.com/winfx/2006/xamlxmlns:dhttp://schemas.microsoft.com/expression/blend/2008xmlns:mchttp://schemas.openxmlformats.org/markup-compatibility/2006xmlns:localclr-namespace:BubblePromptmc:IgnorabledNameown AllowsTransparencyTrue ShowInTaskbarFalseTitlePopupMessageWindow Height60 Width410 WindowStyleNone Background{x:Null} Popup NamepopupInfo OpenedpopupInfo_Opened StaysOpenFalse IsOpenFalse AllowsTransparencyTrue VerticalOffset60 HorizontalOffset100 PlacementTop PlacementTarget{Binding Element,ElementNameown}Border CornerRadius4 Background{Binding BackColor,ElementNameown} Height50 Width400 GridImage Width20 Height20 Source{Binding ImageSource,ElementNameown} HorizontalAlignmentLeft Margin30,0,0,0/TextBlock x:NametxtbInfo VerticalAlignmentCenter HorizontalAlignmentLeft Margin60,0,0,0 FontSize16Text{Binding Info,ElementNameown} Foreground{Binding InfoTextColor,ElementNameown}//Grid/Border/Popup /Window /// summary/// PopupMessageWindow.xaml 的交互逻辑/// /summarypublic partial class PopupMessageWindow : Window{private static BitmapImage NormalInfoImg new BitmapImage(new Uri(/BubblePrompt;component/Images/ic_pop_normal.png, UriKind.RelativeOrAbsolute));private static BitmapImage WarnInfoImg new BitmapImage(new Uri(/BubblePrompt;component/Images/ic_pop_warn.png, UriKind.RelativeOrAbsolute));private static BitmapImage ErrorInfoImg new BitmapImage(new Uri(/BubblePrompt;component/Images/ic_pop_fail.png, UriKind.RelativeOrAbsolute));private static Brush NormalBackColor new SolidColorBrush((Color)ColorConverter.ConvertFromString(#DEF4FF));private static Brush WarnBackColor new SolidColorBrush((Color)ColorConverter.ConvertFromString(#FFF0E6));private static Brush ErrorBackColor new SolidColorBrush((Color)ColorConverter.ConvertFromString(#FFF0E6));private static Brush NormalInfoColor new SolidColorBrush((Color)ColorConverter.ConvertFromString(#0094FF));private static Brush WarnInfoColor new SolidColorBrush((Color)ColorConverter.ConvertFromString(#FB9048));private static Brush ErrorInfoColor new SolidColorBrush((Color)ColorConverter.ConvertFromString(#FB9048));System.Windows.Threading.DispatcherTimer uiTimer;public FrameworkElement Element{get { return (FrameworkElement)GetValue(ElementProperty); }set { SetValue(ElementProperty, value); }}// Using a DependencyProperty as the backing store for Element. This enables animation, styling, binding, etc...public static readonly DependencyProperty ElementProperty DependencyProperty.Register(Element, typeof(FrameworkElement), typeof(Window), new PropertyMetadata(null));public string Info{get { return (string)GetValue(InfoProperty); }set { SetValue(InfoProperty, value); }}// Using a DependencyProperty as the backing store for Info. This enables animation, styling, binding, etc...public static readonly DependencyProperty InfoProperty DependencyProperty.Register(Info, typeof(string), typeof(Window), new PropertyMetadata());public int Delay{get { return (int)GetValue(DelayProperty); }set { SetValue(DelayProperty, value); }}// Using a DependencyProperty as the backing store for Delay. This enables animation, styling, binding, etc...public static readonly DependencyProperty DelayProperty DependencyProperty.Register(Delay, typeof(int), typeof(Window), new PropertyMetadata(3));public Brush BackColor{get { return (Brush)GetValue(BackColorProperty); }set { SetValue(BackColorProperty, value); }}// Using a DependencyProperty as the backing store for BackColor. This enables animation, styling, binding, etc...public static readonly DependencyProperty BackColorProperty DependencyProperty.Register(BackColor, typeof(Brush), typeof(Window), new PropertyMetadata(NormalBackColor));public Brush InfoTextColor{get { return (Brush)GetValue(InfoTextColorProperty); }set { SetValue(InfoTextColorProperty, value); }}// Using a DependencyProperty as the backing store for BackColor. This enables animation, styling, binding, etc...public static readonly DependencyProperty InfoTextColorProperty DependencyProperty.Register(InfoTextColor, typeof(Brush), typeof(Window), new PropertyMetadata(NormalInfoColor));/// summary/// 0:Normal 1:Warn 2:Error/// /summarypublic int InfoType{get { return (int)GetValue(InfoTypeProperty); }set{SetValue(InfoTypeProperty, value);if (value 0){ImageSource NormalInfoImg;BackColor NormalBackColor;InfoTextColor NormalInfoColor;}else if (value 1){ImageSource WarnInfoImg;BackColor WarnBackColor;InfoTextColor WarnInfoColor;}else if (value 2){ImageSource ErrorInfoImg;BackColor ErrorBackColor;InfoTextColor ErrorInfoColor;}}}// Using a DependencyProperty as the backing store for InfoType. This enables animation, styling, binding, etc...public static readonly DependencyProperty InfoTypeProperty DependencyProperty.Register(InfoType, typeof(int), typeof(Window), new PropertyMetadata(0));public BitmapImage ImageSource{get { return (BitmapImage)GetValue(ImageSourceProperty); }set { SetValue(ImageSourceProperty, value); }}// Using a DependencyProperty as the backing store for ImageSource. This enables animation, styling, binding, etc...public static readonly DependencyProperty ImageSourceProperty DependencyProperty.Register(ImageSource, typeof(BitmapImage), typeof(Window), new PropertyMetadata(null));DateTime startTime;public PopupMessageWindow(){InitializeComponent();}private void UITimerTick(object sender, EventArgs e){if (popupInfo.IsOpen false){uiTimer.Stop();return;}if ((DateTime.Now - startTime).TotalSeconds Delay){this.Hide();popupInfo.IsOpen false;}}private void popupInfo_Opened(object sender, EventArgs e){if (uiTimer null || uiTimer.IsEnabled false){uiTimer new System.Windows.Threading.DispatcherTimer();uiTimer.Interval TimeSpan.FromMilliseconds(1000);uiTimer.Tick UITimerTick;startTime DateTime.Now;uiTimer.Start();}else{startTime DateTime.Now;}}} 新建气泡提示框管理类 新建气泡提示框管理类作为公共类使其可以被全局访问和使用。 public class MessageManager{private PopupMessageWindow mPopupMessageWindow new PopupMessageWindow();/// summary/// Poup消息提示/// /summarypublic PopupMessageWindow PopupMessageWindow { set { mPopupMessageWindow value; } get { return mPopupMessageWindow; } }/// summary/// type: 0:常规 1:注意 2:警告/// /summary/// param nameelement/param/// param nametype/parampublic void ShowMessageTip(string info, FrameworkElement element null, int type 0, int delaytime 3){if (PopupMessageWindow ! null info.Length 30){PopupMessageWindow.Element element;PopupMessageWindow.InfoType type;PopupMessageWindow.popupInfo.IsOpen true;PopupMessageWindow.Info info;PopupMessageWindow.Delay delaytime;PopupMessageWindow.Show();}}} 窗体中应用气泡提示框 在任意窗体中使用气泡提示管理类中气泡提示框方法设置其信息和信息类型在该窗体中显示气泡提示。 /// summary/// MainWindow.xaml 的交互逻辑/// /summarypublic partial class MainWindow : Window{/// summary/// 消息提醒管理/// /summarypublic MessageManager MessageManager { get { return new MessageManager(); } }public MainWindow(){InitializeComponent();}private void btnTip_Click(object sender, RoutedEventArgs e){MessageManager.ShowMessageTip(当前资源为最新, this, 1);}} 气泡提示框项目实例效果 项目实例链接https://download.csdn.net/download/lvxingzhe3/88677901
http://www.zqtcl.cn/news/789824/

相关文章:

  • 学做网站的书籍自己做网站 最好的软件
  • 手机网站专题电商入门视频教程免费
  • aspx网站模板制作网页常用的软件有哪些
  • 网站主关键词湖南网站定制
  • 长沙seo网站排名优化公司进入秦皇岛最新规定
  • 企业网站优化平台宝山北京网站建设
  • 给人做代工的网站加盟代理网
  • 网站建设用dw电脑谷歌浏览器打开是2345网址导航
  • 做外贸一般总浏览的网站太原的网站建设公司哪家好
  • 台州建网站公司wordpress 用微信登陆
  • 广州白云网站建设家在深圳业主
  • 呼和浩特网站建设哪家最便宜?携程旅行网网站策划书
  • 网站建设及相关流程北京网站备案域名
  • 汉字叔叔花了多少钱做网站微商城科技
  • 网站代理被抓html网站开发实战
  • 如何建立免费的网站网站copyright写法
  • 官方网站下载12306合肥有没有做网站的单位
  • 甘露园网站建设网站框架图片
  • 做网站怎样赚卖流量石家庄网站建设联系电话
  • wordpress 图片网站本地免费发布信息网站
  • 建设网站和别人公司重名新乡建设招标投标网站
  • 四川省建设厅网站证想开个网站怎样开公司
  • 做机械一般做那个外贸网站电商软件开发费用
  • 网站外链坏处龙岗网站设计信息
  • 郑州网站建设乙汉狮网络搜索优化网络推广
  • Dw做html网站百度推广竞价排名
  • 北京市电力建设公司网站万云网络网站
  • 校园网站开发方案做网站现在用什么语言
  • 网站建设学什么书中联建设集团股份有限公司网站
  • 制作个人业务网站go 做视频网站