珂珂的个人博客 - 一个程序猿的个人网站

最新发布

[未分类]

WPF的MVVM实例(三)-ViewModel实现类

admin 阅读(3400) 评论(0)

usingMicrosoft.Win32; usingMyList.Common; usingMyList.Entity; usingMyList.Model; usingSystem; usingSystem.Collections.Generic; usingSystem.Collections.ObjectModel; usingSystem.Data; usingSystem.Linq; usingSystem.Threading.Tasks; usingSystem.Windows; usingSystem.Windows.Threading; names [...]   阅读全文

[未分类]

WPF的MVVM实例(二)-ViewModel基类

admin 阅读(2963) 评论(0)

usingMyList.Common; usingMyList.ViewModel.Util; usingSystem; usingSystem.Collections.ObjectModel; usingSystem.ComponentModel; usingSystem.Windows; usingSystem.Windows.Controls; usingSystem.Windows.Input; usingSystem.Windows.Threading; namespaceMyList.ViewModel { publicabstractclassBaseV [...]   阅读全文

[未分类]

WPF的MVVM实例(一)

admin 阅读(4335) 评论(0)

之前用Winform做了一个工具,主要目的是实现增删改查,现在用WPF来重构下,其实就是记录平时在网站上注册的用户名、密码、邮箱和电话绑定,以便忘记的时候查找,密码太多了...本来之前是做的开支记录和收藏夹,不过后来有了成熟的工具就没做了。至于要重构成WPF主要是想WPF的一个实例。我所理解的MVVM 基本就是靠Command属性来实现界面和后台代码的分离,不知道对不对.下面是登录界面,当然是用了FYJ.Winui下面是主界面当然是实现了数据变 界面也会自动变得。我这里做的是异步加载,网上找的很多都不是,中间也遇到了不少问题。编辑界面,做了验证 [...]   阅读全文

[未分类]

C# HSL和RGB处理

admin 阅读(2510) 评论(0)

在FYJ.Winui和FYJ.Winform中都用到了这个类,也是在网上找的,做了点修改usingSystem; usingSystem.Collections.Generic; usingSystem.Text; usingSystem.Drawing; namespaceFYJ.Winui.Util { publicclassHSLColor { privateint_alpha=255; privateint_hue=0; privatedouble_saturation=1d; privatedouble_lightness=1d; publicHSL [...]   阅读全文

[未分类]

WPF九宫格切图

admin 阅读(4196) 评论(0)

在做界面的时候,有时是很小的一张图片,我们不能直接将其放大,而是需要九宫格处理,所以android就原生支持.这是网上找的一段代码,自己经过一些修改。一个帮助类usingSystem; usingSystem.Collections.Generic; usingSystem.Linq; usingSystem.Text; usingSystem.Windows; usingSystem.Windows.Controls; usingSystem.Windows.Data; usingSystem.Windows.Documents; usingSystem.Windows.I [...]   阅读全文

[未分类]

FYJ.Winui系列(五)-主窗体

admin 阅读(3406) 评论(0)

基窗体写好,后面已经很简单了XAML代码<local:BaseWindowx:Class="FYJ.Winui.MainWindow" x:Name="mainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:FYJ.Winui&qu [...]   阅读全文

[未分类]

FYJ.Winui系列(四)-基窗体

admin 阅读(3117) 评论(0)

这当然也是费时间很多的一个点,我还在想着winform的继承思想,由于要继承不能有XAML代码,不过我们可以用变种方法来实现。WPF做界面确实比Winform好太多了.我们可以把窗体写成一个Style<ResourceDictionaryxmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:FY [...]   阅读全文

[未分类]

FYJ.Winui系列(三)-换肤控件

admin 阅读(3853) 评论(0)

这个事比较复杂,不过相对与FYJ.Winfrom中实现的可是简单许多了,这之前有点小问题,就是启动后要点两次才会换色,后来就一次,始终没打找到原因privatevoidCanvImage_sMouseDown(objectsender,MouseButtonEventArgse) { Pointp=e.GetPosition((IInputElement)sender); this.ellipsePixel_s.SetValue(Canvas.LeftProperty,p.X-4); this.ellipsePixel_s.SetValue(Canvas.TopProperty,p. [...]   阅读全文

[未分类]

FYJ.Winui系列(二)-按钮控件

admin 阅读(2480) 评论(0)

这里做简单了,只写了两种状态,正常状态和鼠标移进去的状态。来看看xaml代码<Buttonx:Class="FYJ.Winui.ButtonUserControl" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-com [...]   阅读全文

[未分类]

FYJ.Winui系列(一)

admin 阅读(3153) 评论(0)

是时候抛下Winform学下WPF了,之前不是写了一个FYJ.Winform嘛,确实花了很多时间,感觉很不值。现在来用WPF重构,却只花了一周多时间,当然有些控件没有做。确实花少量工作就能实现以前的大量工作...wifrom要各种重绘和处理windows消息界面跟以前的差不多不过这个无边框的拖动调整大小确实废了点事,当然最后也是网上找的一段。 [...]   阅读全文