随笔分类 -  WPF

摘要:如图样:View结构MainView(MainViewModel)|---Guide1View(Guide1ViewModel)|---Guide2View(Guide2ViewModel) |---Guide2_1View1(Guide2_1ViewModel) |---Guide2_1Vie... 阅读全文
posted @ 2015-04-22 12:10 SubmarineX 阅读(1520) 评论(0) 推荐(0)
摘要:使用以下代码,当TextBlock文本过长,引起Button的显示位置在可见区域以外: 1 5 6 7 8 9 10 【END】 阅读全文
posted @ 2014-11-05 19:21 SubmarineX 阅读(725) 评论(0) 推荐(0)
摘要:原文:《模拟MessageBox》Posted on 2014/01/07================================================================================这段时间在用WPF开发项目。界面采用的是类似Win8系统的Metr... 阅读全文
posted @ 2014-09-12 08:04 SubmarineX 阅读(423) 评论(0) 推荐(0)
摘要:原文:《User Settings in WPF》Posted on2014/04/09================================================================================介绍参看:How To: Write User Se... 阅读全文
posted @ 2014-09-12 08:01 SubmarineX 阅读(740) 评论(0) 推荐(0)
摘要:最初使用一个Rectangle,并设置Z值来捕捉MouseLeftButtonDown事件,但是不管在它之上或是之下的TextBox都无法用鼠标进入编辑状态。给Window添加MouseLeftButtonDown事件:1 .1 private void Window_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)2 {3 this.DragMove();4 }、 阅读全文
posted @ 2013-09-04 17:20 SubmarineX 阅读(258) 评论(0) 推荐(0)
摘要:WPF Popup: How to put a border around the popup?通过设置 Border 的 margin 来为阴影留出位置,并设置 Popup:AllowsTransparency="True"。 1 2 3 4 5 6 7 ...Content... 8 9 10 。 阅读全文
posted @ 2013-09-03 17:26 SubmarineX 阅读(1721) 评论(0) 推荐(0)
摘要:WPF: How to make the TextBox/TextBlock/Label show "xxx..." if the text content too long?设置 属性 “TextTrimming”:=========================================... 阅读全文
posted @ 2013-09-03 16:35 SubmarineX 阅读(493) 评论(0) 推荐(0)
摘要:ComboBoxCustomizing WPF combo box styleNavigationBuild Your Own Navigation Bar for Data Navigation in WPFWPF NavigationTreeListViewWPF TreeListView Controlhttp://www.codeproject.com/Articles/16009/A-Much-Easier-to-Use-ListViewTreeViewSimplifying the WPF TreeView by Using the ViewModel Pattern 阅读全文
posted @ 2013-07-12 12:12 SubmarineX 阅读(474) 评论(0) 推荐(0)
摘要:为了学习自定义控件,就想看看WPF基本元素的代码。使用到工具.NET Reflector。 System.Windows.Controls 命名空间在PresentationFramework.dll中。 Control Class继承关系。 Q:Where can I find System.Windows.Controls.dll and System.Windows.Controls.Data.dll ======================================================== 完整的操作:File -> Open Assembly Li... 阅读全文
posted @ 2013-07-05 12:20 SubmarineX 阅读(1102) 评论(0) 推荐(1)
摘要:原文:The VisualStateManager and TriggersAuthor:Carole Snyder Silverlight 推出了可视化状态管理器(Visual State Manager ),它使得控件模版作者更方便地指定依赖可视化状态的控件外观。WPF Toolkit附带了一个可视化状态管理器(Visual State Manager ),WPF 的下个版本将会加入 VSM。可以理解地,VisualStateManager 的引进带来了问题:何时使用 VSM 代替触发器,何时使用触发器会更适合。本博文尝试解决这个问题:更多对如何使用可视化状态管理器(VisualStat. 阅读全文
posted @ 2013-06-26 13:28 SubmarineX 阅读(1713) 评论(1) 推荐(0)
摘要:原文:Creating “Cool” Buttons with Expression BlendAuthor:Alex 在本文中,我们将考虑在Expression Blend用几种方法来创建酷炫的凝胶状按钮。如果你看到 Expression Blend 或 Visual Studio 中的 WPF 默认外观的 Button,你会发现它一点也不酷。它仍旧是过时的chrome 样子的按钮控件,然而 Expression Blend 和 Windows Presentation Foundation (WPF) 不仅具有基本功能而且能够提升用户体验(User eXperience,UX)。所以为了. 阅读全文
posted @ 2013-06-24 16:25 SubmarineX 阅读(1745) 评论(3) 推荐(0)
摘要:A guide to cleaner XAML with custom namespaces and prefixes (WPF/Silverlight)XAML Namespaces and Namespace Mapping for WPF XAML 阅读全文
posted @ 2013-06-09 17:26 SubmarineX 阅读(191) 评论(0) 推荐(0)
摘要:1 <TextBlock>2 <Hyperlink 3 Click="ForgetPassword">4 忘记密码5 </Hyperlink>6 </TextBlock>—EOF— 阅读全文
posted @ 2013-06-05 15:18 SubmarineX 阅读(379) 评论(0) 推荐(0)
摘要:在不同情况下,显示不同的控件。Case1:ToggleButton显示,Grid的Visibility通过ToggleButton的IsChecked属性绑定;Case2:ToggleButton隐藏,Grid显示。通过类型判断进入处理部分: 1 public HelloWindow(WinType type) 2 { 3 winType = type; 4 5 InitializeComponent(); 6 7 if (winType == WinType.Case1) 8 { 9 myToggleButton.Visibility = ... 阅读全文
posted @ 2013-06-05 14:36 SubmarineX 阅读(615) 评论(0) 推荐(0)
摘要:为了做像 MS 0ffice 2013 风格的界面。这是MahApps.Metro的文档;在安装mahapps.metro(找不到下载链接)之前,先安装NuGet,原因;Installing NuGet;然后按照MahApps.Metro的文档来进行。安装包的的时候可能会遇到问题:PM> Install-Package MahApps.MetroInstall-Package : 基础连接已经关闭: 发送时发生错误。所在位置 行:1 字符: 16+ Install-Package <<<< MahApps.Metro + CategoryInfo : NotSpe 阅读全文
posted @ 2013-04-26 15:10 SubmarineX 阅读(2824) 评论(0) 推荐(0)
摘要:1、后台打开网页1 private void OpenWeb(object sender, RoutedEventArgs e)2 {3 System.Diagnostics.Process.Start("http://www.cnblogs.com/submarine");4 }2、窗口间跳转1 private void LogInSucc(object sender, RoutedEventArgs e)2 {3 this.Hide();4 OtherWindow win = new OtherWindow();5 win.Show();6 }3、垂直分割线... 阅读全文
posted @ 2013-04-16 09:44 SubmarineX 阅读(4749) 评论(0) 推荐(1)