订单分类显示 快递金额明细统计, 快递在线充值 等

This commit is contained in:
wule committed 2026-07-24 11:16:37 +08:00
1 parent 7264835cc6
commit e00209cb24
37 files changed
+2764 -520

No files matched your search

@@ -0,0 +1,20 @@
<UserControl x:Class="_29WxOrderWpf.UserControls.UcWaterMarkTextBox"
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-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:_29WxOrderWpf.UserControls"
mc:Ignorable="d"
d:DesignHeight="28" d:DesignWidth="100">
<UserControl.Resources>
<ResourceDictionary>
<local:WaterMarkVisibilityConverter x:Key="WaterMarkVisibility"/>
</ResourceDictionary>
</UserControl.Resources>
<Grid>
<TextBox x:Name="txt" Text="{Binding Text, Mode=TwoWay}" Style="{StaticResource BaseRoundCornerTextBoxStyle}" BorderBrush="{StaticResource pageColorBrush}" BorderThickness="1"
HorizontalAlignment="Stretch" VerticalAlignment="Stretch" VerticalContentAlignment="Center" TextWrapping="{Binding TextWrapping}" TextChanged="txt_TextChanged"/>
<TextBlock x:Name="tbWaterMark" Text="{Binding WaterMark}" Margin="4,0,4,0" VerticalAlignment="Center" IsHitTestVisible="False" Foreground="DarkGray"
Visibility="{Binding ElementName=txt,Path=Text,Converter={StaticResource WaterMarkVisibility}}"></TextBlock>
</Grid>
</UserControl>
@@ -0,0 +1,75 @@
using NaiBa.Util.Extension;
using System;
using System.Collections.Generic;
using System.Drawing.Drawing2D;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using static System.Net.Mime.MediaTypeNames;
namespace _29WxOrderWpf.UserControls
{
/// <summary>
/// UcWaterMarkTextBox.xaml 的交互逻辑
/// </summary>
public partial class UcWaterMarkTextBox : UserControl
{
public event Action<object, TextChangedEventArgs> TextChanged;
public UcWaterMarkTextBox()
{
InitializeComponent();
DataContext = this;
//this.txt.TextChanged
}
public static readonly DependencyProperty TextProperty = DependencyProperty.Register("Text", typeof(string), typeof(UcWaterMarkTextBox), null);
public string Text
{
get { return (string)GetValue(TextProperty) == null ? "" : (string)GetValue(TextProperty); }
set { SetValue(TextProperty, value); }
}
public static readonly DependencyProperty WaterMarkProperty = DependencyProperty.Register("WaterMark", typeof(string), typeof(UcWaterMarkTextBox), null);
public string WaterMark
{
get { return (string)GetValue(WaterMarkProperty) == null ? "" : (string)GetValue(WaterMarkProperty); }
set { SetValue(WaterMarkProperty, value); }
}
public static readonly DependencyProperty TextWrappingProperty = DependencyProperty.Register("TextWrapping", typeof(TextWrapping), typeof(UcWaterMarkTextBox), null);
public TextWrapping TextWrapping
{
get { return (TextWrapping)GetValue(TextWrappingProperty); }
set { SetValue(TextWrappingProperty, value); }
}
private void txt_TextChanged(object sender, TextChangedEventArgs e)
{
this.Text = txt.Text;
TextChanged?.Invoke(this, e);
}
}
public class WaterMarkVisibilityConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
return value.ParseToString().IsNullOrEmpty() ? Visibility.Visible : Visibility.Collapsed;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException(); // 单向绑定可不实现
}
}
}
@@ -8,14 +8,14 @@ using System.Windows.Controls;
namespace _29WxOrderWpf.UserControls
{
public class UcWaterMarkTextBox : TextBox
public class UcWaterMarkTextBox1 : TextBox
{
public UcWaterMarkTextBox()
public UcWaterMarkTextBox1()
{
}
public static readonly DependencyProperty WaterMarkProperty = DependencyProperty.Register(
"WaterMark", typeof(string), typeof(UcWaterMarkTextBox), null);
"WaterMark", typeof(string), typeof(UcWaterMarkTextBox1), null);
public string WaterMark
{
get { return (string)GetValue(WaterMarkProperty); }