随笔分类 - WPF
摘要:1.Service 中调用存储过程 context.UseTransaction(() => { //使用存储过程 DbParam[] pars = new DbParam[] { DbParam.Create("@FlowID", curStep.FlowID), DbParam.Create("
阅读全文
摘要:1.通用静态快捷键绑定命令 cs: public static Key BtnReferHotKey = Key.F7; xaml: <UserControl.InputBindings> <KeyBinding Key="{x:Static common:Common.BtnReferHotKey
阅读全文
摘要:1.界面绑定了DataContex,按钮也可以点击,但是跑不到ViewModel中的命令 解答:Locator注册中分两步:第一注册,第二定义实例化ViewModel变量。以上问题忘记了第二步,其实DataContex绑定的是实例化对象而非类名。 2.给集合的某个字段赋值,赋不上去 解答:定义的变量
阅读全文
摘要:问题描述: cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ItemsControl', AncestorLevel='
阅读全文
摘要:xmlns:sys="clr-namespace:System;assembly=mscorlib"<Grid.Resources> <Style TargetType="ToolTip"> <Style.Triggers> <Trigger Property="Content" Value="{x
阅读全文
摘要:1.当一个界面不用控件需绑定不同ViewModel时,可在控件上单独设置DataContext。 DataContext="{Binding Source={StaticResource Locator},Path=GB_FloCheckStepInforViewModel}" 2.如果该控件写在r
阅读全文
摘要:默认的软件中的控件会自动监测本机语言系统,从而界面上的日期控件等会自动切换成对应的中/英文。为了保证系统一直处于中文状态,可在App.xaml.cs 中添加 System.Threading.Thread.CurrentThread.CurrentUICulture = new CultureInf
阅读全文
摘要:TreeViewAutomationPeer lvap = new TreeViewAutomationPeer(this.TreeViewOrg); var svap = lvap.GetPattern(PatternInterface.Scroll) as ScrollViewerAutomat
阅读全文
摘要:1.style 注意绿色标注处,如果想要在Listbox外使用滚动条,此处则要注销ScrollViewer,否则在界面区域只能显示ListBox时会出现点击一下,弹到顶端的问题。 <Grid.Resources> <!--SelectedItem with focus --> <SolidColor
阅读全文
摘要:1.阴影 <Border.Effect> <DropShadowEffect Color="Gray" Direction="320" BlurRadius="20" Opacity="0.7" ShadowDepth="10"/> </Border.Effect> 2.在Loaded中添加控件的按
阅读全文
摘要:地址写法 <!--<Image HorizontalAlignment="Center" VerticalAlignment="Center" Source="/XDS_SmartC_Client;component/Images/GIF/fileUpload.png"/>--> 图片预览:UCIm
阅读全文
摘要:根据鼠标滚轮缩放图片及拖动(可查看UCLeaveAndOverBlock) 以下是根据网上一些代码调整测试后的代码xaml <Image x:Name="imgUpload" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="
阅读全文
摘要:对于一些复杂的Sql数据处理,可写成Procedure,在Service中使用 var item = Context.SqlQuery<T>("存储过程名称", CommandType.StoredProcedure, pars).ToList(); pars要点1.输入参数(一一对应) DbPar
阅读全文
摘要:XAML特殊字符不能直接写,需如下1、特殊字符 字符实体 小于号(<) < 大于号(>) > &符号(&) & 引号(") " 换行 注:后面的分号不能少 2、显示一对大括号:{ABC} <Button Content="{}{ABC}"/>或者 <Butt
阅读全文
摘要:1.ListBox对于数据绑定:如绑定的是实体,正常使用DataSource和SelectedItem即可 如自己手动添加的ListBoxItem获取选中项b.需定义一个ListBoxItem类型的变量(如:SymbolSelected)绑定到SelectedItem;c.使用时SymbolSele
阅读全文
摘要:关于拖放,可以通过以下博客对拖放之间的事件关系进行了解http://www.cnblogs.com/loveis715/archive/2011/12/05/2277384.html 拖放的公用类库 Platform.Common中的DragAndDrop,其中DragDropAdorner用来显示
阅读全文
摘要:1.xaml控件使能 IsReadOnly ="True"只读 IsEnable ="False" 不可操作,变灰 IsHitTestVisible="False" 不可操作,不变灰 2.控件:内容控件(Content Control),集合控件(ItemControl) 3.资源地址:pack:/
阅读全文
摘要:1.Xaml 继承Style 用属性BaseOn 2.DataTemplete 3.ControlTemplete 4.WindowState = "Maximized" --最大化显示 5.Popup 6.依赖属性 静态存储,性能和控件较传统属性都是很大的提升。外部调用时可使用绑定。第二个Type
阅读全文
摘要:1.资源地址 pack://application:,,,/Views/10FinanceRoutineFlowWnd/UCFlowLeaveAndOverApplicant.xaml 2.RelativeSource 指定当前元素和绑定源的位置(Path)关系 :1.Self 自身的某些属性Hei
阅读全文