编译镜像推送阿里云 pwsh 脚本
$ErrorActionPreference = "Stop" $account = 'xxx@yeah.net' $password = 'xxx' $server = 'registry.cn-hangzhou.aliyuncs.com' $tagName = …
2025-6-04 23:42
|
215
|
|
50 字
|
3 分钟
wpf 辉光卡片
看到有人用 Avalonia 实现,这里使用 wpf 实现 xaml <Grid> <Grid Width="150" Height="250"> <Grid.Resources> <GradientStopCollection x:Key="Gradien…
2025-6-04 21:17
|
185
|
|
104 字
|
5 分钟
wpf 自定义面板布局
这里实现了一个横向的简易版 StackPanel // 1. 计算需要的尺寸 protected override Size MeasureOverride(Size availableSize) { var resultSize = new Size(); // 需要的总尺寸 var currentLineSize = new Size(); /…
2025-6-04 20:34
|
125
|
|
131 字
|
6 分钟
.net 动态构建 LINQ
var item = Expression.Parameter(typeof(Product), "item"); var name = Expression.Property(item, nameof(Product.Name)); var price = Expression.Property(item, nameof(Pr…
2025-6-04 20:21
|
105
|
|
38 字
|
2 分钟
wpf 启动项目中加入测试后
编译会提示项目中存在多个 Main 方法(即多个入口点) 编译 csproj 文件,加入如下内容 <PropertyGroup> <!-- 指定项目中的启动 App 类的完整名称 --> <StartupObject>WpfDemoApp.App</StartupObject> </Proper…
2025-6-04 20:12
|
113
|
|
42 字
|
1 分钟内
wpf 跟随路径代码方式
使用 StrokeDashOffsetProperty 调整实线填充效果 调用 PathGeometry.GetPointAtFractionLength 获得当前坐标点及方向 xaml <Grid Loaded="FrameworkElement_OnLoaded"> <Grid.Resources> …
2025-6-04 11:51
|
62
|
|
181 字
|
8 分钟
wpf 跟随路径动画方式
xaml <Canvas> <Canvas.Resources> <!-- 1. 定义移动的路径, 这里画了一个五角形 --> <PathGeometry x:Key="MovePathGeometry" Figures="M 175,30 L 213.88,123.63 L …
2025-6-03 20:55
|
76
|
|
47 字
|
3 分钟
wpf 网格背景
原来使用控件,但是鼠标事件会受到子控件影响,现在改成装饰器 xaml <ctrlHelpers:GridLineDecorator> <Canvas /> </ctrlHelpers:GridLineDecorator> cs public class GridLineDecorator : Decorator …
2025-6-03 20:26
|
77
|
|
343 字
|
16 分钟
wpf 波浪进度条
画了个正弦波图形 这里使用其它方式实现 https://www.bilibili.com/video/BV1GL411H746 ,其它 css 中也看过这个思路 xaml <Border BorderBrush="#4d4CAF50" BorderThickness="1" ClipToBounds=&…
2025-6-03 12:36
|
89
|
|
142 字
|
6 分钟
wpf path data
<Grid TextElement.FontWeight="ExtraBold"> <Grid.Resources> <Style TargetType="Path"> <Setter Property="Stroke" Value="R…
2025-5-30 18:30
|
75
|
|
119 字
|
5 分钟