随笔分类 - WPF
摘要:源代码:https://github.com/Keboo/MaterialDesignInXaml.Examples/tree/master/DialogHost/DialogHost.ClosingConfirmation.CodeBehind
阅读全文
摘要:约束: ViewModel与视图类型位于同一个程序集中 ViewModel位于.ViewModels子命名空间中 视图位于.Views子命名空间中 ViewModel名称与视图名称对应,以“ViewModel”结尾。 不然无法解析
阅读全文
摘要:var options = new ExcelExportingOptions { ExcelVersion = ExcelVersion.Excel2013, }; //不需要导出的字段 options.ExcludeColumns.Add("InspectionRec...
阅读全文
摘要:WPF 自定义样式。CheckBox
阅读全文
摘要:所有的重载设置字段作为参数传递到指定的值,而属性提高INotifyPropertyChanged.PropertyChanged事件。如果一个字段已经成功地改变,setProperty方法中返回真。一些重载也需要一个回调方法作为参数。调用该回调后场已经改变。手动设置一个基本的私有字段,然后调用的BindableBase.RaisePropertyChanged方法重载之一。所有RaisePropertyChanged方法重载需要作为输入参数,这些属性提高INotifyPropertyChanged.PropertyChanged事件。using System;using System.Coll
阅读全文
摘要:WPF CheckBox 自定义样式 给Button设置ToolTip 圆角Button 样式
阅读全文
摘要:using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Reflection; using System.Windows; using System.Windows.Controls; using System.Windows.Forms; using Mes...
阅读全文
摘要:在插件式开发。我们要调用其它插件或模块的委托事件时、那么我们需要通过反射。Module 模块namespace Module2{ /// /// MainWindow.xaml 的交互逻辑 /// [Plugin("MainWindow", "测试反射")] public partial class MainWindow { public delegate void TestHandler(string msg,string info,string text); public event TestHandler TestEv...
阅读全文
摘要:如果不使用MVVM。直接调用GridControl 事件 取当前单击某一列的值。如果在MVVM中那么则使用Command 。通过Command传递参数等 就比以往的直接调用事件复杂。。需求:在点击 GridConrol的时候 下面值跟着变化。。主要是通过鼠标 RowDoubleClick 和键盘 Enter 时 调用CommandMVVM:View Code <UserControl.Resources> <!--数据模板--> <DataTemplate x:Key="RowDetailTemplate"> <GroupBox G
阅读全文
摘要:<Grid x:Name="LayoutRoot"> <TextBlock Height="23" HorizontalAlignment="Left" Margin="56,23,0,0" Text="用户编号:" VerticalAlignment="Top" /> <TextBlock Hei
阅读全文
摘要:尝试向 URI“http://localhost:8554/CustomerManage.svc”发出请求时出错。这可能是由于试图以跨域方式访问服务而又没有正确的跨域策略,或策略不适用于 SOAP 服务。您可能需要与该服务的所有者联系,以发布跨域策略文件并确保该文件允许发送 SOAP 相关的 HTT
阅读全文
摘要:支持模型-视图-视图模型 (MVVM) 模式是独立从基础业务逻辑的用户界面应用程序的模式. 该模式可以使用到 WPF,Silverligth,Windows phone 应用 。 Model: namespace SLMvvmDemo2.Model { //Model 模型 //客户表 public
阅读全文
摘要:1 <Window x:Class="WPFBookDemo1.MainWindow" 2 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 3 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 4 Title="MainWindow" Height="372" Width="599"> 5 <Grid Horizon
阅读全文
摘要:通过 FrameWorkPropertyMetadata 对象 使用 CoerceValueCallBack回调,下面是一个示例, FrameworkPropertyMetadata metadata = new FrameworkPropertyMetadata(); metadata.CoerceValueCallback = new CoerceValueCallback(CoerceMaxValue); DependencyProperty.Register("Maximum", typeof(double), typeof(RangeBase), metada..
阅读全文
摘要:Visible元素在窗体中正常显示Collaspsed元素不显示,也不占用空间Hidden元素不显示,但是任然为它保留空间
阅读全文
摘要:1 <Window x:Class="WPF.MainWindow" 2 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 3 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 4 Title="MainWindow" Height="350" Width="525"> 5 <Grid> 6 <Button
阅读全文