统计页面增加 tab页面 天,周,月 统计
This commit is contained in:
1 parent
355a0f6be7
commit
872dc70094
10 files changed
+1222
-19
No files matched your search
@@ -1,8 +1,11 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Runtime.Remoting.Contexts;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Interop;
|
||||
|
||||
|
||||
|
||||
@@ -15,25 +18,26 @@ namespace _29WxOrderWpf.Common
|
||||
{
|
||||
private readonly Style dialogWindowStyle;
|
||||
private bool isConstructorSuccessful = false;
|
||||
private UserControl _content;
|
||||
public DialogWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
Owner = Application.Current.MainWindow;
|
||||
isConstructorSuccessful = true;
|
||||
dialogWindowStyle = (Style)TryFindResource("DialogWindowStyle");
|
||||
|
||||
Loaded += DialogWindow_Loaded;
|
||||
}
|
||||
private void DialogWindow_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Loaded -= DialogWindow_Loaded;
|
||||
|
||||
|
||||
}
|
||||
protected override void OnContentChanged(object oldContent, object newContent)
|
||||
{
|
||||
this.Style = dialogWindowStyle;
|
||||
if (newContent is System.Windows.Controls.UserControl control)
|
||||
{
|
||||
_content = control;
|
||||
|
||||
Setter widthSetter = this.Style.Setters.OfType<Setter>().FirstOrDefault(a => a.Property == WidthProperty);
|
||||
if (widthSetter == null)
|
||||
@@ -70,7 +74,11 @@ namespace _29WxOrderWpf.Common
|
||||
{
|
||||
this.ResizeMode = resizeExt;
|
||||
}
|
||||
|
||||
WindowStyle wstyleExt = DialogWindowProperty.GetWindowStyle(control);
|
||||
if (wstyleExt != WindowStyle.SingleBorderWindow)
|
||||
{
|
||||
this.WindowStyle = wstyleExt;
|
||||
}
|
||||
}
|
||||
base.OnContentChanged(oldContent, newContent);
|
||||
}
|
||||
@@ -87,5 +95,31 @@ namespace _29WxOrderWpf.Common
|
||||
}
|
||||
base.OnStyleChanged(oldStyle, newStyle);
|
||||
}
|
||||
|
||||
|
||||
#region ShowMiniButton
|
||||
private const int GWL_STYLE = -16;
|
||||
private const int WS_MINIMIZEBOX = 0x00020000;
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
private static extern int GetWindowLong(IntPtr hWnd, int nIndex);
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
private static extern int SetWindowLong(IntPtr hWnd, int nIndex, int dwNewLong);
|
||||
|
||||
protected override void OnSourceInitialized(EventArgs e)
|
||||
{
|
||||
base.OnSourceInitialized(e);
|
||||
|
||||
var hwnd = new WindowInteropHelper(this).Handle;
|
||||
|
||||
int style = GetWindowLong(hwnd, GWL_STYLE);
|
||||
style &= ~WS_MINIMIZEBOX;
|
||||
if (DialogWindowProperty.GetShowMinButton(this._content) == false)
|
||||
{
|
||||
SetWindowLong(hwnd, GWL_STYLE, style);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user