- 博客(18)
- 资源 (1)
- 收藏
- 关注
原创 采用Socket方式,测试服务器连接
public static bool CanServeConnected() { return TestConnection(ip, port, 3000); } /// /// 采用Socket方式,测试服务器连接 /// /// 服务器主机名或IP
2018-02-06 10:07:33 1438
原创 提示框
弹窗在View中,TipDialog在ViewModel中,通过Messenger通信 使用方式:在ViewModel中使用: TipDialog.Show(TipType.Success, "支付成功"); /// /// 提示类型(用于提示弹窗TIpDialog) /// public enum TipType { ///
2018-02-06 09:58:33 281
原创 Converter转换器
//放在App.xaml资源中local:DataConverter x:Key="dataConverter"/>xmlns:mvvm="http://www.galasoft.ch/mvvmlight"xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
2018-02-06 09:47:26 661
原创 ScrollBar
Style TargetType="{x:Type ScrollBar}"> Setter Property="Background" Value="Transparent"/> Setter Property="Stylus.IsPressAndHoldEnabled" Value="False"/> Setter Property="Stylus
2018-02-06 09:40:29 273
原创 弹窗样式
ControlTemplate x:Key="PopWindowTemplate" TargetType="{x:Type Window}"> Border Margin="3" CornerRadius="3" Background="{TemplateBinding Background}"> Border.Effect>
2018-02-06 09:38:17 854
原创 DataGrid
DataGrid ItemsSource="{Binding HotkeyList}" Padding="15 0 15 15"> DataGrid.Columns> DataGridTextColumn Binding="{Binding Function}" Header="功能" Width="*"/> DataGridTex
2018-02-06 09:35:18 191
原创 DatePicker
Style x:Key="CalendarDayButtonStyle" TargetType="{x:Type CalendarDayButton}"> Setter Property="MinWidth" Value="28" /> Setter Property="MinHeight" Value="5" /> Setter Property=
2018-02-06 09:32:22 292
原创 ComboBox
"ComboBoxItemTemplate" > Grid Height="45"> Text="{Binding }" VerticalAlignment="Center"/> Grid> "ComboBoxTemplate" TargetType="{x:Type ComboBox}"> Grid
2018-02-06 09:30:29 1076
原创 Service调用辅助类ServiceCore
大幅度简化服务器调用,例如: public class UserService { private const string userLogin_url = "/api/userlogin"; /// /// 用户登录 /// public static User UserLogin(strin
2018-02-05 17:01:23 540
原创 sqlite 辅助类 DalCore
大幅度简化本地数据库的查询,例如增删改查: /// /// 插入交接班信息 /// public static bool InsertHandoverRecord(HandoverRecord record) { return DalCore.InsertInfo(sql_InsertHa
2018-02-05 16:55:24 337
原创 WaterTextBox 带密码
带水印、带密码的输入框,示例: public class WaterTextBox : TextBox { static WaterTextBox() { DefaultStyleKeyProperty.OverrideMetadata(typeof(WaterTextBox), new FrameworkPropertyM
2018-02-05 16:46:14 234
原创 WPF ImageRadioButton
增加选中背景,透明度,和透明度模式。样例: public class ImageRadioButton : RadioButton { static ImageRadioButton() { DefaultStyleKeyProperty.OverrideMetadata(typeof(ImageRadioButton),
2018-02-05 16:37:23 785 1
原创 WPF ImageCheckButton
仅加了一个选中背景,示例: public class ImageCheckBox:CheckBox { static ImageCheckBox() { DefaultStyleKeyProperty.OverrideMetadata(typeof(ImageCheckBox), new FrameworkPropertyMe
2018-02-05 16:32:19 492
原创 WPF ImageButton
最常用的图片按钮: 有正常背景、鼠标滑过背景、鼠标按下背景、不可用背景、鼠标滑过透明度、是否是透明模式(若是则仅需正常背景即可,鼠标滑过和按下时则仅改变透明度),样式放在Generic.xaml中。 示例: public class ImageButton : Button { static ImageButton() {
2018-02-05 16:29:50 3231
原创 log4net的使用
1、配置文件configuration> configSections> section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,Log4net" /> configSections> log4net> appender name="RollingFileApp
2018-02-05 16:18:21 216
原创 App.config配置文件的使用
在App.config中加入需要配置的信息,如下:configuration> appSettings> add key="MaxLogFileCount" value="30" /> appSettings>configuration>对配置文件进行读写: var maxLogFileCount = GetConfig("maxLogF
2018-02-05 16:08:12 291
原创 WPF单例运行
在App.xaml中使用mutex: private Mutex mutex = new Mutex(true, "My Singleton Instance"); protected override void OnStartup(StartupEventArgs e) { //单例 if (mut
2018-02-05 15:59:08 385
原创 (WPF)连锁超市收银系统总结
前言 好久没写博客了,如今做完了一个收银系统,静下心来做一个简单的总结。虽然收银系统各种各样,到处都有,开源的也不少,但是自己亲手做了一遍以后也收获颇丰。相比其他收银软件,功能上没什么创新,主要在于客户要求界面美观友好,故此用WPF开发客户端,采用MVVMlight框架。服务端使用的是阿里云服务器,写成WebAPI供客户端使用,进行数据交互。下面仅介绍客户端: 项目结构 项目
2018-02-05 15:54:35 3437 5
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人