diff --git a/CowOutputClient/App.xaml.cs b/CowOutputClient/App.xaml.cs index d237796..3b5403e 100644 --- a/CowOutputClient/App.xaml.cs +++ b/CowOutputClient/App.xaml.cs @@ -24,7 +24,7 @@ namespace CowOutputClient private void App_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e) { - WindowUtil.Err(e.Exception.Message.ToString()); + WindowUtil.Err(e.Exception.ToString()); e.Handled = true; } diff --git a/CowOutputClient/CalendarSelecterWindow.xaml b/CowOutputClient/CalendarSelecterWindow.xaml new file mode 100644 index 0000000..8080caf --- /dev/null +++ b/CowOutputClient/CalendarSelecterWindow.xaml @@ -0,0 +1,730 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CowOutputClient/CalendarSelecterWindow.xaml.cs b/CowOutputClient/CalendarSelecterWindow.xaml.cs new file mode 100644 index 0000000..a11f75d --- /dev/null +++ b/CowOutputClient/CalendarSelecterWindow.xaml.cs @@ -0,0 +1,73 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.IO; +using System.Linq; +using System.Reflection; +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 CowOutputClient +{ + /// + /// Calendar.xaml 的交互逻辑 + /// + public partial class CalendarSelecterWindow : Window, INotifyPropertyChanged + { + public CalendarSelecterWindow() + { + InitializeComponent(); + } + + public void DragWindow(object sender, MouseButtonEventArgs args) + { + this.DragMove(); + } + + private DateTime _result; + public DateTime Result + { + get { return _result; } + private set { _result = value; OnPropertyChanged("Result"); } + } + + private void MC_SelectedDatesChanged(object sender, RoutedEventArgs e) + { + Result = MC.SelectedDate.Value; + DialogResult = true; + } + + public event PropertyChangedEventHandler PropertyChanged; + protected void OnPropertyChanged(string propertyName) + { + if (PropertyChanged != null) + PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); + } + + private void imgToday_Initialized(object sender, EventArgs e) + { + Assembly myAssembly = Assembly.GetExecutingAssembly(); + //格式为:项目名称-文件夹地址-文件名称 + Stream myStream = myAssembly.GetManifestResourceStream("CowOutputClient.Images.today.png"); + //图片格式 + BitmapImage image = new BitmapImage(); + image.BeginInit(); + image.StreamSource = myStream; + image.EndInit(); + myStream.Dispose(); + myStream.Close(); + + var imagePanel = (sender as Image); + imagePanel.Source = image; + } + } +} diff --git a/CowOutputClient/CowOutputClient.csproj b/CowOutputClient/CowOutputClient.csproj index fe103b3..a095f7d 100644 --- a/CowOutputClient/CowOutputClient.csproj +++ b/CowOutputClient/CowOutputClient.csproj @@ -61,6 +61,9 @@ MSBuild:Compile Designer + + CalendarSelecterWindow.xaml + OperateWindow.xaml @@ -68,6 +71,10 @@ SelectedProductWindow.xaml + + MSBuild:Compile + Designer + MSBuild:Compile Designer @@ -114,7 +121,10 @@ ResXFileCodeGenerator Resources.Designer.cs - + + Always + Designer + SettingsSingleFileGenerator Settings.Designer.cs @@ -149,6 +159,11 @@ WeighBusiness + + + + + - - + @@ -34,21 +38,15 @@