拆分按钮样式

This commit is contained in:
wule committed 2026-06-15 20:48:52 +08:00
1 parent d03a1e1466
commit 167885814e
37 files changed
+1009 -219

No files matched your search

+77 -4
View File
@@ -19,7 +19,7 @@
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<Optimize>true</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
@@ -34,12 +34,16 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>29wx.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="NaiBa.Util">
<HintPath>..\DllReference\NaiBa.Util.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Core" />
@@ -58,6 +62,33 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
<Compile Include="BaseWindows\BaseMsgWindow.xaml.cs">
<DependentUpon>BaseMsgWindow.xaml</DependentUpon>
</Compile>
<Compile Include="BaseWindows\BaseWindow.cs" />
<Compile Include="LoginWindows\LoginWindow.xaml.cs">
<DependentUpon>LoginWindow.xaml</DependentUpon>
</Compile>
<Compile Include="OrderCtrls\OrderListCtrl.xaml.cs">
<DependentUpon>OrderListCtrl.xaml</DependentUpon>
</Compile>
<Compile Include="ToolCtrls\Icons.xaml.cs">
<DependentUpon>Icons.xaml</DependentUpon>
</Compile>
<Compile Include="UserControls\UcImageButton.xaml.cs">
<DependentUpon>UcImageButton.xaml</DependentUpon>
</Compile>
<Compile Include="UserControls\WindowBoxes.xaml.cs">
<DependentUpon>WindowBoxes.xaml</DependentUpon>
</Compile>
<Page Include="BaseWindows\BaseMsgWindow.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="LoginWindows\LoginWindow.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="MainWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
@@ -70,6 +101,30 @@
<DependentUpon>MainWindow.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Page Include="OrderCtrls\OrderListCtrl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Styles\BaseWindowStyle.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Styles\UcImageButtonStyle.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="ToolCtrls\Icons.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="UserControls\UcImageButton.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="UserControls\WindowBoxes.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs">
@@ -97,14 +152,32 @@
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<Folder Include="UserControls\" />
</ItemGroup>
<ItemGroup />
<ItemGroup>
<ProjectReference Include="..\AllBase\29WxOrderAllBase.csproj">
<Project>{6461D807-B1C8-45F0-B388-E0CA1A418DE0}</Project>
<Name>29WxOrderAllBase</Name>
</ProjectReference>
<ProjectReference Include="..\Work\29WxOrderWork.csproj">
<Project>{1ad45d66-6872-4522-acf0-04e2c0514048}</Project>
<Name>29WxOrderWork</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\29wx.ico" />
</ItemGroup>
<ItemGroup>
<Resource Include="29wx.ico" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\WindowBoxes\close.hover.png" />
<Resource Include="Resources\WindowBoxes\close.png" />
<Resource Include="Resources\WindowBoxes\max.hover.png" />
<Resource Include="Resources\WindowBoxes\max.png" />
<Resource Include="Resources\WindowBoxes\min.hover.png" />
<Resource Include="Resources\WindowBoxes\min.png" />
<Resource Include="Resources\WindowBoxes\normal.hover.png" />
<Resource Include="Resources\WindowBoxes\normal.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
Binary file not shown.

After

Width:  |  Height:  |  Size: 224 KiB

+7 -1
View File
@@ -4,6 +4,12 @@
xmlns:local="clr-namespace:_29WxOrderWpf"
StartupUri="MainWindow.xaml">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Styles/UcImageButtonStyle.xaml" />
<ResourceDictionary Source="Styles/BaseWindowStyle.xaml" />
<!-- 可以添加更多资源字典 -->
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>
@@ -0,0 +1,18 @@
<local:BaseWindow xmlns:userctrols="clr-namespace:_29WxOrderWpf.UserControls" x:Class="_29WxOrderWpf.BaseWindows.BaseMsgWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:_29WxOrderWpf.BaseWindows"
mc:Ignorable="d" Style="{StaticResource BaseNoneBorderWindowStyle}"
Title="BaseMsgWindow" Height="450" Width="800">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="32"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<userctrols:WindowBoxes VerticalAlignment="Center" HorizontalAlignment="Right" Margin="4" MinBoxVisibility="Collapsed" MaxBoxVisibility="Collapsed"/>
<Border Margin="2,0,2,2" Grid.Row="1" Background="White">
</Border>
</Grid>
</local:BaseWindow>
@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
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.Shapes;
namespace _29WxOrderWpf.BaseWindows
{
/// <summary>
/// BaseMsgWindow.xaml 的交互逻辑
/// </summary>
public partial class BaseMsgWindow : BaseWindow
{
public BaseMsgWindow()
{
InitializeComponent();
this.DataContext = this;
}
}
}
+24
View File
@@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Interop;
using System.Windows.Media.Imaging;
using System.Windows.Shell;
namespace _29WxOrderWpf.BaseWindows
{
public class BaseWindow : Window
{
public BaseWindow()
{
this.Icon = new BitmapImage(new Uri("pack://application:,,,/Resources/29wx.ico"));
this.WindowStartupLocation = WindowStartupLocation.CenterScreen;
WindowChrome.SetWindowChrome(this, new WindowChrome() { CaptionHeight = 8, ResizeBorderThickness = new Thickness(4), });
this.DataContext = this;
}
}
}
@@ -0,0 +1,20 @@
<basewindows:BaseWindow x:Class="_29WxOrderWpf.LoginWindows.LoginWindow" xmlns:basewindows="clr-namespace:_29WxOrderWpf.BaseWindows"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:_29WxOrderWpf.LoginWindows"
xmlns:userctrls="clr-namespace:_29WxOrderWpf.UserControls"
mc:Ignorable="d" Style="{StaticResource BaseNoneBorderWindowStyle}"
Title="LoginWindow" Height="300" Width="400" ResizeMode="NoResize" Closing="BaseWindow_Closing">
<Grid Background="Transparent">
<Grid.RowDefinitions>
<RowDefinition Height="150"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<Grid Grid.Row="1" Margin="2,0,2,2" Background="White">
</Grid>
<userctrls:WindowBoxes VerticalAlignment="Top" HorizontalAlignment="Right" Margin="4" MaxBoxVisibility="Collapsed" MinBoxVisibility="Collapsed"/>
</Grid>
</basewindows:BaseWindow>
@@ -0,0 +1,36 @@
using _29WxOrderWpf.BaseWindows;
using System;
using System.Collections.Generic;
using System.Diagnostics;
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.Shapes;
using Work.BaseForms;
namespace _29WxOrderWpf.LoginWindows
{
/// <summary>
/// LoginWindow.xaml 的交互逻辑
/// </summary>
public partial class LoginWindow : BaseWindow
{
public LoginWindow()
{
InitializeComponent();
}
private void BaseWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
if (BaseMsgForm.ShowConfirm("是否关闭软件?\r\n必须登录账户才能使用,无账户请先注册一个", "请先登录或者注册").DialogResult == System.Windows.Forms.DialogResult.OK)
Process.GetCurrentProcess().Kill();
}
}
}
+14 -182
View File
@@ -1,193 +1,25 @@
<Window x:Class="_29WxOrderWpf.MainWindow"
<basewindows:BaseWindow xmlns:basewindows="clr-namespace:_29WxOrderWpf.BaseWindows" x:Class="_29WxOrderWpf.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:_29WxOrderWpf"
mc:Ignorable="d" WindowStyle="None" AllowsTransparency="True" Background="Transparent" FontSize="12" Foreground="#FF666666"
Title="MainWindow" Height="450" Width="800" WindowStartupLocation="CenterScreen" Loaded="Window_Loaded">
<WindowChrome.WindowChrome>
<!--边框可拖动范围-->
<WindowChrome CaptionHeight="10" ResizeBorderThickness="5" />
</WindowChrome.WindowChrome>
xmlns:orderctrls="clr-namespace:_29WxOrderWpf.OrderCtrls"
xmlns:uc="clr-namespace:_29WxOrderWpf.UserControls"
mc:Ignorable="d" Style="{StaticResource BaseNoneBorderWindowStyle}"
Title="MainWindow" Height="450" Width="800" Loaded="Window_Loaded" Closing="BaseWindow_Closing">
<Grid Background="AliceBlue">
<Grid Background="Transparent">
<Grid.RowDefinitions>
<RowDefinition Height="60"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<Border Grid.RowSpan="10" BorderThickness="1" BorderBrush="Blue">
<!--<TextBlock x:Name="TextBlock1" Text="1111"></TextBlock>-->
</Border>
<Grid Width="auto" Height="20">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="4"></ColumnDefinition>
<ColumnDefinition Width="20"></ColumnDefinition>
<ColumnDefinition Width="4"></ColumnDefinition>
<ColumnDefinition Width="20"></ColumnDefinition>
<ColumnDefinition Width="4"></ColumnDefinition>
<ColumnDefinition Width="20"></ColumnDefinition>
<ColumnDefinition Width="4"></ColumnDefinition>
<ColumnDefinition Width="20"></ColumnDefinition>
<ColumnDefinition Width="4"></ColumnDefinition>
<ColumnDefinition Width="20"></ColumnDefinition>
<ColumnDefinition Width="4"></ColumnDefinition>
<ColumnDefinition Width="20"></ColumnDefinition>
<ColumnDefinition Width="4"></ColumnDefinition>
</Grid.ColumnDefinitions>
<!--<Path Grid.Row="0" Grid.Column="1" Stroke="Black" StrokeThickness="1" Data="M0 54.857h36.571V128H0V54.857zM91.429 27.43H128V128H91.429V27.429zM45.714 0h36.572v128H45.714V0z" Stretch="Uniform" />
<Path Grid.Row="0" Grid.Column="3" Stroke="Black" StrokeThickness="1" Data="M768 64a128 128 0 0 1 128 128v640a128 128 0 0 1-128 128H256a128 128 0 0 1-128-128V192a128 128 0 0 1 128-128h512z m-96 608h-320a32 32 0 1 0 0 64h320a32 32 0 1 0 0-64z m0-192h-320a32 32 0 0 0 0 64h320a32 32 0 1 0 0-64z m-256-192h-64a32 32 0 0 0 0 64h64a32 32 0 0 0 0-64z m256 0h-128a32 32 0 0 0 0 64h128a32 32 0 1 0 0-64z" Margin="0,0,0,0" Grid.RowSpan="2" Stretch="Fill" />
<Path Grid.Row="0" Grid.Column="5" Fill="#0051FF" Stroke="Transparent" StrokeThickness="1" Data="M657.84768 704.32H519.35168l79.808-454.4h138.432z M405.68768 704.32H267.19168l56.96-324.608h138.432z M886.58368 50.432l-12.8 71.424-38.4 218.816-2.368 13.568-3.264 18.368-62.528 356.736a130.688 130.688 0 0 1-123.136 104.704H235.89568a85.696 85.696 0 0 1-86.592-104.512L215.09568 354.56a130.624 130.624 0 0 1 123.072-104.704H484.85568l24.384-139.2H324.66368a256 256 0 0 0-241.28 205.248L4.15168 768.128a168 168 0 0 0 169.152 205.248h484.16a256 256 0 0 0 241.216-205.248l74.944-427.2 4.416-25.024L1025.01568 50.688z" Margin="0,0,0,0" Grid.RowSpan="2" Stretch="Fill" />
<Path Grid.Row="0" Grid.Column="7" Fill="#0051FF" Stroke="Transparent" StrokeThickness="1" Data="M539.04256 845.248V512.192a32.448 32.448 0 0 0-32-32.192c-17.664 0-32 14.912-32 32.192v333.056l-36.096-36.096a32.192 32.192 0 0 0-45.056 0.192 31.616 31.616 0 0 0-0.192 45.056l90.88 90.944a31.36 31.36 0 0 0 22.528 9.088 30.08 30.08 0 0 0 22.4-9.088l90.88-90.88a32.192 32.192 0 0 0-0.192-45.12 31.616 31.616 0 0 0-45.056-0.192l-36.096 36.096z M768.35456 416a256 256 0 1 0-512 0 192 192 0 1 0 0 384v64a256 256 0 0 1-58.88-505.216 320.128 320.128 0 0 1 629.76 0A256.128 256.128 0 0 1 768.35456 864v-64a192 192 0 0 0 0-384z m-512 384h64v64H256.35456v-64z m448 0h64v64h-64v-64z" Margin="0,0,0,0" Grid.RowSpan="2" Stretch="Fill" />
<Path Grid.Row="0" Grid.Column="9" Fill="#0051FF" Stroke="Transparent" StrokeThickness="1" Data="M73.137 29.08h-9.209 29.7L63.886.093 34.373 29.08h20.49v27.035H27.238v17.948h27.625v27.133h18.274V74.063h27.41V56.115h-27.41V29.08zm-9.245 98.827l27.518-26.711H36.59l27.302 26.71zM.042 64.982l27.196 27.029V38.167L.042 64.982zm100.505-26.815V92.01l27.41-27.029-27.41-26.815z" Margin="0,0,0,0" Grid.RowSpan="2" Stretch="Fill" />-->
<!--<Border Grid.RowSpan="10" BorderThickness="1" BorderBrush="Blue">
</Border>-->
<Grid x:Name="gridContainer" Grid.Row="1" Background="White" Margin="2,0,2,2">
<orderctrls:OrderListWindow x:Name="OrderListWindow" Visibility="Hidden"></orderctrls:OrderListWindow>
</Grid>
<Button Grid.Row="0" Content="x" HorizontalAlignment="Right" Margin="4" VerticalAlignment="Top" Width="20" Height="20" Click="btnClose_Click"/>
<DataGrid Grid.Row="1" Opacity="0" HorizontalContentAlignment="Center" Margin="2,0,2,2" RowHeight="60" x:Name="dgOrder" Grid.ColumnSpan="2"
ItemsSource="{Binding lstOrder}" AutoGenerateColumns = "False" HorizontalGridLinesBrush="LightGray" VerticalGridLinesBrush="LightGray"
CanUserDeleteRows="False" CanUserAddRows="False" ColumnHeaderHeight="40">
<DataGrid.RowStyle>
<Style TargetType="DataGridRow">
<Setter Property="Background" Value="White"/>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="AliceBlue"/>
</Trigger>
</Style.Triggers>
</Style>
</DataGrid.RowStyle>
<DataGrid.CellStyle>
<Style TargetType="DataGridCell">
<Setter Property="Background" Value="White"/>
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="AliceBlue"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Foreground" Value="Black"/>
</Trigger>
</Style.Triggers>
</Style>
</DataGrid.CellStyle>
<DataGrid.Columns>
<DataGridCheckBoxColumn Binding="{x:Null}" ClipboardContentBinding="{x:Null}" Width="50"/>
<DataGridTemplateColumn Width="*" Header="订单编号" >
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="auto"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<TextBox Grid.Row="1" HorizontalAlignment="Center" Width="Auto" Height="20" Background="Transparent" IsReadOnly="True" Text="{Binding order_id}" BorderThickness="0"></TextBox>
</Grid>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Width="*" Header="图标">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="auto"></RowDefinition>
<RowDefinition Height="auto"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<Border Grid.Row="1" HorizontalAlignment="Center" Width="Auto" Height="26" Padding="0" Margin="5" CornerRadius="5" Background="LightYellow" BorderBrush="Orange" BorderThickness="1">
<Label HorizontalAlignment="Center" Width="Auto" Content="店铺待发货" Foreground="Orange"></Label>
</Border>
<TextBox Grid.Row="2" HorizontalAlignment="Center" Width="Auto" Height="20" Background="Transparent" IsReadOnly="True" Text="收货地址 吕* 1********** 江苏省 镇江市 京口区" BorderThickness="0"></TextBox>
</Grid>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
<Grid Grid.Row="1">
<Grid.RowDefinitions>
<RowDefinition Height="40"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<Grid Margin="4,0" Background="White">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="40"></ColumnDefinition>
<ColumnDefinition Width="100*"></ColumnDefinition>
<ColumnDefinition Width="50*"></ColumnDefinition>
<ColumnDefinition Width="50*"></ColumnDefinition>
<ColumnDefinition Width="100*"></ColumnDefinition>
<ColumnDefinition Width="50*"></ColumnDefinition>
<ColumnDefinition Width="50*"></ColumnDefinition>
<ColumnDefinition Width="50*"></ColumnDefinition>
</Grid.ColumnDefinitions>
</Grid>
<ListBox IsHitTestVisible="True" Opacity="1" ItemsSource="{Binding lstOrder}" Grid.Row="1" HorizontalContentAlignment="Stretch" x:Name="lbxOrder" Margin="4,0,4,4">
<!--使用自定义属性模板去除ListBox高亮显示框-->
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ListBoxItem">
<ContentPresenter Content="{TemplateBinding Content}"
ContentStringFormat="{TemplateBinding ContentStringFormat}"
ContentTemplate="{TemplateBinding ContentTemplate}" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ListBox.ItemContainerStyle>
<ListBox.ItemTemplate>
<DataTemplate>
<Border Margin="12,12,12,0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" BorderThickness="1" BorderBrush="LightGray" CornerRadius="10">
<Border.Style>
<!-- 鼠标进入或悬停Border时切换颜色(悬停时Border的填充控件必须有填充Border,所在层级不限,仅填充透明Grid则触发器无效) -->
<Style TargetType="Border">
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="AliceBlue"/>
</Trigger>
</Style.Triggers>
</Style>
</Border.Style>
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch" MinHeight="120">
<Grid.RowDefinitions>
<RowDefinition Height="auto"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<Border Background="AliceBlue" CornerRadius="12,12,0,0" >
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="auto"/>
</Grid.ColumnDefinitions>
<TextBox Grid.Column="0" Margin="8,8,0,8" VerticalAlignment="Center" FontSize="14" Background="Transparent" IsReadOnly="True" Text="店铺单号:" BorderThickness="0" />
<TextBox Grid.Column="1" Margin="0,8,8,8" VerticalAlignment="Center" FontSize="14" Background="Transparent" IsReadOnly="True" Text="{Binding order_id}" BorderThickness="0" />
<Border Grid.Column="2" Width="12" Background="AliceBlue" Height="12" VerticalAlignment="Center" Cursor="Hand" Tag="{Binding order_id}" MouseLeftButtonDown="Path_MouseLeftButtonDown">
<Path Margin="0,0,0,0" Fill="#409eff" Tag="{Binding order_id}" MouseLeftButtonDown="Path_MouseLeftButtonDown" Data="M80 432a128 128 0 0 1 128-128h384a128 128 0 0 1 128 128v384a128 128 0 0 1-128 128h-384a128 128 0 0 1-128-128v-384z m128-64a64 64 0 0 0-64 64v384a64 64 0 0 0 64 64h384a64 64 0 0 0 64-64v-384a64 64 0 0 0-64-64h-384z M816 144h-384a64 64 0 0 0-64 64 32 32 0 0 1-64 0 128 128 0 0 1 128-128h384a128 128 0 0 1 128 128v384a128 128 0 0 1-128 128 32 32 0 0 1 0-64 64 64 0 0 0 64-64v-384a64 64 0 0 0-64-64z" Stretch="Uniform" />
</Border>
</Grid>
</Border>
<Border Grid.Row="1" Background="Transparent" CornerRadius="0,0,12,12" >
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="auto"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
</Grid>
</Border>
</Grid>
</Border>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid>
</Grid>
</Window>
<uc:WindowBoxes VerticalAlignment="Top" HorizontalAlignment="Right" Margin="4" MaxBoxVisibility="Visible"/>
<!--<Button Grid.Row="0" Content="x" HorizontalAlignment="Right" Margin="4" VerticalAlignment="Top" Width="20" Height="20" Click="btnClose_Click"/>-->
</Grid>
</basewindows:BaseWindow>
+126 -21
View File
@@ -1,13 +1,21 @@
using AllBase;
using _29WxOrderWpf.BaseWindows;
using _29WxOrderWpf.OrderCtrls;
using AllBase;
using AllBase.Extension;
using AllBase.Model;
using NaiBa.Util;
using NaiBa.Util.Extension;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Linq;
using System.Net;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
@@ -18,21 +26,19 @@ using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Work;
namespace _29WxOrderWpf
{
/// <summary>
/// MainWindow.xaml 的交互逻辑
/// </summary>
public partial class MainWindow : Window
public partial class MainWindow : BaseWindow
{
public ObservableCollection<oms_wei_order_info> lstOrder { get; set; } = new ObservableCollection<oms_wei_order_info>();
public List<oms_wei_order_info> lstOrder1 { get; set; } = new List<oms_wei_order_info>();
public MainWindow()
{
InitializeComponent();
//DataContext = this;
this.DataContext = this;
this.Height = 800;
this.Width = 1600;
@@ -40,31 +46,130 @@ namespace _29WxOrderWpf
private void Window_Loaded(object sender, RoutedEventArgs e)
{
//MyData newItem = new MyData { Name = "New Person", Age = 28 }; // 创建新数据项
//_myDataCollection.Add(newItem); // 添加到集合中
//dataGrid.Items.Refresh();.
//dgOrder.Items.Add(1111111);
new Thread(AutoAntiGrabbingMechanism).Start(); // 反抓包
dgOrder.ItemsSource = lstOrder;
#region 弹出登录窗口
LoginWindows.LoginWindow loginWindow = new LoginWindows.LoginWindow();
loginWindow.Owner = this;
loginWindow.ShowDialog();
#endregion
}
lbxOrder.ItemsSource = lstOrder;
for (int i = 0; i < 10000; i++)
private void BaseWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
}
#region 反抓包功能
private void AutoAntiGrabbingMechanism()
{
while (true)
{
//lstOrder.Add(new oms_wei_order_info() { id = 1, is_select = false, order_id = ("3737033423685556736".ParseToLong() + Randomx.GetId(0,100)).ParseToString(), shop_name = "媛卡曦工厂优选" });
lstOrder.Add(new oms_wei_order_info() { id = 1, is_select = false, order_id = Randomx.GetId(1000,10000).ParseToString(), shop_name = "媛卡曦工厂优选" });
#if DEBUG
#else
AntiGrabbingMechanism();
#endif
try { Thread.Sleep(3000); } catch { }
}
lstOrder.SortDesc(o => o.order_id.ParseToLong());
}
private void btnClose_Click(object sender, RoutedEventArgs e)
[DllImport("kernel32.dll", SetLastError = true, CallingConvention = CallingConvention.Winapi)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static extern bool IsWow64Process([In] IntPtr process, [Out] out bool wow64Process);
private List<string> _AntiProcesses = "WINRAR,WIRESHARK,FIDDLER,HTTPDEBUGGERPRO,IEHTTPANALYZER,CHARLES,HTTPWATCH,SMARTSNIFF,MINISNIFFER,PROXIFIER,HTTP ANALYZER,SNIFFER,WSOCKEXPERT,IPANALYSE,ANALYZER,HTTP ANALYZER STAND-ALONE EDITION".Split(',').ToList();
private void AntiGrabbingMechanism()
{
this.Close();
//Gate 1 - Anti Proxy
if (IsUseSystemProxy())
{
LockUserAndKillProcess();
}
//Gate 2 - Anti Special Processes
System.Diagnostics.Process[] processList = System.Diagnostics.Process.GetProcesses();
foreach (System.Diagnostics.Process process in processList)
{
try
{
if (_AntiProcesses.Contains(process.ProcessName.ToUpper()))
{
process.Kill();
LockUserAndKillProcess();
}
if (process.MainWindowTitle.Contains("正在捕获"))
{
process.Kill();
LockUserAndKillProcess();
}
if (!IsWin23App(process))
{
continue;
}
if (process.MainModule?.FileVersionInfo.FileDescription != null)
{
foreach (string antiProcess in _AntiProcesses)
{
if (process.MainModule.FileVersionInfo.FileDescription.ToUpper().Contains(antiProcess))
{
process.Kill();
LockUserAndKillProcess();
}
}
}
}
catch (Exception e)
{
}
}
}
private void Path_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
private void LockUserAndKillProcess()
{
var orderId = ((sender as Border)?.Tag).ParseToString();
Clipboard.SetText(orderId);
string url = BaseClass.BuildObjString("user&act=add_user_lock");
string data = UserLogin.GetSignaturex("", "");
string html = GetHtml.PostUtf8(url, data);
Process.GetCurrentProcess().Kill();
}
public static bool IsUseSystemProxy()
{
BindingFlags bindingAttr = BindingFlags.Instance | BindingFlags.NonPublic;
IWebProxy systemWebProxy = WebRequest.GetSystemWebProxy();
FieldInfo field1 = systemWebProxy.GetType().GetField("webProxy", bindingAttr);
if (field1 != (FieldInfo)null)
{
WebProxy webProxy = field1.GetValue((object)systemWebProxy) as WebProxy;
FieldInfo field2 = webProxy.GetType().GetField("_ProxyHostAddresses", bindingAttr);
if (field2 != (FieldInfo)null)
{
Hashtable hashtable = field2.GetValue((object)webProxy) as Hashtable;
if (hashtable != null && hashtable.Count > 0)
return true;
}
}
return false;
}
public bool IsWin23App(Process process)
{
if (Environment.Is64BitOperatingSystem)
{
IntPtr processHandle;
bool retVal;
try
{
processHandle = Process.GetProcessById(process.Id).Handle;
}
catch
{
return false;
}
return IsWow64Process(processHandle, out retVal) && retVal;
}
return true;
}
#endregion
}
}
+158
View File
@@ -0,0 +1,158 @@
<UserControl x:Class="_29WxOrderWpf.OrderCtrls.OrderListWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:_29WxOrderWpf.OrderCtrls"
mc:Ignorable="d"
Height="450" Width="800" Loaded="Window_Loaded">
<Grid Background="AliceBlue">
<DataGrid Grid.Row="1" Opacity="0" HorizontalContentAlignment="Center" Margin="2,0,2,2" RowHeight="60" x:Name="dgOrder" Grid.ColumnSpan="2"
ItemsSource="{Binding lstOrder}" AutoGenerateColumns = "False" HorizontalGridLinesBrush="LightGray" VerticalGridLinesBrush="LightGray"
CanUserDeleteRows="False" CanUserAddRows="False" ColumnHeaderHeight="40">
<DataGrid.RowStyle>
<Style TargetType="DataGridRow">
<Setter Property="Background" Value="White"/>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="AliceBlue"/>
</Trigger>
</Style.Triggers>
</Style>
</DataGrid.RowStyle>
<DataGrid.CellStyle>
<Style TargetType="DataGridCell">
<Setter Property="Background" Value="White"/>
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="AliceBlue"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Foreground" Value="Black"/>
</Trigger>
</Style.Triggers>
</Style>
</DataGrid.CellStyle>
<DataGrid.Columns>
<DataGridCheckBoxColumn Binding="{x:Null}" ClipboardContentBinding="{x:Null}" Width="50"/>
<DataGridTemplateColumn Width="*" Header="订单编号" >
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="auto"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<TextBox Grid.Row="1" HorizontalAlignment="Center" Width="Auto" Height="20" Background="Transparent" IsReadOnly="True" Text="{Binding order_id}" BorderThickness="0"></TextBox>
</Grid>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Width="*" Header="图标">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="auto"></RowDefinition>
<RowDefinition Height="auto"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<Border Grid.Row="1" HorizontalAlignment="Center" Width="Auto" Height="26" Padding="0" Margin="5" CornerRadius="5" Background="LightYellow" BorderBrush="Orange" BorderThickness="1">
<Label HorizontalAlignment="Center" Width="Auto" Content="店铺待发货" Foreground="Orange"></Label>
</Border>
<TextBox Grid.Row="2" HorizontalAlignment="Center" Width="Auto" Height="20" Background="Transparent" IsReadOnly="True" Text="收货地址 吕* 1********** 江苏省 镇江市 京口区" BorderThickness="0"></TextBox>
</Grid>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
<Grid Grid.Row="1">
<Grid.RowDefinitions>
<RowDefinition Height="40"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<Grid Margin="4,0" Background="White">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="40"></ColumnDefinition>
<ColumnDefinition Width="100*"></ColumnDefinition>
<ColumnDefinition Width="50*"></ColumnDefinition>
<ColumnDefinition Width="50*"></ColumnDefinition>
<ColumnDefinition Width="100*"></ColumnDefinition>
<ColumnDefinition Width="50*"></ColumnDefinition>
<ColumnDefinition Width="50*"></ColumnDefinition>
<ColumnDefinition Width="50*"></ColumnDefinition>
</Grid.ColumnDefinitions>
</Grid>
<ListBox IsHitTestVisible="True" Opacity="1" ItemsSource="{Binding lstOrder}" Grid.Row="1" HorizontalContentAlignment="Stretch" x:Name="lbxOrder" Margin="4,0,4,4">
<!--使用自定义属性模板去除ListBox高亮显示框-->
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ListBoxItem">
<ContentPresenter Content="{TemplateBinding Content}"
ContentStringFormat="{TemplateBinding ContentStringFormat}"
ContentTemplate="{TemplateBinding ContentTemplate}" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ListBox.ItemContainerStyle>
<ListBox.ItemTemplate>
<DataTemplate>
<Border Margin="12,12,12,0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" BorderThickness="1" BorderBrush="LightGray" CornerRadius="10">
<Border.Style>
<!-- 鼠标进入或悬停Border时切换颜色(悬停时Border的填充控件必须有填充Border,所在层级不限,仅填充透明Grid则触发器无效) -->
<Style TargetType="Border">
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="AliceBlue"/>
</Trigger>
</Style.Triggers>
</Style>
</Border.Style>
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch" MinHeight="120">
<Grid.RowDefinitions>
<RowDefinition Height="auto"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<Border Background="AliceBlue" CornerRadius="12,12,0,0" >
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="auto"/>
</Grid.ColumnDefinitions>
<TextBox Grid.Column="0" Margin="8,8,0,8" VerticalAlignment="Center" FontSize="14" Background="Transparent" IsReadOnly="True" Text="店铺单号:" BorderThickness="0" />
<TextBox Grid.Column="1" Margin="0,8,8,8" VerticalAlignment="Center" FontSize="14" Background="Transparent" IsReadOnly="True" Text="{Binding order_id}" BorderThickness="0" />
<Border Grid.Column="2" Width="12" Background="AliceBlue" Height="12" VerticalAlignment="Center" Cursor="Hand" Tag="{Binding order_id}" MouseLeftButtonDown="Path_MouseLeftButtonDown">
<Path Margin="0,0,0,0" Fill="#409eff" Tag="{Binding order_id}" MouseLeftButtonDown="Path_MouseLeftButtonDown" Data="M80 432a128 128 0 0 1 128-128h384a128 128 0 0 1 128 128v384a128 128 0 0 1-128 128h-384a128 128 0 0 1-128-128v-384z m128-64a64 64 0 0 0-64 64v384a64 64 0 0 0 64 64h384a64 64 0 0 0 64-64v-384a64 64 0 0 0-64-64h-384z M816 144h-384a64 64 0 0 0-64 64 32 32 0 0 1-64 0 128 128 0 0 1 128-128h384a128 128 0 0 1 128 128v384a128 128 0 0 1-128 128 32 32 0 0 1 0-64 64 64 0 0 0 64-64v-384a64 64 0 0 0-64-64z" Stretch="Uniform" />
</Border>
</Grid>
</Border>
<Border Grid.Row="1" Background="Transparent" CornerRadius="0,0,12,12" >
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="auto"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
</Grid>
</Border>
</Grid>
</Border>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid>
</Grid>
</UserControl>
@@ -0,0 +1,67 @@
using AllBase;
using AllBase.Extension;
using AllBase.Model;
using NaiBa.Util.Extension;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
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.Shapes;
namespace _29WxOrderWpf.OrderCtrls
{
/// <summary>
/// OrderListWindow.xaml 的交互逻辑
/// </summary>
public partial class OrderListWindow : UserControl
{
public ObservableCollection<oms_wei_order_info> lstOrder { get; set; } = new ObservableCollection<oms_wei_order_info>();
public List<oms_wei_order_info> lstOrder1 { get; set; } = new List<oms_wei_order_info>();
public OrderListWindow()
{
InitializeComponent();
}
private void Window_Loaded(object sender, RoutedEventArgs e)
{
//MyData newItem = new MyData { Name = "New Person", Age = 28 }; // 创建新数据项
//_myDataCollection.Add(newItem); // 添加到集合中
//dataGrid.Items.Refresh();.
//dgOrder.Items.Add(1111111);
dgOrder.ItemsSource = lstOrder;
lbxOrder.ItemsSource = lstOrder;
for (int i = 0; i < 10000; i++)
{
//lstOrder.Add(new oms_wei_order_info() { id = 1, is_select = false, order_id = ("3737033423685556736".ParseToLong() + Randomx.GetId(0,100)).ParseToString(), shop_name = "媛卡曦工厂优选" });
lstOrder.Add(new oms_wei_order_info() { id = 1, is_select = false, order_id = Randomx.GetId(1000, 10000).ParseToString(), shop_name = "媛卡曦工厂优选" });
}
lstOrder.SortDesc(o => o.order_id.ParseToLong());
}
private void Path_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
var orderId = ((sender as Border)?.Tag).ParseToString();
try
{
Clipboard.SetText(orderId);
}
catch (Exception ex)
{
}
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 224 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 948 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 956 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

+53
View File
@@ -0,0 +1,53 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Style x:Key="BaseWindowStyle" TargetType="Window">
<Setter Property="Background" Value="#FF98638f"/>
<Setter Property="Foreground" Value="#FF666666"/>
<Setter Property="FontSize" Value="12"/>
<!-- 其他样式设置 -->
</Style>
<Style x:Key="BaseNoneBorderWindowStyle" TargetType="Window">
<Setter Property="Background" Value="#FF98638f"/>
<Setter Property="Foreground" Value="#FF666666"/>
<Setter Property="FontSize" Value="12"/>
<Setter Property="WindowStyle" Value="None"/>
<Setter Property="AllowsTransparency" Value="True"/>
</Style>
<!--使用自定义属性模板去除Button高亮显示框-->
<!--<Style TargetType="Button">
<Setter Property="Cursor" Value="Hand"></Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<ContentPresenter Content="{TemplateBinding Content}"
ContentStringFormat="{TemplateBinding ContentStringFormat}"
ContentTemplate="{TemplateBinding ContentTemplate}" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>-->
<!--<Style TargetType="Button">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Padding="{TemplateBinding Padding}">
<Grid Background="Transparent">
<ContentPresenter Content="{TemplateBinding Content}"
ContentStringFormat="{TemplateBinding ContentStringFormat}"
ContentTemplate="{TemplateBinding ContentTemplate}"
HorizontalAlignment="Center"
VerticalAlignment="Center">
</ContentPresenter>
</Grid>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>-->
</ResourceDictionary>
@@ -0,0 +1,39 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:_29WxOrderWpf.UserControls">
<Style TargetType="{x:Type local:UcImageButton}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type local:UcImageButton}">
<Border Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Padding="{TemplateBinding Padding}">
<Grid Background="Transparent">
<Image x:Name="buttonImage" Source="{TemplateBinding ButtonImage}" Stretch="Uniform"/>
<Image x:Name="mouseOverButtonImage" Visibility="Collapsed" Source="{TemplateBinding MouseOverButtonImage}" Stretch="Uniform"/>
<Image x:Name="mousePressButtonImage" Visibility="Collapsed" Source="{TemplateBinding MousePressButtonImage}" Stretch="Uniform"/>
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center">
</ContentPresenter>
</Grid>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Visibility" TargetName="buttonImage" Value="Collapsed"/>
<Setter Property="Visibility" TargetName="mouseOverButtonImage" Value="Visible"/>
<Setter Property="Visibility" TargetName="mousePressButtonImage" Value="Collapsed"/>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter Property="Visibility" TargetName="buttonImage" Value="Collapsed"/>
<Setter Property="Visibility" TargetName="mouseOverButtonImage" Value="Collapsed"/>
<Setter Property="Visibility" TargetName="mousePressButtonImage" Value="Visible"/>
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Opacity" Value="0.5" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
+33
View File
@@ -0,0 +1,33 @@
<UserControl x:Class="_29WxOrderWpf.UserControls.Icon"
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="450" d:DesignWidth="800">
<Grid>
<Grid Width="auto" Height="20" Opacity="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="4"></ColumnDefinition>
<ColumnDefinition Width="20"></ColumnDefinition>
<ColumnDefinition Width="4"></ColumnDefinition>
<ColumnDefinition Width="20"></ColumnDefinition>
<ColumnDefinition Width="4"></ColumnDefinition>
<ColumnDefinition Width="20"></ColumnDefinition>
<ColumnDefinition Width="4"></ColumnDefinition>
<ColumnDefinition Width="20"></ColumnDefinition>
<ColumnDefinition Width="4"></ColumnDefinition>
<ColumnDefinition Width="20"></ColumnDefinition>
<ColumnDefinition Width="4"></ColumnDefinition>
<ColumnDefinition Width="20"></ColumnDefinition>
<ColumnDefinition Width="4"></ColumnDefinition>
</Grid.ColumnDefinitions>
<Path Grid.Row="0" Grid.Column="1" Fill="#0051FF" Stroke="Transparent" StrokeThickness="1" Data="M0 54.857h36.571V128H0V54.857zM91.429 27.43H128V128H91.429V27.429zM45.714 0h36.572v128H45.714V0z" Stretch="Uniform" />
<Path Grid.Row="0" Grid.Column="3" Fill="#0051FF" Stroke="Transparent" StrokeThickness="1" Data="M768 64a128 128 0 0 1 128 128v640a128 128 0 0 1-128 128H256a128 128 0 0 1-128-128V192a128 128 0 0 1 128-128h512z m-96 608h-320a32 32 0 1 0 0 64h320a32 32 0 1 0 0-64z m0-192h-320a32 32 0 0 0 0 64h320a32 32 0 1 0 0-64z m-256-192h-64a32 32 0 0 0 0 64h64a32 32 0 0 0 0-64z m256 0h-128a32 32 0 0 0 0 64h128a32 32 0 1 0 0-64z" Margin="0,0,0,0" Grid.RowSpan="2" Stretch="Fill" />
<Path Grid.Row="0" Grid.Column="5" Fill="#0051FF" Stroke="Transparent" StrokeThickness="1" Data="M657.84768 704.32H519.35168l79.808-454.4h138.432z M405.68768 704.32H267.19168l56.96-324.608h138.432z M886.58368 50.432l-12.8 71.424-38.4 218.816-2.368 13.568-3.264 18.368-62.528 356.736a130.688 130.688 0 0 1-123.136 104.704H235.89568a85.696 85.696 0 0 1-86.592-104.512L215.09568 354.56a130.624 130.624 0 0 1 123.072-104.704H484.85568l24.384-139.2H324.66368a256 256 0 0 0-241.28 205.248L4.15168 768.128a168 168 0 0 0 169.152 205.248h484.16a256 256 0 0 0 241.216-205.248l74.944-427.2 4.416-25.024L1025.01568 50.688z" Margin="0,0,0,0" Grid.RowSpan="2" Stretch="Fill" />
<Path Grid.Row="0" Grid.Column="7" Fill="#0051FF" Stroke="Transparent" StrokeThickness="1" Data="M539.04256 845.248V512.192a32.448 32.448 0 0 0-32-32.192c-17.664 0-32 14.912-32 32.192v333.056l-36.096-36.096a32.192 32.192 0 0 0-45.056 0.192 31.616 31.616 0 0 0-0.192 45.056l90.88 90.944a31.36 31.36 0 0 0 22.528 9.088 30.08 30.08 0 0 0 22.4-9.088l90.88-90.88a32.192 32.192 0 0 0-0.192-45.12 31.616 31.616 0 0 0-45.056-0.192l-36.096 36.096z M768.35456 416a256 256 0 1 0-512 0 192 192 0 1 0 0 384v64a256 256 0 0 1-58.88-505.216 320.128 320.128 0 0 1 629.76 0A256.128 256.128 0 0 1 768.35456 864v-64a192 192 0 0 0 0-384z m-512 384h64v64H256.35456v-64z m448 0h64v64h-64v-64z" Margin="0,0,0,0" Grid.RowSpan="2" Stretch="Fill" />
<Path Grid.Row="0" Grid.Column="9" Fill="#0051FF" Stroke="Transparent" StrokeThickness="1" Data="M73.137 29.08h-9.209 29.7L63.886.093 34.373 29.08h20.49v27.035H27.238v17.948h27.625v27.133h18.274V74.063h27.41V56.115h-27.41V29.08zm-9.245 98.827l27.518-26.711H36.59l27.302 26.71zM.042 64.982l27.196 27.029V38.167L.042 64.982zm100.505-26.815V92.01l27.41-27.029-27.41-26.815z" Margin="0,0,0,0" Grid.RowSpan="2" Stretch="Fill" />
</Grid>
</Grid>
</UserControl>
+28
View File
@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
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;
namespace _29WxOrderWpf.UserControls
{
/// <summary>
/// Icon.xaml 的交互逻辑
/// </summary>
public partial class Icon : UserControl
{
public Icon()
{
InitializeComponent();
}
}
}
@@ -0,0 +1,8 @@
<Button x:Class="_29WxOrderWpf.UserControls.UcImageButton"
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" Width="30" Height="22">
</Button>
@@ -0,0 +1,55 @@
using System;
using System.Collections.Generic;
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;
namespace _29WxOrderWpf.UserControls
{
/// <summary>
/// UcImageButton.xaml 的交互逻辑
/// </summary>
public partial class UcImageButton : Button
{
public UcImageButton()
{
InitializeComponent();
this.DataContext = this;
}
public static readonly DependencyProperty ButtonImageProperty = DependencyProperty.Register(
"ButtonImage", typeof(ImageSource), typeof(UcImageButton), null);
public ImageSource ButtonImage
{
get { return (ImageSource)GetValue(ButtonImageProperty); }
set { SetValue(ButtonImageProperty, value); }
}
public static readonly DependencyProperty MouseOverButtonImageProperty = DependencyProperty.Register(
"MouseOverButtonImage", typeof(ImageSource), typeof(UcImageButton), null);
public ImageSource MouseOverButtonImage
{
get { return (ImageSource)GetValue(MouseOverButtonImageProperty); }
set { SetValue(MouseOverButtonImageProperty, value); }
}
public static readonly DependencyProperty MousePressButtonImageProperty = DependencyProperty.Register(
"MousePressButtonImage", typeof(ImageSource), typeof(UcImageButton), null);
public ImageSource MousePressButtonImage
{
get { return (ImageSource)GetValue(MousePressButtonImageProperty); }
set { SetValue(MousePressButtonImageProperty, value); }
}
}
}
@@ -0,0 +1,66 @@
<UserControl x:Class="_29WxOrderWpf.UserControls.WindowBoxes"
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" Width="Auto" Height="Auto"
d:DesignHeight="50" d:DesignWidth="300" Background="Black" Loaded="WindowBoxes_Loaded">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"></ColumnDefinition>
<ColumnDefinition Width="Auto"></ColumnDefinition>
<ColumnDefinition Width="Auto"></ColumnDefinition>
<ColumnDefinition Width="Auto"></ColumnDefinition>
</Grid.ColumnDefinitions>
<!--<local:UcImageButton x:Name="btnMin" Grid.Column="0" Width="17" Height="17" Background="Transparent" BorderThickness="0" Margin="4"
ButtonImage="/Resources/WindowBoxes/min.png"
MouseOverButtonImage="/Resources/WindowBoxes/min.hover.png"
MousePressButtonImage="/Resources/WindowBoxes/min.hover.png" />
<local:UcImageButton x:Name="btnMax" Grid.Column="1" Width="17" Height="17" Background="Transparent" BorderThickness="0" Visibility="Collapsed" Margin="4"
ButtonImage="/Resources/WindowBoxes/max.png"
MouseOverButtonImage="/Resources/WindowBoxes/max.hover.png"
MousePressButtonImage="/Resources/WindowBoxes/max.hover.png" />
<local:UcImageButton x:Name="btnNormal" Grid.Column="2" Width="17" Height="17" Background="Transparent" BorderThickness="0" Visibility="Collapsed" Margin="4"
ButtonImage="/Resources/WindowBoxes/normal.png"
MouseOverButtonImage="/Resources/WindowBoxes/normal.hover.png"
MousePressButtonImage="/Resources/WindowBoxes/normal.hover.png" />
<local:UcImageButton x:Name="btnClose" Grid.Column="3" Width="17" Height="17" Background="Transparent" BorderThickness="0" Margin="4"
ButtonImage="/Resources/WindowBoxes/close.png"
MouseOverButtonImage="/Resources/WindowBoxes/close.hover.png"
MousePressButtonImage="/Resources/WindowBoxes/close.hover.png" />-->
<Button x:Name="btnMin" Grid.Column="0" Width="17" Height="17" Background="Transparent" BorderThickness="0" Margin="4">
<Border>
<Grid>
<Image Source="/Resources/WindowBoxes/min.png" Stretch="Uniform"/>
<Image Source="/Resources/WindowBoxes/min.hover.png" Stretch="Uniform" Visibility="Hidden"/>
</Grid>
</Border>
</Button>
<Button x:Name="btnMax" Grid.Column="1" Width="17" Height="17" Background="Transparent" BorderThickness="0" Visibility="Collapsed" Margin="4">
<Border>
<Grid>
<Image Source="/Resources/WindowBoxes/max.png" Stretch="Uniform"/>
<Image Source="/Resources/WindowBoxes/max.hover.png" Stretch="Uniform" Visibility="Hidden"/>
</Grid>
</Border>
</Button>
<Button x:Name="btnNormal" Grid.Column="2" Width="17" Height="17" Background="Transparent" BorderThickness="0" Visibility="Collapsed" Margin="4">
<Border>
<Grid>
<Image Source="/Resources/WindowBoxes/normal.png" Stretch="Uniform"/>
<Image Source="/Resources/WindowBoxes/normal.hover.png" Stretch="Uniform" Visibility="Hidden"/>
</Grid>
</Border>
</Button>
<Button x:Name="btnClose" Grid.Column="3" Width="17" Height="17" Background="Transparent" BorderThickness="0" Margin="4">
<Border>
<Grid>
<Image Source="/Resources/WindowBoxes/close.png" Stretch="Uniform"/>
<Image Source="/Resources/WindowBoxes/close.hover.png" Stretch="Uniform" Visibility="Hidden"></Image>
</Grid>
</Border>
</Button>
</Grid>
</UserControl>
@@ -0,0 +1,114 @@
using System;
using System.Collections.Generic;
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;
namespace _29WxOrderWpf.UserControls
{
/// <summary>
/// WindowBox.xaml 的交互逻辑
/// </summary>
public partial class WindowBoxes : UserControl
{
public static readonly DependencyProperty MaxBoxVisibilityProperty =
DependencyProperty.Register("MaxBoxVisibility", typeof(Visibility), typeof(WindowBoxes),
new PropertyMetadata(default(Visibility)));
public Visibility MaxBoxVisibility
{
get { return (Visibility)GetValue(MaxBoxVisibilityProperty); }
set
{
SetValue(MaxBoxVisibilityProperty, value);
Window_StateChanged(null, null);
}
}
public static readonly DependencyProperty MinBoxVisibilityProperty =
DependencyProperty.Register("MinBoxVisibility", typeof(Visibility), typeof(WindowBoxes),
new PropertyMetadata(default(Visibility)));
public Visibility MinBoxVisibility
{
get { return (Visibility)GetValue(MinBoxVisibilityProperty); }
set { SetValue(MinBoxVisibilityProperty, value); btnMin.Visibility = value; }
}
public WindowBoxes()
{
InitializeComponent();
this.DataContext = this;
}
private void WindowBoxes_Loaded(object sender, RoutedEventArgs e)
{
this.btnClose.Click += BtnClose_Click;
this.btnMax.Click += BtnMax_Click;
this.btnNormal.Click += BtnNormal_Click;
this.btnMin.Click += BtnMin_Click;
var window = Window.GetWindow(this);
if (window != null)
{
window.StateChanged += Window_StateChanged;
}
Window_StateChanged(null, null);
}
private void BtnMin_Click(object sender, RoutedEventArgs e)
{
var window = Window.GetWindow(this);
if (window != null)
window.WindowState = WindowState.Minimized;
}
private void BtnNormal_Click(object sender, RoutedEventArgs e)
{
var window = Window.GetWindow(this);
if (window != null)
window.WindowState = WindowState.Normal;
}
private void BtnMax_Click(object sender, RoutedEventArgs e)
{
var window = Window.GetWindow(this);
if (window != null)
window.WindowState = WindowState.Maximized;
}
private void BtnClose_Click(object sender, RoutedEventArgs e)
{
var window = Window.GetWindow(this);
if (window == null)
return;
window.Close();
}
private void Window_StateChanged(object sender, EventArgs e)
{
var window = Window.GetWindow(this);
if (window != null)
{
if (window.WindowState == WindowState.Maximized && MaxBoxVisibility == Visibility.Visible)
{
this.btnNormal.Visibility = Visibility.Visible;
this.btnMax.Visibility = Visibility.Collapsed;
}
if (window.WindowState == WindowState.Normal && MaxBoxVisibility == Visibility.Visible)
{
this.btnNormal.Visibility = Visibility.Collapsed;
this.btnMax.Visibility = Visibility.Visible;
}
}
}
}
}
+2 -2
View File
@@ -21,7 +21,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<PlatformTarget>x64</PlatformTarget>
<CodeAnalysisLogFile>..\bin\AllBase.dll.CodeAnalysisLog.xml</CodeAnalysisLogFile>
<CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
<CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
@@ -58,7 +58,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<PlatformTarget>AnyCPU</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+4 -2
View File
@@ -29,7 +29,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x86</PlatformTarget>
<PlatformTarget>AnyCPU</PlatformTarget>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
@@ -46,7 +46,7 @@
<OutputPath>..\bin\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
@@ -245,6 +245,7 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\29wx.ico" />
<Content Include="Resources\BaseMsgErr.png" />
<Content Include="Resources\BaseMsgInfo.png" />
<Content Include="Resources\BaseMsgQue.png" />
@@ -262,6 +263,7 @@
<Content Include="Resources\min.png" />
<Content Include="Resources\normal.hover.png" />
<Content Include="Resources\normal.png" />
<Content Include="Resources\weixin_icon.png" />
<Content Include="Resources\x-2.0.png" />
<Content Include="Resources\x-2.1.png" />
<Content Include="Resources\x-3.0.png" />
+3 -4
View File
@@ -44,7 +44,7 @@ namespace Work.BaseForms
((System.ComponentModel.ISupportInitialize)(this.pbCloseBase)).BeginInit();
this.SuspendLayout();
//
// panel2
// pnlTitle
//
this.pnlTitle.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(160)))), ((int)(((byte)(233)))));
this.pnlTitle.Controls.Add(this.pbMinBase);
@@ -55,7 +55,7 @@ namespace Work.BaseForms
this.pnlTitle.Controls.Add(this.pbCloseBase);
this.pnlTitle.Dock = System.Windows.Forms.DockStyle.Top;
this.pnlTitle.Location = new System.Drawing.Point(0, 0);
this.pnlTitle.Name = "panel2";
this.pnlTitle.Name = "pnlTitle";
this.pnlTitle.Size = new System.Drawing.Size(386, 32);
this.pnlTitle.TabIndex = 2;
this.pnlTitle.MouseDown += new System.Windows.Forms.MouseEventHandler(this.panel2_MouseDown);
@@ -108,7 +108,7 @@ namespace Work.BaseForms
// pictureBox3
//
this.pictureBox3.BackColor = System.Drawing.Color.Transparent;
this.pictureBox3.Image = global::Work.Properties.Resources.icon;
this.pictureBox3.Image = global::Work.Properties.Resources.weixin_icon;
this.pictureBox3.Location = new System.Drawing.Point(5, 3);
this.pictureBox3.Name = "pictureBox3";
this.pictureBox3.Size = new System.Drawing.Size(23, 23);
@@ -151,7 +151,6 @@ namespace Work.BaseForms
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Name = "BaseGeneralForm";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "BaseForm";
this.Load += new System.EventHandler(this.LcBaseForm_Load);
this.pnlTitle.ResumeLayout(false);
this.pnlTitle.PerformLayout();
+3 -3
View File
@@ -72,10 +72,10 @@ namespace Work.BaseForms
{
if (BaseClass.Ico != null)
Iconx = Icon = BaseClass.Ico;
else
Iconx = Icon = BaseClass.Ico = ImageBuild.ConvertToIcon(Properties.Resources.icon);
//else
// Iconx = Icon = BaseClass.Ico = ImageBuild.ConvertToIcon(Properties.Resources.icon);
if (this.IsShowMax)
{
if (this.WindowState == FormWindowState.Maximized)
+20
View File
@@ -60,6 +60,16 @@ namespace Work.Properties {
}
}
/// <summary>
/// 查找类似于 (图标) 的 System.Drawing.Icon 类型的本地化资源。
/// </summary>
internal static System.Drawing.Icon _29wx {
get {
object obj = ResourceManager.GetObject("_29wx", resourceCulture);
return ((System.Drawing.Icon)(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
@@ -210,6 +220,16 @@ namespace Work.Properties {
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap weixin_icon {
get {
object obj = ResourceManager.GetObject("weixin_icon", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
+6
View File
@@ -193,4 +193,10 @@
<data name="errpic" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\resources\errpic.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="_29wx" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\resources\29wx.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="weixin_icon" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\resources\weixin_icon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>
Binary file not shown.

After

Width:  |  Height:  |  Size: 224 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB