diff --git a/29WxOrderWpf/29WxOrderWpf.csproj b/29WxOrderWpf/29WxOrderWpf.csproj index fe66d75..2e76ba3 100644 --- a/29WxOrderWpf/29WxOrderWpf.csproj +++ b/29WxOrderWpf/29WxOrderWpf.csproj @@ -19,7 +19,7 @@ AnyCPU true full - false + true bin\Debug\ DEBUG;TRACE prompt @@ -34,12 +34,16 @@ prompt 4 + + 29wx.ico + ..\DllReference\NaiBa.Util.dll + @@ -58,6 +62,33 @@ MSBuild:Compile Designer + + BaseMsgWindow.xaml + + + + LoginWindow.xaml + + + OrderListCtrl.xaml + + + Icons.xaml + + + UcImageButton.xaml + + + WindowBoxes.xaml + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + MSBuild:Compile Designer @@ -70,6 +101,30 @@ MainWindow.xaml Code + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + @@ -97,14 +152,32 @@ - - - + {6461D807-B1C8-45F0-B388-E0CA1A418DE0} 29WxOrderAllBase + + {1ad45d66-6872-4522-acf0-04e2c0514048} + 29WxOrderWork + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/29WxOrderWpf/29wx.ico b/29WxOrderWpf/29wx.ico new file mode 100644 index 0000000..059d46c Binary files /dev/null and b/29WxOrderWpf/29wx.ico differ diff --git a/29WxOrderWpf/App.xaml b/29WxOrderWpf/App.xaml index 6318c00..38ea195 100644 --- a/29WxOrderWpf/App.xaml +++ b/29WxOrderWpf/App.xaml @@ -4,6 +4,12 @@ xmlns:local="clr-namespace:_29WxOrderWpf" StartupUri="MainWindow.xaml"> - + + + + + + + diff --git a/29WxOrderWpf/BaseWindows/BaseMsgWindow.xaml b/29WxOrderWpf/BaseWindows/BaseMsgWindow.xaml new file mode 100644 index 0000000..ae5e115 --- /dev/null +++ b/29WxOrderWpf/BaseWindows/BaseMsgWindow.xaml @@ -0,0 +1,18 @@ + + + + + + + + + + + diff --git a/29WxOrderWpf/BaseWindows/BaseMsgWindow.xaml.cs b/29WxOrderWpf/BaseWindows/BaseMsgWindow.xaml.cs new file mode 100644 index 0000000..2581d26 --- /dev/null +++ b/29WxOrderWpf/BaseWindows/BaseMsgWindow.xaml.cs @@ -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 +{ + /// + /// BaseMsgWindow.xaml 的交互逻辑 + /// + public partial class BaseMsgWindow : BaseWindow + { + public BaseMsgWindow() + { + InitializeComponent(); + this.DataContext = this; + } + } +} diff --git a/29WxOrderWpf/BaseWindows/BaseWindow.cs b/29WxOrderWpf/BaseWindows/BaseWindow.cs new file mode 100644 index 0000000..277def3 --- /dev/null +++ b/29WxOrderWpf/BaseWindows/BaseWindow.cs @@ -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; + } + } +} diff --git a/29WxOrderWpf/LoginWindows/LoginWindow.xaml b/29WxOrderWpf/LoginWindows/LoginWindow.xaml new file mode 100644 index 0000000..6f1fa8a --- /dev/null +++ b/29WxOrderWpf/LoginWindows/LoginWindow.xaml @@ -0,0 +1,20 @@ + + + + + + + + + + + + diff --git a/29WxOrderWpf/LoginWindows/LoginWindow.xaml.cs b/29WxOrderWpf/LoginWindows/LoginWindow.xaml.cs new file mode 100644 index 0000000..5666956 --- /dev/null +++ b/29WxOrderWpf/LoginWindows/LoginWindow.xaml.cs @@ -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 +{ + /// + /// LoginWindow.xaml 的交互逻辑 + /// + 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(); + } + } +} diff --git a/29WxOrderWpf/MainWindow.xaml b/29WxOrderWpf/MainWindow.xaml index 118a27e..31ad81f 100644 --- a/29WxOrderWpf/MainWindow.xaml +++ b/29WxOrderWpf/MainWindow.xaml @@ -1,193 +1,25 @@ - - - - - + 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"> - - + - - - - - - - - - - - - - - - - - - - - + + + - diff --git a/29WxOrderWpf/UserControls/UcImageButton.xaml.cs b/29WxOrderWpf/UserControls/UcImageButton.xaml.cs new file mode 100644 index 0000000..91ac732 --- /dev/null +++ b/29WxOrderWpf/UserControls/UcImageButton.xaml.cs @@ -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 +{ + /// + /// UcImageButton.xaml 的交互逻辑 + /// + 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); } + } + } +} diff --git a/29WxOrderWpf/UserControls/WindowBoxes.xaml b/29WxOrderWpf/UserControls/WindowBoxes.xaml new file mode 100644 index 0000000..b5161db --- /dev/null +++ b/29WxOrderWpf/UserControls/WindowBoxes.xaml @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + diff --git a/29WxOrderWpf/UserControls/WindowBoxes.xaml.cs b/29WxOrderWpf/UserControls/WindowBoxes.xaml.cs new file mode 100644 index 0000000..c93581c --- /dev/null +++ b/29WxOrderWpf/UserControls/WindowBoxes.xaml.cs @@ -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 +{ + /// + /// WindowBox.xaml 的交互逻辑 + /// + 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; + } + } + } + } +} diff --git a/AllBase/29WxOrderAllBase.csproj b/AllBase/29WxOrderAllBase.csproj index f8f39ea..c6150c7 100644 --- a/AllBase/29WxOrderAllBase.csproj +++ b/AllBase/29WxOrderAllBase.csproj @@ -21,7 +21,7 @@ DEBUG;TRACE true full - x86 + x64 ..\bin\AllBase.dll.CodeAnalysisLog.xml true GlobalSuppressions.cs @@ -58,7 +58,7 @@ DEBUG;TRACE true full - x86 + AnyCPU false prompt MinimumRecommendedRules.ruleset diff --git a/Work/29WxOrderWork.csproj b/Work/29WxOrderWork.csproj index d8a5e52..cf4bfa2 100644 --- a/Work/29WxOrderWork.csproj +++ b/Work/29WxOrderWork.csproj @@ -29,7 +29,7 @@ DEBUG;TRACE prompt 4 - x86 + AnyCPU false @@ -46,7 +46,7 @@ ..\bin\ DEBUG;TRACE full - x86 + x64 prompt MinimumRecommendedRules.ruleset @@ -245,6 +245,7 @@ + @@ -262,6 +263,7 @@ + diff --git a/Work/BaseForms/BaseGeneralForm.Designer.cs b/Work/BaseForms/BaseGeneralForm.Designer.cs index eb11d66..977dfc1 100644 --- a/Work/BaseForms/BaseGeneralForm.Designer.cs +++ b/Work/BaseForms/BaseGeneralForm.Designer.cs @@ -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(); diff --git a/Work/BaseForms/BaseGeneralForm.cs b/Work/BaseForms/BaseGeneralForm.cs index a7ff676..94390c6 100644 --- a/Work/BaseForms/BaseGeneralForm.cs +++ b/Work/BaseForms/BaseGeneralForm.cs @@ -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) diff --git a/Work/Properties/Resources.Designer.cs b/Work/Properties/Resources.Designer.cs index fa87171..bc064b7 100644 --- a/Work/Properties/Resources.Designer.cs +++ b/Work/Properties/Resources.Designer.cs @@ -60,6 +60,16 @@ namespace Work.Properties { } } + /// + /// 查找类似于 (图标) 的 System.Drawing.Icon 类型的本地化资源。 + /// + internal static System.Drawing.Icon _29wx { + get { + object obj = ResourceManager.GetObject("_29wx", resourceCulture); + return ((System.Drawing.Icon)(obj)); + } + } + /// /// 查找 System.Drawing.Bitmap 类型的本地化资源。 /// @@ -210,6 +220,16 @@ namespace Work.Properties { } } + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// + internal static System.Drawing.Bitmap weixin_icon { + get { + object obj = ResourceManager.GetObject("weixin_icon", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// 查找 System.Drawing.Bitmap 类型的本地化资源。 /// diff --git a/Work/Properties/Resources.resx b/Work/Properties/Resources.resx index 93d5fdb..2e47b2c 100644 --- a/Work/Properties/Resources.resx +++ b/Work/Properties/Resources.resx @@ -193,4 +193,10 @@ ..\resources\errpic.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\resources\29wx.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\resources\weixin_icon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + \ No newline at end of file diff --git a/Work/Resources/29wx.ico b/Work/Resources/29wx.ico new file mode 100644 index 0000000..059d46c Binary files /dev/null and b/Work/Resources/29wx.ico differ diff --git a/Work/Resources/weixin_icon.png b/Work/Resources/weixin_icon.png new file mode 100644 index 0000000..2704ee9 Binary files /dev/null and b/Work/Resources/weixin_icon.png differ