Merge branch 'master' into pr/28
This commit is contained in:
114 files changed
+1064
-562
No files matched your search
@@ -0,0 +1,41 @@
|
||||
using System.Windows;
|
||||
using System.Windows.Input;
|
||||
using HandyControl.Data;
|
||||
|
||||
namespace HandyControl.Controls
|
||||
{
|
||||
public static class WindowAttach
|
||||
{
|
||||
public static readonly DependencyProperty IsDragElementProperty = DependencyProperty.RegisterAttached(
|
||||
"IsDragElement", typeof(bool), typeof(WindowAttach), new PropertyMetadata(ValueBoxes.FalseBox, OnIsDragElementChanged));
|
||||
|
||||
public static void SetIsDragElement(DependencyObject element, bool value)
|
||||
=> element.SetValue(IsDragElementProperty, value);
|
||||
|
||||
public static bool GetIsDragElement(DependencyObject element)
|
||||
=> (bool) element.GetValue(IsDragElementProperty);
|
||||
|
||||
private static void OnIsDragElementChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
if (d is UIElement ctl)
|
||||
{
|
||||
if ((bool)e.NewValue)
|
||||
{
|
||||
ctl.MouseLeftButtonDown += DragElement_MouseLeftButtonDown; ;
|
||||
}
|
||||
else
|
||||
{
|
||||
ctl.MouseLeftButtonDown -= DragElement_MouseLeftButtonDown;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void DragElement_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
if (sender is DependencyObject obj && e.ButtonState == MouseButtonState.Pressed)
|
||||
{
|
||||
System.Windows.Window.GetWindow(obj)?.DragMove();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
using System.Windows.Controls;
|
||||
|
||||
// ReSharper disable once CheckNamespace
|
||||
|
||||
namespace HandyControl.Controls
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Controls.Primitives;
|
||||
|
||||
// ReSharper disable once CheckNamespace
|
||||
|
||||
namespace HandyControl.Controls
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -197,7 +197,7 @@ namespace HandyControl.Controls
|
||||
}
|
||||
catch
|
||||
{
|
||||
PopupWindow.ShowDialog(Lang.ErrorImgPath);
|
||||
MessageBox.Show(Lang.ErrorImgPath);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -464,7 +464,7 @@ namespace HandyControl.Controls
|
||||
|
||||
if (Math.Abs(height - 0) < 0.001 || Math.Abs(width - 0) < 0.001)
|
||||
{
|
||||
PopupWindow.ShowDialog(Lang.ErrorImgSize);
|
||||
MessageBox.Show(Lang.ErrorImgSize);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -544,7 +544,7 @@ namespace HandyControl.Controls
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
PopupWindow.ShowDialog(exception.Message);
|
||||
MessageBox.Show(exception.Message);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using HandyControl.Data;
|
||||
|
||||
// ReSharper disable once CheckNamespace
|
||||
|
||||
namespace HandyControl.Controls
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -6,7 +6,7 @@ using System.Windows.Media.Animation;
|
||||
using System.Windows.Shapes;
|
||||
using HandyControl.Data;
|
||||
|
||||
// ReSharper disable once CheckNamespace
|
||||
|
||||
namespace HandyControl.Controls
|
||||
{
|
||||
public abstract class LoadingBase : ContentControl
|
||||
|
||||
@@ -5,7 +5,7 @@ using System.Windows.Data;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Animation;
|
||||
|
||||
// ReSharper disable once CheckNamespace
|
||||
|
||||
namespace HandyControl.Controls
|
||||
{
|
||||
public class LoadingCircle : LoadingBase
|
||||
|
||||
@@ -4,7 +4,7 @@ using System.Windows.Data;
|
||||
using System.Windows.Media.Animation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
// ReSharper disable once CheckNamespace
|
||||
|
||||
namespace HandyControl.Controls
|
||||
{
|
||||
public class LoadingLine : LoadingBase
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
|
||||
// ReSharper disable once CheckNamespace
|
||||
|
||||
namespace HandyControl.Controls
|
||||
{
|
||||
public class CompareSlider : Slider
|
||||
|
||||
@@ -6,7 +6,7 @@ using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using HandyControl.Data;
|
||||
|
||||
// ReSharper disable once CheckNamespace
|
||||
|
||||
namespace HandyControl.Controls
|
||||
{
|
||||
[TemplatePart(Name = PreviewContentKey, Type = typeof(ContentControl))]
|
||||
|
||||
File renamed without changes.
File renamed without changes.
@@ -1,6 +1,6 @@
|
||||
using System.Windows.Controls;
|
||||
|
||||
// ReSharper disable once CheckNamespace
|
||||
|
||||
namespace HandyControl.Controls
|
||||
{
|
||||
public class ClockRadioButton : RadioButton
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using System.Windows.Controls;
|
||||
|
||||
// ReSharper disable once CheckNamespace
|
||||
|
||||
namespace HandyControl.Controls
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -8,7 +8,7 @@ using HandyControl.Data;
|
||||
using HandyControl.Interactivity;
|
||||
using HandyControl.Tools;
|
||||
|
||||
// ReSharper disable once CheckNamespace
|
||||
|
||||
namespace HandyControl.Controls
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -66,7 +66,7 @@ namespace HandyControl.Controls
|
||||
}
|
||||
catch
|
||||
{
|
||||
PopupWindow.ShowDialog(Properties.Langs.Lang.ErrorImgPath);
|
||||
MessageBox.Show(Properties.Langs.Lang.ErrorImgPath);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -0,0 +1,328 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Shapes;
|
||||
using HandyControl.Data;
|
||||
using HandyControl.Interactivity;
|
||||
using HandyControl.Tools;
|
||||
using HandyControl.Tools.Extension;
|
||||
|
||||
namespace HandyControl.Controls
|
||||
{
|
||||
/// <summary>
|
||||
/// 消息框
|
||||
/// </summary>
|
||||
public sealed class MessageBox : Window
|
||||
{
|
||||
#region Constants
|
||||
|
||||
private const string ElementImage = "PART_Image";
|
||||
|
||||
private const string ElementMessage = "PART_Message";
|
||||
|
||||
#endregion Constants
|
||||
|
||||
private MessageBoxResult _messageBoxResult = MessageBoxResult.Cancel;
|
||||
|
||||
private bool _showOK;
|
||||
|
||||
private bool _showCancel;
|
||||
|
||||
private bool _showYes;
|
||||
|
||||
private bool _showNo;
|
||||
|
||||
private string _message;
|
||||
|
||||
private Geometry _image;
|
||||
|
||||
private Brush _imageBrush;
|
||||
|
||||
private bool _showImage;
|
||||
|
||||
private MessageBox()
|
||||
{
|
||||
CommandBindings.Add(new CommandBinding(ControlCommands.Confirm, (s, e) =>
|
||||
{
|
||||
_messageBoxResult = MessageBoxResult.OK;
|
||||
Close();
|
||||
}, (s, e) => e.CanExecute = _showOK));
|
||||
CommandBindings.Add(new CommandBinding(ControlCommands.Cancel, (s, e) =>
|
||||
{
|
||||
_messageBoxResult = MessageBoxResult.Cancel;
|
||||
Close();
|
||||
}, (s, e) => e.CanExecute = _showCancel));
|
||||
CommandBindings.Add(new CommandBinding(ControlCommands.Yes, (s, e) =>
|
||||
{
|
||||
_messageBoxResult = MessageBoxResult.Yes;
|
||||
Close();
|
||||
}, (s, e) => e.CanExecute = _showYes));
|
||||
CommandBindings.Add(new CommandBinding(ControlCommands.No, (s, e) =>
|
||||
{
|
||||
_messageBoxResult = MessageBoxResult.No;
|
||||
Close();
|
||||
}, (s, e) => e.CanExecute = _showNo));
|
||||
}
|
||||
|
||||
protected override void OnSourceInitialized(EventArgs e)
|
||||
{
|
||||
base.OnSourceInitialized(e);
|
||||
|
||||
if (LogicalTreeHelper.FindLogicalNode(this, ElementMessage) is TextBlock message) message.Text = _message;
|
||||
|
||||
if (_showImage)
|
||||
{
|
||||
if (LogicalTreeHelper.FindLogicalNode(this, ElementImage) is Path image)
|
||||
{
|
||||
image.Data = _image;
|
||||
image.Fill = _imageBrush;
|
||||
image.Show();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 成功
|
||||
/// </summary>
|
||||
/// <param name="messageBoxText"></param>
|
||||
/// <param name="caption"></param>
|
||||
public static MessageBoxResult Success(string messageBoxText, string caption = null)
|
||||
{
|
||||
var messageBox = CreateMessageBox(null, messageBoxText, caption, MessageBoxButton.OK, MessageBoxImage.None, MessageBoxResult.OK);
|
||||
SetButtonStatus(messageBox, MessageBoxButton.OK);
|
||||
messageBox._showImage = true;
|
||||
messageBox._image = ResourceHelper.GetResource<Geometry>(ResourceToken.SuccessGeometry);
|
||||
messageBox._imageBrush = ResourceHelper.GetResource<Brush>(ResourceToken.SuccessBrush);
|
||||
messageBox.ShowDialog();
|
||||
|
||||
return messageBox._messageBoxResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 消息
|
||||
/// </summary>
|
||||
/// <param name="messageBoxText"></param>
|
||||
/// <param name="caption"></param>
|
||||
public static MessageBoxResult Info(string messageBoxText, string caption = null)
|
||||
{
|
||||
var messageBox = CreateMessageBox(null, messageBoxText, caption, MessageBoxButton.OK, MessageBoxImage.Information, MessageBoxResult.OK);
|
||||
SetButtonStatus(messageBox, MessageBoxButton.OK);
|
||||
SetImage(messageBox, MessageBoxImage.Information);
|
||||
messageBox.ShowDialog();
|
||||
|
||||
return messageBox._messageBoxResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 警告
|
||||
/// </summary>
|
||||
/// <param name="messageBoxText"></param>
|
||||
/// <param name="caption"></param>
|
||||
public static MessageBoxResult Warning(string messageBoxText, string caption = null)
|
||||
{
|
||||
var messageBox = CreateMessageBox(null, messageBoxText, caption, MessageBoxButton.OK, MessageBoxImage.Warning, MessageBoxResult.OK);
|
||||
SetButtonStatus(messageBox, MessageBoxButton.OK);
|
||||
SetImage(messageBox, MessageBoxImage.Warning);
|
||||
messageBox.ShowDialog();
|
||||
|
||||
return messageBox._messageBoxResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 错误
|
||||
/// </summary>
|
||||
/// <param name="messageBoxText"></param>
|
||||
/// <param name="caption"></param>
|
||||
public static MessageBoxResult Error(string messageBoxText, string caption = null)
|
||||
{
|
||||
var messageBox = CreateMessageBox(null, messageBoxText, caption, MessageBoxButton.OK, MessageBoxImage.Error, MessageBoxResult.OK);
|
||||
SetButtonStatus(messageBox, MessageBoxButton.OK);
|
||||
SetImage(messageBox, MessageBoxImage.Error);
|
||||
messageBox.ShowDialog();
|
||||
|
||||
return messageBox._messageBoxResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 严重
|
||||
/// </summary>
|
||||
/// <param name="messageBoxText"></param>
|
||||
/// <param name="caption"></param>
|
||||
public static MessageBoxResult Fatal(string messageBoxText, string caption = null)
|
||||
{
|
||||
var messageBox = CreateMessageBox(null, messageBoxText, caption, MessageBoxButton.OK, MessageBoxImage.None, MessageBoxResult.OK);
|
||||
SetButtonStatus(messageBox, MessageBoxButton.OK);
|
||||
messageBox._showImage = true;
|
||||
messageBox._image = ResourceHelper.GetResource<Geometry>(ResourceToken.FatalGeometry);
|
||||
messageBox._imageBrush = ResourceHelper.GetResource<Brush>(ResourceToken.PrimaryTextBrush);
|
||||
messageBox.ShowDialog();
|
||||
|
||||
return messageBox._messageBoxResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 询问
|
||||
/// </summary>
|
||||
/// <param name="messageBoxText"></param>
|
||||
/// <param name="caption"></param>
|
||||
public static MessageBoxResult Ask(string messageBoxText, string caption = null)
|
||||
{
|
||||
var messageBox = CreateMessageBox(null, messageBoxText, caption, MessageBoxButton.OKCancel, MessageBoxImage.Question, MessageBoxResult.Cancel);
|
||||
SetButtonStatus(messageBox, MessageBoxButton.OKCancel);
|
||||
SetImage(messageBox, MessageBoxImage.Question);
|
||||
messageBox.ShowDialog();
|
||||
|
||||
return messageBox._messageBoxResult;
|
||||
}
|
||||
|
||||
public static MessageBoxResult CustomShow(string messageBoxText, string caption = null, MessageBoxButton button = MessageBoxButton.OK, string iconKey = "", string iconBrushKey = "", MessageBoxResult defaultResult = MessageBoxResult.None)
|
||||
{
|
||||
var messageBox = CreateMessageBox(null, messageBoxText, caption, button, MessageBoxImage.None, defaultResult);
|
||||
messageBox._showImage = true;
|
||||
messageBox._image = ResourceHelper.GetResource<Geometry>(iconKey);
|
||||
messageBox._imageBrush = ResourceHelper.GetResource<Brush>(iconBrushKey);
|
||||
messageBox.ShowDialog();
|
||||
|
||||
return messageBox._messageBoxResult;
|
||||
}
|
||||
|
||||
public static MessageBoxResult Show(string messageBoxText, string caption = null, MessageBoxButton button = MessageBoxButton.OK, MessageBoxImage icon = MessageBoxImage.None, MessageBoxResult defaultResult = MessageBoxResult.None)
|
||||
{
|
||||
return Show(null, messageBoxText, caption, button, icon, defaultResult);
|
||||
}
|
||||
|
||||
public static MessageBoxResult Show(System.Windows.Window owner, string messageBoxText, string caption = null, MessageBoxButton button = MessageBoxButton.OK, MessageBoxImage icon = MessageBoxImage.None, MessageBoxResult defaultResult = MessageBoxResult.None)
|
||||
{
|
||||
var messageBox = CreateMessageBox(owner, messageBoxText, caption, button, icon, defaultResult);
|
||||
SetButtonStatus(messageBox, button);
|
||||
SetImage(messageBox, icon);
|
||||
messageBox.ShowDialog();
|
||||
|
||||
return messageBox._messageBoxResult;
|
||||
}
|
||||
|
||||
private static MessageBox CreateMessageBox(
|
||||
System.Windows.Window owner,
|
||||
string messageBoxText,
|
||||
string caption,
|
||||
MessageBoxButton button,
|
||||
MessageBoxImage icon,
|
||||
MessageBoxResult defaultResult)
|
||||
{
|
||||
if (!IsValidMessageBoxButton(button))
|
||||
{
|
||||
throw new InvalidEnumArgumentException(nameof(button), (int)button, typeof(MessageBoxButton));
|
||||
}
|
||||
if (!IsValidMessageBoxImage(icon))
|
||||
{
|
||||
throw new InvalidEnumArgumentException(nameof(icon), (int)icon, typeof(MessageBoxImage));
|
||||
}
|
||||
if (!IsValidMessageBoxResult(defaultResult))
|
||||
{
|
||||
throw new InvalidEnumArgumentException(nameof(defaultResult), (int)defaultResult, typeof(MessageBoxResult));
|
||||
}
|
||||
|
||||
var ownerWindow = owner ?? Application.Current.Windows.OfType<Window>().SingleOrDefault(x => x.IsActive);
|
||||
var ownerIsNull = ownerWindow is null;
|
||||
|
||||
return new MessageBox
|
||||
{
|
||||
_message = messageBoxText,
|
||||
Owner = ownerWindow,
|
||||
WindowStartupLocation = ownerIsNull ? WindowStartupLocation.CenterScreen : WindowStartupLocation.CenterOwner,
|
||||
ShowTitle = true,
|
||||
Title = caption,
|
||||
Topmost = ownerIsNull,
|
||||
_messageBoxResult = defaultResult
|
||||
};
|
||||
}
|
||||
|
||||
private static void SetButtonStatus(MessageBox messageBox, MessageBoxButton messageBoxButton)
|
||||
{
|
||||
switch (messageBoxButton)
|
||||
{
|
||||
case MessageBoxButton.OK:
|
||||
messageBox._showOK = true;
|
||||
break;
|
||||
case MessageBoxButton.OKCancel:
|
||||
messageBox._showOK = true;
|
||||
messageBox._showCancel = true;
|
||||
break;
|
||||
case MessageBoxButton.YesNo:
|
||||
messageBox._showYes = true;
|
||||
messageBox._showNo = true;
|
||||
break;
|
||||
case MessageBoxButton.YesNoCancel:
|
||||
messageBox._showYes = true;
|
||||
messageBox._showNo = true;
|
||||
messageBox._showCancel = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private static void SetImage(MessageBox messageBox, MessageBoxImage messageBoxImage)
|
||||
{
|
||||
var iconKey = string.Empty;
|
||||
var iconBrushKey = string.Empty;
|
||||
|
||||
switch (messageBoxImage)
|
||||
{
|
||||
case MessageBoxImage.Error:
|
||||
iconKey = ResourceToken.ErrorGeometry;
|
||||
iconBrushKey = ResourceToken.DangerBrush;
|
||||
break;
|
||||
case MessageBoxImage.Question:
|
||||
iconKey = ResourceToken.AskGeometry;
|
||||
iconBrushKey = ResourceToken.AccentBrush;
|
||||
break;
|
||||
case MessageBoxImage.Warning:
|
||||
iconKey = ResourceToken.WarningGeometry;
|
||||
iconBrushKey = ResourceToken.WarningBrush;
|
||||
break;
|
||||
case MessageBoxImage.Information:
|
||||
iconKey = ResourceToken.InfoGeometry;
|
||||
iconBrushKey = ResourceToken.InfoBrush;
|
||||
break;
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(iconKey)) return;
|
||||
messageBox._showImage = true;
|
||||
messageBox._image = ResourceHelper.GetResource<Geometry>(iconKey);
|
||||
messageBox._imageBrush = ResourceHelper.GetResource<Brush>(iconBrushKey);
|
||||
}
|
||||
|
||||
private static bool IsValidMessageBoxButton(MessageBoxButton value)
|
||||
{
|
||||
return value == MessageBoxButton.OK
|
||||
|| value == MessageBoxButton.OKCancel
|
||||
|| value == MessageBoxButton.YesNo
|
||||
|| value == MessageBoxButton.YesNoCancel;
|
||||
}
|
||||
|
||||
private static bool IsValidMessageBoxImage(MessageBoxImage value)
|
||||
{
|
||||
return value == MessageBoxImage.Asterisk
|
||||
|| value == MessageBoxImage.Error
|
||||
|| value == MessageBoxImage.Exclamation
|
||||
|| value == MessageBoxImage.Hand
|
||||
|| value == MessageBoxImage.Information
|
||||
|| value == MessageBoxImage.None
|
||||
|| value == MessageBoxImage.Question
|
||||
|| value == MessageBoxImage.Stop
|
||||
|| value == MessageBoxImage.Warning;
|
||||
}
|
||||
|
||||
private static bool IsValidMessageBoxResult(MessageBoxResult value)
|
||||
{
|
||||
return value == MessageBoxResult.Cancel
|
||||
|| value == MessageBoxResult.No
|
||||
|| value == MessageBoxResult.None
|
||||
|| value == MessageBoxResult.OK
|
||||
|| value == MessageBoxResult.Yes;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,6 @@ using HandyControl.Data;
|
||||
using HandyControl.Interactivity;
|
||||
using HandyControl.Tools;
|
||||
|
||||
// ReSharper disable once CheckNamespace
|
||||
namespace HandyControl.Controls
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -6,17 +6,20 @@ using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using HandyControl.Data;
|
||||
using HandyControl.Tools;
|
||||
using HandyControl.Tools.Extension;
|
||||
#if netle40
|
||||
using Microsoft.Windows.Shell;
|
||||
#else
|
||||
using System.Windows.Shell;
|
||||
|
||||
#endif
|
||||
|
||||
namespace HandyControl.Controls
|
||||
{
|
||||
[TemplatePart(Name = ElementNonClientArea, Type = typeof(UIElement))]
|
||||
public class Window : System.Windows.Window
|
||||
{
|
||||
private Thickness _tempThickness;
|
||||
private const string ElementNonClientArea = "PART_NonClientArea";
|
||||
|
||||
public static readonly DependencyProperty NonClientAreaContentProperty = DependencyProperty.Register(
|
||||
"NonClientAreaContent", typeof(object), typeof(Window), new PropertyMetadata(default(object)));
|
||||
@@ -66,42 +69,38 @@ namespace HandyControl.Controls
|
||||
new PropertyMetadata(28.0));
|
||||
|
||||
public static readonly DependencyProperty ShowNonClientAreaProperty = DependencyProperty.Register(
|
||||
"ShowNonClientArea", typeof(bool), typeof(Window), new PropertyMetadata(ValueBoxes.TrueBox));
|
||||
"ShowNonClientArea", typeof(bool), typeof(Window),
|
||||
new PropertyMetadata(ValueBoxes.TrueBox, OnShowNonClientAreaChanged));
|
||||
|
||||
public static readonly DependencyProperty ShowTitleProperty = DependencyProperty.Register(
|
||||
"ShowTitle", typeof(bool), typeof(Window), new PropertyMetadata(ValueBoxes.FalseBox));
|
||||
|
||||
public static readonly DependencyProperty IsFullScreenProperty = DependencyProperty.Register(
|
||||
"IsFullScreen", typeof(bool), typeof(Window), new PropertyMetadata(ValueBoxes.FalseBox,
|
||||
(o, args) =>
|
||||
{
|
||||
var ctl = (Window)o;
|
||||
var v = (bool)args.NewValue;
|
||||
if (v)
|
||||
{
|
||||
ctl.OriginState = ctl.WindowState;
|
||||
ctl.OriginStyle = ctl.WindowStyle;
|
||||
ctl.OriginResizeMode = ctl.ResizeMode;
|
||||
ctl.WindowStyle = WindowStyle.None;
|
||||
//下面三行不能改变,就是故意的
|
||||
ctl.WindowState = WindowState.Maximized;
|
||||
ctl.WindowState = WindowState.Minimized;
|
||||
ctl.WindowState = WindowState.Maximized;
|
||||
}
|
||||
else
|
||||
{
|
||||
ctl.WindowState = ctl.OriginState;
|
||||
ctl.WindowStyle = ctl.OriginStyle;
|
||||
ctl.ResizeMode = ctl.OriginResizeMode;
|
||||
}
|
||||
}));
|
||||
"IsFullScreen", typeof(bool), typeof(Window),
|
||||
new PropertyMetadata(ValueBoxes.FalseBox, OnIsFullScreenChanged));
|
||||
|
||||
private bool _isFullScreen;
|
||||
|
||||
private UIElement _nonClientArea;
|
||||
|
||||
private bool _showNonClientArea = true;
|
||||
|
||||
private double _tempNonClientAreaHeight;
|
||||
|
||||
private Thickness _tempThickness;
|
||||
|
||||
private WindowState _tempWindowState;
|
||||
|
||||
private WindowStyle _tempWindowStyle;
|
||||
|
||||
private ResizeMode _tempResizeMode;
|
||||
|
||||
public Window()
|
||||
{
|
||||
var chrome = new WindowChrome
|
||||
{
|
||||
CornerRadius = new CornerRadius(),
|
||||
GlassFrameThickness = new Thickness(1)
|
||||
GlassFrameThickness = new Thickness(0, 0, 0, 1)
|
||||
};
|
||||
BindingOperations.SetBinding(chrome, WindowChrome.CaptionHeightProperty,
|
||||
new Binding(NonClientAreaHeightProperty.Name) {Source = this});
|
||||
@@ -123,9 +122,192 @@ namespace HandyControl.Controls
|
||||
(s, e) => WindowState = WindowState.Normal));
|
||||
CommandBindings.Add(new CommandBinding(SystemCommands.CloseWindowCommand, (s, e) => Close()));
|
||||
CommandBindings.Add(new CommandBinding(SystemCommands.ShowSystemMenuCommand, ShowSystemMenu));
|
||||
|
||||
_tempNonClientAreaHeight = NonClientAreaHeight;
|
||||
_tempWindowState = WindowState;
|
||||
_tempWindowStyle = WindowStyle;
|
||||
_tempResizeMode = ResizeMode;
|
||||
|
||||
SwitchIsFullScreen(_isFullScreen);
|
||||
SwitchShowNonClientArea(_showNonClientArea);
|
||||
};
|
||||
}
|
||||
|
||||
public Brush CloseButtonBackground
|
||||
{
|
||||
get => (Brush) GetValue(CloseButtonBackgroundProperty);
|
||||
set => SetValue(CloseButtonBackgroundProperty, value);
|
||||
}
|
||||
|
||||
public Brush CloseButtonForeground
|
||||
{
|
||||
get => (Brush) GetValue(CloseButtonForegroundProperty);
|
||||
set => SetValue(CloseButtonForegroundProperty, value);
|
||||
}
|
||||
|
||||
public Brush OtherButtonBackground
|
||||
{
|
||||
get => (Brush) GetValue(OtherButtonBackgroundProperty);
|
||||
set => SetValue(OtherButtonBackgroundProperty, value);
|
||||
}
|
||||
|
||||
public Brush OtherButtonForeground
|
||||
{
|
||||
get => (Brush) GetValue(OtherButtonForegroundProperty);
|
||||
set => SetValue(OtherButtonForegroundProperty, value);
|
||||
}
|
||||
|
||||
public double NonClientAreaHeight
|
||||
{
|
||||
get => (double) GetValue(NonClientAreaHeightProperty);
|
||||
set => SetValue(NonClientAreaHeightProperty, value);
|
||||
}
|
||||
|
||||
public bool IsFullScreen
|
||||
{
|
||||
get => (bool) GetValue(IsFullScreenProperty);
|
||||
set => SetValue(IsFullScreenProperty, value);
|
||||
}
|
||||
|
||||
public object NonClientAreaContent
|
||||
{
|
||||
get => GetValue(NonClientAreaContentProperty);
|
||||
set => SetValue(NonClientAreaContentProperty, value);
|
||||
}
|
||||
|
||||
public Brush CloseButtonHoverBackground
|
||||
{
|
||||
get => (Brush) GetValue(CloseButtonHoverBackgroundProperty);
|
||||
set => SetValue(CloseButtonHoverBackgroundProperty, value);
|
||||
}
|
||||
|
||||
public Brush CloseButtonHoverForeground
|
||||
{
|
||||
get => (Brush) GetValue(CloseButtonHoverForegroundProperty);
|
||||
set => SetValue(CloseButtonHoverForegroundProperty, value);
|
||||
}
|
||||
|
||||
public Brush OtherButtonHoverBackground
|
||||
{
|
||||
get => (Brush) GetValue(OtherButtonHoverBackgroundProperty);
|
||||
set => SetValue(OtherButtonHoverBackgroundProperty, value);
|
||||
}
|
||||
|
||||
public Brush OtherButtonHoverForeground
|
||||
{
|
||||
get => (Brush) GetValue(OtherButtonHoverForegroundProperty);
|
||||
set => SetValue(OtherButtonHoverForegroundProperty, value);
|
||||
}
|
||||
|
||||
public Brush NonClientAreaBackground
|
||||
{
|
||||
get => (Brush) GetValue(NonClientAreaBackgroundProperty);
|
||||
set => SetValue(NonClientAreaBackgroundProperty, value);
|
||||
}
|
||||
|
||||
public Brush NonClientAreaForeground
|
||||
{
|
||||
get => (Brush) GetValue(NonClientAreaForegroundProperty);
|
||||
set => SetValue(NonClientAreaForegroundProperty, value);
|
||||
}
|
||||
|
||||
public bool ShowNonClientArea
|
||||
{
|
||||
get => (bool) GetValue(ShowNonClientAreaProperty);
|
||||
set => SetValue(ShowNonClientAreaProperty, value);
|
||||
}
|
||||
|
||||
public bool ShowTitle
|
||||
{
|
||||
get => (bool) GetValue(ShowTitleProperty);
|
||||
set => SetValue(ShowTitleProperty, value);
|
||||
}
|
||||
|
||||
private static void OnShowNonClientAreaChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
var ctl = (Window) d;
|
||||
ctl.SwitchShowNonClientArea((bool) e.NewValue);
|
||||
}
|
||||
|
||||
private void SwitchShowNonClientArea(bool showNonClientArea)
|
||||
{
|
||||
if (_nonClientArea == null)
|
||||
{
|
||||
_showNonClientArea = showNonClientArea;
|
||||
return;
|
||||
}
|
||||
|
||||
if (showNonClientArea)
|
||||
{
|
||||
if (IsFullScreen)
|
||||
{
|
||||
_nonClientArea.Show(false);
|
||||
_tempNonClientAreaHeight = NonClientAreaHeight;
|
||||
NonClientAreaHeight = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
_nonClientArea.Show(true);
|
||||
NonClientAreaHeight = _tempNonClientAreaHeight;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_nonClientArea.Show(false);
|
||||
_tempNonClientAreaHeight = NonClientAreaHeight;
|
||||
NonClientAreaHeight = 0;
|
||||
}
|
||||
}
|
||||
|
||||
private static void OnIsFullScreenChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
var ctl = (Window) d;
|
||||
ctl.SwitchIsFullScreen((bool) e.NewValue);
|
||||
}
|
||||
|
||||
private void SwitchIsFullScreen(bool isFullScreen)
|
||||
{
|
||||
if (_nonClientArea == null)
|
||||
{
|
||||
_isFullScreen = isFullScreen;
|
||||
return;
|
||||
}
|
||||
|
||||
if (isFullScreen)
|
||||
{
|
||||
_nonClientArea.Show(false);
|
||||
_tempNonClientAreaHeight = NonClientAreaHeight;
|
||||
NonClientAreaHeight = 0;
|
||||
|
||||
_tempWindowState = WindowState;
|
||||
_tempWindowStyle = WindowStyle;
|
||||
_tempResizeMode = ResizeMode;
|
||||
WindowStyle = WindowStyle.None;
|
||||
//下面三行不能改变,就是故意的
|
||||
WindowState = WindowState.Maximized;
|
||||
WindowState = WindowState.Minimized;
|
||||
WindowState = WindowState.Maximized;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ShowNonClientArea)
|
||||
{
|
||||
_nonClientArea.Show(true);
|
||||
NonClientAreaHeight = _tempNonClientAreaHeight;
|
||||
}
|
||||
else
|
||||
{
|
||||
_nonClientArea.Show(false);
|
||||
_tempNonClientAreaHeight = NonClientAreaHeight;
|
||||
NonClientAreaHeight = 0;
|
||||
}
|
||||
|
||||
WindowState = _tempWindowState;
|
||||
WindowStyle = _tempWindowStyle;
|
||||
ResizeMode = _tempResizeMode;
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnStateChanged(EventArgs e)
|
||||
{
|
||||
base.OnStateChanged(e);
|
||||
@@ -143,6 +325,8 @@ namespace HandyControl.Controls
|
||||
{
|
||||
base.OnApplyTemplate();
|
||||
|
||||
_nonClientArea = GetTemplateChild(ElementNonClientArea) as UIElement;
|
||||
|
||||
if (SizeToContent != SizeToContent.WidthAndHeight)
|
||||
return;
|
||||
|
||||
@@ -150,111 +334,6 @@ namespace HandyControl.Controls
|
||||
Dispatcher.BeginInvoke(new Action(() => { SizeToContent = SizeToContent.WidthAndHeight; }));
|
||||
}
|
||||
|
||||
public Brush CloseButtonBackground
|
||||
{
|
||||
get => (Brush)GetValue(CloseButtonBackgroundProperty);
|
||||
set => SetValue(CloseButtonBackgroundProperty, value);
|
||||
}
|
||||
|
||||
public Brush CloseButtonForeground
|
||||
{
|
||||
get => (Brush)GetValue(CloseButtonForegroundProperty);
|
||||
set => SetValue(CloseButtonForegroundProperty, value);
|
||||
}
|
||||
|
||||
public Brush OtherButtonBackground
|
||||
{
|
||||
get => (Brush)GetValue(OtherButtonBackgroundProperty);
|
||||
set => SetValue(OtherButtonBackgroundProperty, value);
|
||||
}
|
||||
|
||||
public Brush OtherButtonForeground
|
||||
{
|
||||
get => (Brush)GetValue(OtherButtonForegroundProperty);
|
||||
set => SetValue(OtherButtonForegroundProperty, value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 原始状态
|
||||
/// </summary>
|
||||
private WindowState OriginState { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 原始样式
|
||||
/// </summary>
|
||||
private WindowStyle OriginStyle { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 原始尺寸调节模式
|
||||
/// </summary>
|
||||
private ResizeMode OriginResizeMode { get; set; }
|
||||
|
||||
public double NonClientAreaHeight
|
||||
{
|
||||
get => (double)GetValue(NonClientAreaHeightProperty);
|
||||
set => SetValue(NonClientAreaHeightProperty, value);
|
||||
}
|
||||
|
||||
public bool IsFullScreen
|
||||
{
|
||||
get => (bool)GetValue(IsFullScreenProperty);
|
||||
set => SetValue(IsFullScreenProperty, value);
|
||||
}
|
||||
|
||||
public object NonClientAreaContent
|
||||
{
|
||||
get => GetValue(NonClientAreaContentProperty);
|
||||
set => SetValue(NonClientAreaContentProperty, value);
|
||||
}
|
||||
|
||||
public Brush CloseButtonHoverBackground
|
||||
{
|
||||
get => (Brush)GetValue(CloseButtonHoverBackgroundProperty);
|
||||
set => SetValue(CloseButtonHoverBackgroundProperty, value);
|
||||
}
|
||||
|
||||
public Brush CloseButtonHoverForeground
|
||||
{
|
||||
get => (Brush)GetValue(CloseButtonHoverForegroundProperty);
|
||||
set => SetValue(CloseButtonHoverForegroundProperty, value);
|
||||
}
|
||||
|
||||
public Brush OtherButtonHoverBackground
|
||||
{
|
||||
get => (Brush)GetValue(OtherButtonHoverBackgroundProperty);
|
||||
set => SetValue(OtherButtonHoverBackgroundProperty, value);
|
||||
}
|
||||
|
||||
public Brush OtherButtonHoverForeground
|
||||
{
|
||||
get => (Brush)GetValue(OtherButtonHoverForegroundProperty);
|
||||
set => SetValue(OtherButtonHoverForegroundProperty, value);
|
||||
}
|
||||
|
||||
public Brush NonClientAreaBackground
|
||||
{
|
||||
get => (Brush)GetValue(NonClientAreaBackgroundProperty);
|
||||
set => SetValue(NonClientAreaBackgroundProperty, value);
|
||||
}
|
||||
|
||||
public Brush NonClientAreaForeground
|
||||
{
|
||||
get => (Brush)GetValue(NonClientAreaForegroundProperty);
|
||||
set => SetValue(NonClientAreaForegroundProperty, value);
|
||||
}
|
||||
|
||||
public bool ShowNonClientArea
|
||||
{
|
||||
get => (bool)GetValue(ShowNonClientAreaProperty);
|
||||
set => SetValue(ShowNonClientAreaProperty, value);
|
||||
}
|
||||
|
||||
public bool ShowTitle
|
||||
{
|
||||
get => (bool)GetValue(ShowTitleProperty);
|
||||
set => SetValue(ShowTitleProperty, value);
|
||||
}
|
||||
|
||||
private void ShowSystemMenu(object sender, ExecutedRoutedEventArgs e)
|
||||
{
|
||||
var point = WindowState == WindowState.Maximized
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// ReSharper disable once CheckNamespace
|
||||
|
||||
namespace HandyControl.Data
|
||||
{
|
||||
public enum InfoType
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// ReSharper disable once CheckNamespace
|
||||
|
||||
namespace HandyControl.Data
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// ReSharper disable once CheckNamespace
|
||||
|
||||
namespace HandyControl.Data
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// ReSharper disable once CheckNamespace
|
||||
|
||||
namespace HandyControl.Data
|
||||
{
|
||||
public enum SkinType
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// ReSharper disable once CheckNamespace
|
||||
|
||||
namespace HandyControl.Data
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// ReSharper disable once CheckNamespace
|
||||
|
||||
namespace HandyControl.Data
|
||||
{
|
||||
public enum TipPlacement
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// ReSharper disable once CheckNamespace
|
||||
|
||||
namespace HandyControl.Data
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -114,6 +114,7 @@
|
||||
</When>
|
||||
</Choose>
|
||||
<ItemGroup>
|
||||
<Compile Include="Controls\Attach\WindowAttach.cs" />
|
||||
<Compile Include="Controls\Attach\LinkElement.cs" />
|
||||
<Compile Include="Controls\Attach\PanelElement.cs" />
|
||||
<Compile Include="Controls\Attach\VisualElement.cs" />
|
||||
@@ -151,8 +152,8 @@
|
||||
<Compile Include="Controls\Text\OutlineText.cs" />
|
||||
<Compile Include="Controls\Image\GifImage.cs" />
|
||||
<Compile Include="Controls\Input\SearchBar.cs" />
|
||||
<Compile Include="Controls\Tag\TagPanel.cs" />
|
||||
<Compile Include="Controls\Tag\Tag.cs" />
|
||||
<Compile Include="Controls\Text\Tag\TagPanel.cs" />
|
||||
<Compile Include="Controls\Text\Tag\Tag.cs" />
|
||||
<Compile Include="Controls\Time\CalendarWithClock.cs" />
|
||||
<Compile Include="Controls\Time\Clock\Clock.cs" />
|
||||
<Compile Include="Controls\Time\Clock\ClockRadioButton.cs" />
|
||||
@@ -182,6 +183,7 @@
|
||||
<Compile Include="Controls\Time\FlipClock\FlipClock.cs" />
|
||||
<Compile Include="Controls\Time\FlipClock\FlipNumber.cs" />
|
||||
<Compile Include="Controls\Window\BlurWindow.cs" />
|
||||
<Compile Include="Controls\Window\MessageBox.cs" />
|
||||
<Compile Include="Data\Args\CancelRoutedEventArgs.cs" />
|
||||
<Compile Include="Data\Enum\InfoType.cs" />
|
||||
<Compile Include="Data\Enum\ResultType.cs" />
|
||||
@@ -617,6 +619,10 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Themes\Styles\MessageBox.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Themes\Styles\NumericUpDown.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
@@ -629,6 +635,10 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Themes\Styles\PopupWindow.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Themes\Styles\ProgressBar.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
|
||||
@@ -77,6 +77,16 @@ namespace HandyControl.Interactivity
|
||||
/// </summary>
|
||||
public static RoutedCommand Confirm { get; } = new RoutedCommand(nameof(Confirm), typeof(ControlCommands));
|
||||
|
||||
/// <summary>
|
||||
/// 是
|
||||
/// </summary>
|
||||
public static RoutedCommand Yes { get; } = new RoutedCommand(nameof(Yes), typeof(ControlCommands));
|
||||
|
||||
/// <summary>
|
||||
/// 否
|
||||
/// </summary>
|
||||
public static RoutedCommand No { get; } = new RoutedCommand(nameof(No), typeof(ControlCommands));
|
||||
|
||||
/// <summary>
|
||||
/// 关闭所有
|
||||
/// </summary>
|
||||
|
||||
@@ -10,4 +10,4 @@ using System.Runtime.InteropServices;
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
[assembly: ComVisible(false)]
|
||||
[assembly: AssemblyVersion("1.5.1.*")]
|
||||
[assembly: AssemblyVersion("1.5.2.*")]
|
||||
+18
@@ -240,6 +240,15 @@ namespace HandyControl.Properties.Langs {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 否 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string No {
|
||||
get {
|
||||
return ResourceManager.GetString("No", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 不在范围内 的本地化字符串。
|
||||
/// </summary>
|
||||
@@ -302,5 +311,14 @@ namespace HandyControl.Properties.Langs {
|
||||
return ResourceManager.GetString("UnknownSize", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 是 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string Yes {
|
||||
get {
|
||||
return ResourceManager.GetString("Yes", resourceCulture);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -53,7 +53,6 @@
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
@@ -198,4 +197,10 @@
|
||||
<data name="CannotRegisterSameCommandTwice" xml:space="preserve">
|
||||
<value>Cannot Register Same Command Twice</value>
|
||||
</data>
|
||||
<data name="Yes" xml:space="preserve">
|
||||
<value>Yes</value>
|
||||
</data>
|
||||
<data name="No" xml:space="preserve">
|
||||
<value>No</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -178,4 +178,10 @@
|
||||
<data name="CannotRegisterSameCommandTwice" xml:space="preserve">
|
||||
<value>不能注册同一命令两次</value>
|
||||
</data>
|
||||
<data name="Yes" xml:space="preserve">
|
||||
<value>是</value>
|
||||
</data>
|
||||
<data name="No" xml:space="preserve">
|
||||
<value>否</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -54,7 +54,7 @@
|
||||
</Grid.ColumnDefinitions>
|
||||
<Border x:Name="templateRoot" Grid.ColumnSpan="2" CornerRadius="{Binding Path=(controls:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="true"/>
|
||||
<Path Grid.Column="1" x:Name="arrow" Data="{StaticResource DownGeometry}" Stretch="Uniform" Fill="{TemplateBinding BorderBrush}" HorizontalAlignment="Center" Margin="7" VerticalAlignment="Center" RenderTransformOrigin="0.5,0.5"/>
|
||||
<TextBlock Grid.Column="0" VerticalAlignment="{Binding VerticalContentAlignment,RelativeSource={RelativeSource FindAncestor,AncestorType=ComboBox}}" Margin="8,7,8,8" Visibility="{Binding Text,RelativeSource={RelativeSource FindAncestor,AncestorType=ComboBox},Converter={StaticResource String2VisibilityReConverter}}" HorizontalAlignment="Stretch" Style="{StaticResource TextBlockDefaultThiLight}" Text="{Binding Path=(controls:InfoElement.Placeholder),RelativeSource={RelativeSource FindAncestor,AncestorType=ComboBox}}"/>
|
||||
<TextBlock Grid.Column="0" VerticalAlignment="{Binding VerticalContentAlignment,RelativeSource={RelativeSource AncestorType=ComboBox}}" Margin="8,7,8,8" Visibility="{Binding Text,RelativeSource={RelativeSource AncestorType=ComboBox},Converter={StaticResource String2VisibilityReConverter}}" HorizontalAlignment="Stretch" Style="{StaticResource TextBlockDefaultThiLight}" Text="{Binding Path=(controls:InfoElement.Placeholder),RelativeSource={RelativeSource AncestorType=ComboBox}}"/>
|
||||
</Grid>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsChecked" Value="True">
|
||||
|
||||
@@ -203,6 +203,7 @@
|
||||
<Style x:Key="ContextMenuBaseStyle" TargetType="ContextMenu">
|
||||
<Setter Property="MaxHeight" Value="199"/>
|
||||
<Setter Property="Background" Value="{DynamicResource RegionBrush}"/>
|
||||
<Setter Property="SnapsToDevicePixels" Value="True"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ContextMenu">
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
xmlns:controls="clr-namespace:HandyControl.Controls">
|
||||
|
||||
<!--<Style x:Key="CoverFlowItemBaseStyle" TargetType="controls:CoverFlowItem">
|
||||
<Setter Property="Width" Value="{Binding ItemWidth,RelativeSource={RelativeSource FindAncestor, AncestorType=controls:CoverFlow}}"/>
|
||||
<Setter Property="Height" Value="{Binding ItemHeight,RelativeSource={RelativeSource FindAncestor, AncestorType=controls:CoverFlow}}"/>
|
||||
<Setter Property="Width" Value="{Binding ItemWidth,RelativeSource={RelativeSource AncestorType=controls:CoverFlow}}"/>
|
||||
<Setter Property="Height" Value="{Binding ItemHeight,RelativeSource={RelativeSource AncestorType=controls:CoverFlow}}"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="controls:CoverFlowItem">
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
xmlns:controls="clr-namespace:HandyControl.Controls">
|
||||
|
||||
<Style x:Key="CoverViewItemBaseStyle" TargetType="controls:CoverViewItem">
|
||||
<Setter Property="Margin" Value="{Binding ItemMargin,RelativeSource={RelativeSource FindAncestor, AncestorType=controls:CoverView}}"/>
|
||||
<Setter Property="Width" Value="{Binding ItemWidth,RelativeSource={RelativeSource FindAncestor, AncestorType=controls:CoverView}}"/>
|
||||
<Setter Property="Height" Value="{Binding ItemHeight,RelativeSource={RelativeSource FindAncestor, AncestorType=controls:CoverView}}"/>
|
||||
<Setter Property="Margin" Value="{Binding ItemMargin,RelativeSource={RelativeSource AncestorType=controls:CoverView}}"/>
|
||||
<Setter Property="Width" Value="{Binding ItemWidth,RelativeSource={RelativeSource AncestorType=controls:CoverView}}"/>
|
||||
<Setter Property="Height" Value="{Binding ItemHeight,RelativeSource={RelativeSource AncestorType=controls:CoverView}}"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="controls:CoverViewItem">
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<ControlTemplate TargetType="DatePickerTextBox">
|
||||
<Grid x:Name="WatermarkContent">
|
||||
<Border x:Name="ContentElement"/>
|
||||
<ContentControl VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="7,6" Content="{Binding Path=(controls:InfoElement.Placeholder),RelativeSource={RelativeSource FindAncestor,AncestorType=DatePicker}}" TextElement.Foreground="{DynamicResource ThirdlyTextBrush}" Focusable="False" IsHitTestVisible="False" Visibility="{TemplateBinding Text,Converter={StaticResource String2VisibilityReConverter}}"/>
|
||||
<ContentControl VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="7,6" Content="{Binding Path=(controls:InfoElement.Placeholder),RelativeSource={RelativeSource AncestorType=DatePicker}}" TextElement.Foreground="{DynamicResource ThirdlyTextBrush}" Focusable="False" IsHitTestVisible="False" Visibility="{TemplateBinding Text,Converter={StaticResource String2VisibilityReConverter}}"/>
|
||||
<ScrollViewer x:Name="PART_ContentHost" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="0" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<Setter Property="Padding" Value="10,0"/>
|
||||
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}"/>
|
||||
<Setter Property="Height" Value="32"/>
|
||||
<Setter Property="HorizontalContentAlignment" Value="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
|
||||
<Setter Property="HorizontalContentAlignment" Value="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType=ItemsControl}}"/>
|
||||
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
||||
<Setter Property="Background" Value="{DynamicResource RegionBrush}"/>
|
||||
<Setter Property="BorderBrush" Value="Transparent"/>
|
||||
|
||||
@@ -187,7 +187,7 @@
|
||||
<Trigger Property="IsChecked" Value="True">
|
||||
<Setter Property="Panel.ZIndex" Value="{x:Static system:Int32.MaxValue}"/>
|
||||
</Trigger>
|
||||
<DataTrigger Binding="{Binding Orientation,RelativeSource={RelativeSource FindAncestor, AncestorType=controls:RadioGroup}}" Value="Vertical">
|
||||
<DataTrigger Binding="{Binding Orientation,RelativeSource={RelativeSource AncestorType=controls:RadioGroup}}" Value="Vertical">
|
||||
<Setter Property="Margin" Value="0,-1,0,0"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
|
||||
@@ -8,14 +8,14 @@
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
|
||||
<Style x:Key="RateRateItemBaseStyle" TargetType="controls:RateItem">
|
||||
<Setter Property="Margin" Value="{Binding ItemMargin,RelativeSource={RelativeSource FindAncestor, AncestorType=controls:Rate}}"/>
|
||||
<Setter Property="Width" Value="{Binding ItemWidth,RelativeSource={RelativeSource FindAncestor, AncestorType=controls:Rate}}"/>
|
||||
<Setter Property="Height" Value="{Binding ItemHeight,RelativeSource={RelativeSource FindAncestor, AncestorType=controls:Rate}}"/>
|
||||
<Setter Property="AllowHalf" Value="{Binding AllowHalf,RelativeSource={RelativeSource FindAncestor, AncestorType=controls:Rate}}"/>
|
||||
<Setter Property="AllowClear" Value="{Binding AllowClear,RelativeSource={RelativeSource FindAncestor, AncestorType=controls:Rate}}"/>
|
||||
<Setter Property="Icon" Value="{Binding Icon,RelativeSource={RelativeSource FindAncestor, AncestorType=controls:Rate}}"/>
|
||||
<Setter Property="IsReadOnly" Value="{Binding IsReadOnly,RelativeSource={RelativeSource FindAncestor, AncestorType=controls:Rate}}"/>
|
||||
<Setter Property="Background" Value="{Binding Background,RelativeSource={RelativeSource FindAncestor, AncestorType=controls:Rate}}"/>
|
||||
<Setter Property="Margin" Value="{Binding ItemMargin,RelativeSource={RelativeSource AncestorType=controls:Rate}}"/>
|
||||
<Setter Property="Width" Value="{Binding ItemWidth,RelativeSource={RelativeSource AncestorType=controls:Rate}}"/>
|
||||
<Setter Property="Height" Value="{Binding ItemHeight,RelativeSource={RelativeSource AncestorType=controls:Rate}}"/>
|
||||
<Setter Property="AllowHalf" Value="{Binding AllowHalf,RelativeSource={RelativeSource AncestorType=controls:Rate}}"/>
|
||||
<Setter Property="AllowClear" Value="{Binding AllowClear,RelativeSource={RelativeSource AncestorType=controls:Rate}}"/>
|
||||
<Setter Property="Icon" Value="{Binding Icon,RelativeSource={RelativeSource AncestorType=controls:Rate}}"/>
|
||||
<Setter Property="IsReadOnly" Value="{Binding IsReadOnly,RelativeSource={RelativeSource AncestorType=controls:Rate}}"/>
|
||||
<Setter Property="Background" Value="{Binding Background,RelativeSource={RelativeSource AncestorType=controls:Rate}}"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="controls:RateItem">
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
<Border Background="{DynamicResource RegionBrush}" HorizontalAlignment="Center" CornerRadius="12" BorderThickness="2" BorderBrush="{TemplateBinding Foreground}" Height="24" MinWidth="24">
|
||||
<TextBlock Foreground="{TemplateBinding Foreground}" Style="{StaticResource TextBlockDefaultThiLight}" Text="{Binding Index,RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
</Border>
|
||||
<ContentPresenter HorizontalAlignment="Center" ContentTemplate="{Binding ItemTemplate,RelativeSource={RelativeSource FindAncestor,AncestorType=controls:StepBar}}" TextElement.Foreground="{TemplateBinding Foreground}" Margin="0,4,0,0"/>
|
||||
<ContentPresenter HorizontalAlignment="Center" ContentTemplate="{Binding ItemTemplate,RelativeSource={RelativeSource AncestorType=controls:StepBar}}" TextElement.Foreground="{TemplateBinding Foreground}" Margin="0,4,0,0"/>
|
||||
</StackPanel>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
@@ -44,7 +44,7 @@
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="controls:StepBarItem">
|
||||
<StackPanel>
|
||||
<ContentPresenter HorizontalAlignment="Center" ContentTemplate="{Binding ItemTemplate,RelativeSource={RelativeSource FindAncestor,AncestorType=controls:StepBar}}" TextElement.Foreground="{TemplateBinding Foreground}" Margin="0,0,0,4"/>
|
||||
<ContentPresenter HorizontalAlignment="Center" ContentTemplate="{Binding ItemTemplate,RelativeSource={RelativeSource AncestorType=controls:StepBar}}" TextElement.Foreground="{TemplateBinding Foreground}" Margin="0,0,0,4"/>
|
||||
<Border Background="{DynamicResource RegionBrush}" HorizontalAlignment="Center" CornerRadius="12" BorderThickness="2" BorderBrush="{TemplateBinding Foreground}" Height="24" MinWidth="24">
|
||||
<TextBlock Foreground="{TemplateBinding Foreground}" Style="{StaticResource TextBlockDefaultThiLight}" Text="{Binding Index,RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
</Border>
|
||||
@@ -63,7 +63,7 @@
|
||||
<Border Background="{DynamicResource RegionBrush}" HorizontalAlignment="Center" CornerRadius="12" BorderThickness="2" BorderBrush="{TemplateBinding Foreground}" Height="24" MinWidth="24">
|
||||
<TextBlock Foreground="{TemplateBinding Foreground}" Style="{StaticResource TextBlockDefaultThiLight}" Text="{Binding Index,RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
</Border>
|
||||
<ContentPresenter HorizontalAlignment="Left" ContentTemplate="{Binding ItemTemplate,RelativeSource={RelativeSource FindAncestor,AncestorType=controls:StepBar}}" TextElement.Foreground="{TemplateBinding Foreground}" Margin="10,4,0,0"/>
|
||||
<ContentPresenter HorizontalAlignment="Left" ContentTemplate="{Binding ItemTemplate,RelativeSource={RelativeSource AncestorType=controls:StepBar}}" TextElement.Foreground="{TemplateBinding Foreground}" Margin="10,4,0,0"/>
|
||||
</StackPanel>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
|
||||
@@ -22,23 +22,23 @@
|
||||
<ControlTemplate TargetType="TabItem">
|
||||
<Grid x:Name="templateRoot" SnapsToDevicePixels="true">
|
||||
<Border x:Name="mainBorder" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0" Background="{TemplateBinding Background}" Margin="0"/>
|
||||
<ContentPresenter x:Name="contentPresenter" ContentSource="Header" Focusable="False" HorizontalAlignment="Center" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
|
||||
<ContentPresenter x:Name="contentPresenter" TextElement.Foreground="{DynamicResource PrimaryTextBrush}" ContentSource="Header" Focusable="False" HorizontalAlignment="Center" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
|
||||
</Grid>
|
||||
<ControlTemplate.Triggers>
|
||||
<MultiDataTrigger>
|
||||
<MultiDataTrigger.Conditions>
|
||||
<Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="false"/>
|
||||
<Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Top"/>
|
||||
<Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType=TabControl}}" Value="Top"/>
|
||||
</MultiDataTrigger.Conditions>
|
||||
<Setter Property="BorderThickness" TargetName="mainBorder" Value="0,0,0,0"/>
|
||||
</MultiDataTrigger>
|
||||
<MultiDataTrigger>
|
||||
<MultiDataTrigger.Conditions>
|
||||
<Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="true"/>
|
||||
<Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Top"/>
|
||||
<Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType=TabControl}}" Value="Top"/>
|
||||
</MultiDataTrigger.Conditions>
|
||||
<Setter Property="Panel.ZIndex" Value="1"/>
|
||||
<Setter Property="Foreground" Value="{DynamicResource PrimaryBrush}"/>
|
||||
<Setter Property="TextElement.Foreground" Value="{DynamicResource PrimaryBrush}" TargetName="contentPresenter"/>
|
||||
<Setter Property="BorderThickness" TargetName="mainBorder" Value="0,0,0,3"/>
|
||||
</MultiDataTrigger>
|
||||
</ControlTemplate.Triggers>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ToggleButton">
|
||||
<Border Background="Transparent" Height="16" Padding="4" Width="16">
|
||||
<Path x:Name="ExpandPath" RenderTransformOrigin="0.5,0.5" Stretch="Uniform" Data="{StaticResource TreeArrow}" Fill="{Binding Foreground, RelativeSource={RelativeSource AncestorType={x:Type TreeViewItem}}}">
|
||||
<Path x:Name="ExpandPath" RenderTransformOrigin="0.5,0.5" Stretch="Uniform" Data="{StaticResource TreeArrow}" Fill="{Binding Foreground, RelativeSource={RelativeSource AncestorType=TreeViewItem}}">
|
||||
<Path.RenderTransform>
|
||||
<RotateTransform Angle="-90"/>
|
||||
</Path.RenderTransform>
|
||||
@@ -53,7 +53,7 @@
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
<Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true">
|
||||
<StackPanel Orientation="Horizontal" Margin="{Binding Converter={StaticResource TreeViewItemMarginConverter}, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TreeViewItem}}}">
|
||||
<StackPanel Orientation="Horizontal" Margin="{Binding Converter={StaticResource TreeViewItemMarginConverter}, RelativeSource={RelativeSource AncestorLevel=1, AncestorType=TreeViewItem}}">
|
||||
<ToggleButton x:Name="Expander" ClickMode="Press" IsChecked="{Binding IsExpanded, RelativeSource={RelativeSource TemplatedParent}}" Style="{StaticResource ExpandCollapseToggleStyle}"/>
|
||||
<ContentPresenter VerticalAlignment="Center" x:Name="PART_Header" ContentSource="Header" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
|
||||
</StackPanel>
|
||||
|
||||
@@ -214,11 +214,11 @@
|
||||
</Border>
|
||||
</Grid>
|
||||
<ControlTemplate.Triggers>
|
||||
<DataTrigger Binding="{Binding DisplayMode, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Calendar}}}" Value="Year">
|
||||
<DataTrigger Binding="{Binding DisplayMode, RelativeSource={RelativeSource AncestorType=Calendar}}" Value="Year">
|
||||
<Setter Property="Visibility" TargetName="PART_MonthView" Value="Hidden"/>
|
||||
<Setter Property="Visibility" TargetName="PART_YearView" Value="Visible"/>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding DisplayMode, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Calendar}}}" Value="Decade">
|
||||
<DataTrigger Binding="{Binding DisplayMode, RelativeSource={RelativeSource AncestorType=Calendar}}" Value="Decade">
|
||||
<Setter Property="Visibility" TargetName="PART_MonthView" Value="Hidden"/>
|
||||
<Setter Property="Visibility" TargetName="PART_YearView" Value="Visible"/>
|
||||
</DataTrigger>
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
|
||||
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="Base/ContextMenuBaseStyle.xaml"/>
|
||||
|
||||
@@ -79,8 +79,8 @@
|
||||
</SelectiveScrollingGrid.RowDefinitions>
|
||||
<Border CornerRadius="4" Grid.ColumnSpan="2" x:Name="DGR_Border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True"/>
|
||||
<DataGridCellsPresenter MinHeight="{TemplateBinding MinHeight}" VerticalContentAlignment="Center" Grid.Row="0" Grid.Column="1" ItemsPanel="{TemplateBinding ItemsPanel}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
|
||||
<DataGridDetailsPresenter Margin="0,6" Grid.Column="1" Grid.Row="1" SelectiveScrollingGrid.SelectiveScrollingOrientation="{Binding AreRowDetailsFrozen, ConverterParameter={x:Static SelectiveScrollingOrientation.Vertical}, Converter={x:Static DataGrid.RowDetailsScrollingConverter}, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}" Visibility="{TemplateBinding DetailsVisibility}"/>
|
||||
<DataGridRowHeader Grid.Row="0" Grid.Column="0" SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical" Visibility="{Binding HeadersVisibility, ConverterParameter={x:Static DataGridHeadersVisibility.Row}, Converter={x:Static DataGrid.HeadersVisibilityConverter}, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
|
||||
<DataGridDetailsPresenter Margin="0,6" Grid.Column="1" Grid.Row="1" SelectiveScrollingGrid.SelectiveScrollingOrientation="{Binding AreRowDetailsFrozen, ConverterParameter={x:Static SelectiveScrollingOrientation.Vertical}, Converter={x:Static DataGrid.RowDetailsScrollingConverter}, RelativeSource={RelativeSource AncestorType=DataGrid}}" Visibility="{TemplateBinding DetailsVisibility}"/>
|
||||
<DataGridRowHeader Grid.Row="0" Grid.Column="0" SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical" Visibility="{Binding HeadersVisibility, ConverterParameter={x:Static DataGridHeadersVisibility.Row}, Converter={x:Static DataGrid.HeadersVisibilityConverter}, RelativeSource={RelativeSource AncestorType=DataGrid}}"/>
|
||||
</SelectiveScrollingGrid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
@@ -237,13 +237,13 @@
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Button Command="{x:Static DataGrid.SelectAllCommand}" Margin="0,0,0,6" Visibility="{Binding HeadersVisibility, ConverterParameter={x:Static DataGridHeadersVisibility.All}, Converter={x:Static DataGrid.HeadersVisibilityConverter}, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}" Width="{Binding CellsPanelHorizontalOffset, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}" Style="{StaticResource ButtonIcon}" controls:IconElement.Geometry="{StaticResource AllGeometry}" Foreground="{DynamicResource PrimaryBrush}"/>
|
||||
<DataGridColumnHeadersPresenter x:Name="PART_ColumnHeadersPresenter" Grid.ColumnSpan="2" Grid.Row="0" Grid.Column="1" Visibility="{Binding HeadersVisibility, ConverterParameter={x:Static DataGridHeadersVisibility.Column}, Converter={x:Static DataGrid.HeadersVisibilityConverter}, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
|
||||
<Button Command="{x:Static DataGrid.SelectAllCommand}" Margin="0,0,0,6" Visibility="{Binding HeadersVisibility, ConverterParameter={x:Static DataGridHeadersVisibility.All}, Converter={x:Static DataGrid.HeadersVisibilityConverter}, RelativeSource={RelativeSource AncestorType=DataGrid}}" Width="{Binding CellsPanelHorizontalOffset, RelativeSource={RelativeSource AncestorType=DataGrid}}" Style="{StaticResource ButtonIcon}" controls:IconElement.Geometry="{StaticResource AllGeometry}" Foreground="{DynamicResource PrimaryBrush}"/>
|
||||
<DataGridColumnHeadersPresenter x:Name="PART_ColumnHeadersPresenter" Grid.ColumnSpan="2" Grid.Row="0" Grid.Column="1" Visibility="{Binding HeadersVisibility, ConverterParameter={x:Static DataGridHeadersVisibility.Column}, Converter={x:Static DataGrid.HeadersVisibilityConverter}, RelativeSource={RelativeSource AncestorType=DataGrid}}"/>
|
||||
<ScrollContentPresenter x:Name="PART_ScrollContentPresenter" CanContentScroll="{TemplateBinding CanContentScroll}" Grid.ColumnSpan="3" Grid.Column="0" Grid.Row="1"/>
|
||||
<ScrollBar Style="{StaticResource ScrollBarBaseStyle}" Opacity="0" x:Name="PART_VerticalScrollBar" Grid.Column="2" Maximum="{TemplateBinding ScrollableHeight}" Orientation="Vertical" Grid.Row="1" Visibility="{TemplateBinding VerticalScrollBarVisibility}" Value="{Binding VerticalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportHeight}"/>
|
||||
<Grid Grid.Column="1" Grid.Row="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="{Binding NonFrozenColumnsViewportHorizontalOffset, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
|
||||
<ColumnDefinition Width="{Binding NonFrozenColumnsViewportHorizontalOffset, RelativeSource={RelativeSource AncestorType=DataGrid}}"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<ScrollBar Style="{StaticResource ScrollBarBaseStyle}" Opacity="0" VerticalAlignment="Bottom" x:Name="PART_HorizontalScrollBar" Grid.Column="1" Maximum="{TemplateBinding ScrollableWidth}" Orientation="Horizontal" Visibility="{TemplateBinding HorizontalScrollBarVisibility}" Value="{Binding HorizontalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportWidth}"/>
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
<Path Grid.Row="0" Grid.Column="0" VerticalAlignment="Top" Margin="0,15,0,0" Width="30" Height="30" Data="{TemplateBinding Icon}" Stretch="Uniform" Fill="{TemplateBinding IconBrush}"/>
|
||||
<StackPanel VerticalAlignment="Center" Grid.Row="0" Grid.Column="1" Margin="0,10,10,10">
|
||||
<TextBlock Text="{TemplateBinding Message}" Style="{StaticResource TextBlockDefault}" HorizontalAlignment="Left" TextWrapping="Wrap"/>
|
||||
<TextBlock Visibility="{Binding ShowDateTime,RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}" Text="{Binding Time,RelativeSource={RelativeSource FindAncestor,AncestorType=controls:Growl},StringFormat=yyyy/MM/dd HH:mm:ss}" Style="{StaticResource TextBlockDefault}" Foreground="{DynamicResource SecondaryTextBrush}" HorizontalAlignment="Left" Margin="0,4,0,0"/>
|
||||
<TextBlock Visibility="{Binding ShowDateTime,RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}" Text="{Binding Time,RelativeSource={RelativeSource AncestorType=controls:Growl},StringFormat=yyyy/MM/dd HH:mm:ss}" Style="{StaticResource TextBlockDefault}" Foreground="{DynamicResource SecondaryTextBrush}" HorizontalAlignment="Left" Margin="0,4,0,0"/>
|
||||
</StackPanel>
|
||||
<Button Grid.Row="0" Visibility="Collapsed" Margin="11,0" Name="PART_ButtonClose" Command="interactivity:ControlCommands.Close" Grid.Column="2" Background="Transparent" Style="{StaticResource ButtonCustom}" VerticalAlignment="Center" HorizontalAlignment="Center" Width="18" Height="18">
|
||||
<Path Data="{StaticResource ErrorGeometry}" Stretch="Uniform" Fill="{DynamicResource SecondaryTextBrush}"/>
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<Setter Property="SnapsToDevicePixels" Value="True"/>
|
||||
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
|
||||
<Setter Property="Padding" Value="0"/>
|
||||
<Setter Property="HorizontalContentAlignment" Value="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
|
||||
<Setter Property="HorizontalContentAlignment" Value="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType=ItemsControl}}"/>
|
||||
<Setter Property="VerticalContentAlignment" Value="Top"/>
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="BorderBrush" Value="Transparent"/>
|
||||
@@ -29,7 +29,7 @@
|
||||
<Style x:Key="ListBoxItemFullStyle" BasedOn="{StaticResource ListBoxItemStyle}" TargetType="ListBoxItem">
|
||||
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
|
||||
<Setter Property="VerticalContentAlignment" Value="Stretch"/>
|
||||
<Setter Property="Height" Value="{Binding ActualHeight, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
|
||||
<Setter Property="Height" Value="{Binding ActualHeight, RelativeSource={RelativeSource AncestorType=ItemsControl}}"/>
|
||||
</Style>
|
||||
|
||||
<ItemsPanelTemplate x:Key="WrapPanelItemsPanelTemplate">
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:controls="clr-namespace:HandyControl.Controls"
|
||||
xmlns:langs="clr-namespace:HandyControl.Properties.Langs"
|
||||
xmlns:interactivity="clr-namespace:HandyControl.Interactivity">
|
||||
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="Window.xaml"/>
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
|
||||
<Style TargetType="controls:MessageBox" BasedOn="{StaticResource WindowWin10}">
|
||||
<Setter Property="MinHeight" Value="172"/>
|
||||
<Setter Property="ShowInTaskbar" Value="False"/>
|
||||
<Setter Property="MinWidth" Value="335"/>
|
||||
<Setter Property="MaxWidth" Value="476"/>
|
||||
<Setter Property="MaxHeight" Value="680"/>
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
<Setter Property="ResizeMode" Value="NoResize"/>
|
||||
<Setter Property="SizeToContent" Value="WidthAndHeight"/>
|
||||
<Setter Property="Content">
|
||||
<Setter.Value>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Path x:Name="PART_Image" HorizontalAlignment="Center" Visibility="Collapsed" Grid.Row="0" Grid.Column="0" VerticalAlignment="Top" Margin="20,32,0,0" Width="30" Height="30" Stretch="Uniform"/>
|
||||
<ScrollViewer Grid.Column="1" Grid.Row="0">
|
||||
<TextBlock Margin="10,39,10,10" x:Name="PART_Message" TextWrapping="Wrap" HorizontalAlignment="Left" VerticalAlignment="Top"/>
|
||||
</ScrollViewer>
|
||||
<StackPanel Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="1" Margin="0,10,0,16" Orientation="Horizontal" Background="{DynamicResource RegionBrush}" HorizontalAlignment="Center">
|
||||
<Button Visibility="{Binding IsEnabled,RelativeSource={RelativeSource Self},Converter={StaticResource Boolean2VisibilityConverter}}" IsCancel="True" MinWidth="88" Command="interactivity:ControlCommands.Cancel" Content="{x:Static langs:Lang.Cancel}" Margin="5,0"/>
|
||||
<Button Visibility="{Binding IsEnabled,RelativeSource={RelativeSource Self},Converter={StaticResource Boolean2VisibilityConverter}}" IsDefault="True" MinWidth="88" Command="interactivity:ControlCommands.Confirm" Content="{x:Static langs:Lang.Confirm}" Margin="5,0" Style="{StaticResource ButtonPrimary}"/>
|
||||
<Button Visibility="{Binding IsEnabled,RelativeSource={RelativeSource Self},Converter={StaticResource Boolean2VisibilityConverter}}" IsCancel="True" MinWidth="88" Command="interactivity:ControlCommands.No" Content="{x:Static langs:Lang.No}" Margin="5,0"/>
|
||||
<Button Visibility="{Binding IsEnabled,RelativeSource={RelativeSource Self},Converter={StaticResource Boolean2VisibilityConverter}}" IsDefault="True" MinWidth="88" Command="interactivity:ControlCommands.Yes" Content="{x:Static langs:Lang.Yes}" Margin="5,0" Style="{StaticResource ButtonPrimary}"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
</ResourceDictionary>
|
||||
@@ -0,0 +1,73 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:controls="clr-namespace:HandyControl.Controls"
|
||||
xmlns:interactivity="clr-namespace:HandyControl.Interactivity"
|
||||
xmlns:langs="clr-namespace:HandyControl.Properties.Langs">
|
||||
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="Button.xaml"/>
|
||||
<ResourceDictionary Source="../Basic/Converters.xaml"/>
|
||||
<ResourceDictionary Source="../Basic/Paths.xaml"/>
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
|
||||
<Style TargetType="controls:PopupWindow">
|
||||
<Setter Property="WindowStyle" Value="None"/>
|
||||
<Setter Property="MinHeight" Value="220"/>
|
||||
<Setter Property="UseLayoutRounding" Value="True"/>
|
||||
<Setter Property="BorderThickness" Value="20"/>
|
||||
<Setter Property="ShowInTaskbar" Value="False"/>
|
||||
<Setter Property="MinWidth" Value="300"/>
|
||||
<Setter Property="ResizeMode" Value="NoResize"/>
|
||||
<Setter Property="Background" Value="{DynamicResource RegionBrush}"/>
|
||||
<Setter Property="SizeToContent" Value="WidthAndHeight"/>
|
||||
<Setter Property="Effect">
|
||||
<Setter.Value>
|
||||
<DropShadowEffect Opacity=".6" ShadowDepth="0" BlurRadius="15"/>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="controls:PopupWindow">
|
||||
<Border Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid Name="TitleGrid" Height="30" Background="{DynamicResource TitleBrush}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Name="PART_TitleBlock" Background="Transparent" Padding="10,6" Foreground="White" Text="{TemplateBinding Title}" VerticalAlignment="Center" TextWrapping="Wrap" TextTrimming="WordEllipsis"/>
|
||||
<Button Margin="0,0,1,0" Background="Transparent" Name="CloseButton" Foreground="White" Grid.Column="1" controls:BackgroundSwitchElement.MouseHoverBackground="Red" controls:BackgroundSwitchElement.MouseDownBackground="Red" Command="interactivity:ControlCommands.Close" IsCancel="True" Height="28" Style="{StaticResource ButtonCustom}" Width="44" Padding="9">
|
||||
<Path Fill="{Binding ElementName=CloseButton,Path=Foreground}" Style="{StaticResource ClosePathStyle}"/>
|
||||
</Button>
|
||||
</Grid>
|
||||
<Border BorderBrush="{DynamicResource TitleBrush}" Name="PART_MainBorder" Grid.Row="1">
|
||||
<StackPanel>
|
||||
<TextBlock Text="{TemplateBinding ContentStr}" MinHeight="110" Name="MyTextBlock" TextAlignment="Center" Padding="32" Foreground="{DynamicResource PrimaryTextBrush}" MaxWidth="300" TextWrapping="Wrap" TextTrimming="CharacterEllipsis" Background="{TemplateBinding Background}"/>
|
||||
<StackPanel Margin="0,0,0,32" Orientation="Horizontal" Background="{DynamicResource RegionBrush}" HorizontalAlignment="Center">
|
||||
<Button IsCancel="True" MinWidth="80" Command="interactivity:ControlCommands.Cancel" Content="{x:Static langs:Lang.Cancel}" Visibility="{TemplateBinding ShowCancel,Converter={StaticResource Boolean2VisibilityConverter}}" Margin="0,0,16,0"/>
|
||||
<Button IsDefault="True" MinWidth="80" Command="interactivity:ControlCommands.Confirm" Content="{x:Static langs:Lang.Confirm}" Style="{StaticResource ButtonPrimary}"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</Grid>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="ShowBorder" Value="True">
|
||||
<Setter Property="BorderThickness" Value="1,0,1,1" TargetName="PART_MainBorder"/>
|
||||
</Trigger>
|
||||
<Trigger Property="ShowTitle" Value="False">
|
||||
<Setter Property="Visibility" Value="Collapsed" TargetName="TitleGrid"/>
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
</ResourceDictionary>
|
||||
@@ -2,7 +2,7 @@
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:controls="clr-namespace:HandyControl.Controls">
|
||||
|
||||
<Style x:Key="TextBoxBaseBaseStyle" TargetType="{x:Type TextBoxBase}">
|
||||
<Style x:Key="TextBoxBaseBaseStyle" TargetType="TextBoxBase">
|
||||
<Setter Property="Background" Value="{DynamicResource RegionBrush}"/>
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource BorderBrush}"/>
|
||||
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}"/>
|
||||
@@ -20,7 +20,7 @@
|
||||
<Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type TextBoxBase}">
|
||||
<ControlTemplate TargetType="TextBoxBase">
|
||||
<Border x:Name="border" CornerRadius="{Binding Path=(controls:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
|
||||
<ScrollViewer x:Name="PART_ContentHost" Padding="{TemplateBinding Padding}" Focusable="false" HorizontalScrollBarVisibility="{Binding Path=(ScrollViewer.HorizontalScrollBarVisibility),RelativeSource={RelativeSource TemplatedParent}}" VerticalScrollBarVisibility="{Binding Path=(ScrollViewer.VerticalScrollBarVisibility),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
</Border>
|
||||
|
||||
@@ -504,7 +504,7 @@
|
||||
|
||||
<ControlTemplate x:Key="TipSliderThumbHorizontalTop" TargetType="Thumb">
|
||||
<controls:InternalCanvas>
|
||||
<Label Name="LabelValue" Opacity="0" Canvas.Bottom="28" Style="{StaticResource LabelPrimary}" Content="{Binding Value,RelativeSource={RelativeSource FindAncestor,AncestorType=Slider}}"/>
|
||||
<Label Name="LabelValue" Opacity="0" Canvas.Bottom="28" Style="{StaticResource LabelPrimary}" Content="{Binding Value,RelativeSource={RelativeSource AncestorType=Slider}}"/>
|
||||
<Border Canvas.Bottom="0" Effect="{StaticResource EffectShadow1}" Name="BorderDot" BorderThickness="0" BorderBrush="{DynamicResource PrimaryBrush}" Width="18" Height="18" Background="White" CornerRadius="9"/>
|
||||
</controls:InternalCanvas>
|
||||
<ControlTemplate.Triggers>
|
||||
@@ -535,7 +535,7 @@
|
||||
|
||||
<ControlTemplate x:Key="TipSliderThumbHorizontalBottom" TargetType="Thumb">
|
||||
<controls:InternalCanvas>
|
||||
<Label Name="LabelValue" Opacity="0" Canvas.Top="28" Style="{StaticResource LabelPrimary}" Content="{Binding Value,RelativeSource={RelativeSource FindAncestor,AncestorType=Slider}}"/>
|
||||
<Label Name="LabelValue" Opacity="0" Canvas.Top="28" Style="{StaticResource LabelPrimary}" Content="{Binding Value,RelativeSource={RelativeSource AncestorType=Slider}}"/>
|
||||
<Border Canvas.Bottom="0" Effect="{StaticResource EffectShadow1}" Name="BorderDot" BorderThickness="0" BorderBrush="{DynamicResource PrimaryBrush}" Width="18" Height="18" Background="White" CornerRadius="9"/>
|
||||
</controls:InternalCanvas>
|
||||
<ControlTemplate.Triggers>
|
||||
@@ -566,7 +566,7 @@
|
||||
|
||||
<ControlTemplate x:Key="TipSliderThumbVerticalLeft" TargetType="Thumb">
|
||||
<controls:InternalCanvas Orientation="Vertical">
|
||||
<Label Name="LabelValue" Opacity="0" Canvas.Right="28" Style="{StaticResource LabelPrimary}" Content="{Binding Value,RelativeSource={RelativeSource FindAncestor,AncestorType=Slider}}"/>
|
||||
<Label Name="LabelValue" Opacity="0" Canvas.Right="28" Style="{StaticResource LabelPrimary}" Content="{Binding Value,RelativeSource={RelativeSource AncestorType=Slider}}"/>
|
||||
<Border Canvas.Right="0" Effect="{StaticResource EffectShadow1}" Name="BorderDot" BorderThickness="0" BorderBrush="{DynamicResource PrimaryBrush}" Width="18" Height="18" Background="White" CornerRadius="9"/>
|
||||
</controls:InternalCanvas>
|
||||
<ControlTemplate.Triggers>
|
||||
@@ -597,7 +597,7 @@
|
||||
|
||||
<ControlTemplate x:Key="TipSliderThumbVerticalRight" TargetType="Thumb">
|
||||
<controls:InternalCanvas Orientation="Vertical">
|
||||
<Label Name="LabelValue" Opacity="0" Canvas.Left="28" Style="{StaticResource LabelPrimary}" Content="{Binding Value,RelativeSource={RelativeSource FindAncestor,AncestorType=Slider}}"/>
|
||||
<Label Name="LabelValue" Opacity="0" Canvas.Left="28" Style="{StaticResource LabelPrimary}" Content="{Binding Value,RelativeSource={RelativeSource AncestorType=Slider}}"/>
|
||||
<Border Canvas.Right="0" Effect="{StaticResource EffectShadow1}" Name="BorderDot" BorderThickness="0" BorderBrush="{DynamicResource PrimaryBrush}" Width="18" Height="18" Background="White" CornerRadius="9"/>
|
||||
</controls:InternalCanvas>
|
||||
<ControlTemplate.Triggers>
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="Window.xaml"/>
|
||||
<ResourceDictionary Source="PopupWindow.xaml"/>
|
||||
<ResourceDictionary Source="MessageBox.xaml"/>
|
||||
<ResourceDictionary Source="Button.xaml"/>
|
||||
<ResourceDictionary Source="ToggleButton.xaml"/>
|
||||
<ResourceDictionary Source="TextBlock.xaml"/>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<Setter Property="HeaderTemplate">
|
||||
<Setter.Value>
|
||||
<DataTemplate>
|
||||
<TextBlock Background="Transparent" Text="{Binding Header,RelativeSource={RelativeSource FindAncestor,AncestorType=controls:TabItem}}"/>
|
||||
<TextBlock Background="Transparent" Text="{Binding Header,RelativeSource={RelativeSource AncestorType=controls:TabItem}}"/>
|
||||
</DataTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
@@ -56,7 +56,7 @@
|
||||
</LinearGradientBrush>
|
||||
</ContentPresenter.OpacityMask>
|
||||
</ContentPresenter>
|
||||
<Button Grid.Column="1" Command="interactivity:ControlCommands.Close" Visibility="{Binding ShowCloseButton,RelativeSource={RelativeSource FindAncestor,AncestorType=controls:TabControl},Converter={StaticResource Boolean2VisibilityConverter}}" Background="Transparent" Style="{StaticResource ButtonCustom}" Width="28">
|
||||
<Button Grid.Column="1" Command="interactivity:ControlCommands.Close" Visibility="{Binding ShowCloseButton,RelativeSource={RelativeSource AncestorType=controls:TabControl},Converter={StaticResource Boolean2VisibilityConverter}}" Background="Transparent" Style="{StaticResource ButtonCustom}" Width="28">
|
||||
<Path Fill="{DynamicResource PrimaryTextBrush}" Width="8" Height="8" Style="{StaticResource ClosePathStyle}"/>
|
||||
</Button>
|
||||
</Grid>
|
||||
|
||||
@@ -1,17 +1,13 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:controls="clr-namespace:HandyControl.Controls"
|
||||
xmlns:langs="clr-namespace:HandyControl.Properties.Langs"
|
||||
xmlns:interactivity="clr-namespace:HandyControl.Interactivity"
|
||||
xmlns:shell="http://schemas.microsoft.com/winfx/2006/xaml/presentation/shell">
|
||||
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="Button.xaml"/>
|
||||
<ResourceDictionary Source="TextBlock.xaml"/>
|
||||
<ResourceDictionary Source="Border.xaml"/>
|
||||
<ResourceDictionary Source="ToggleButton.xaml"/>
|
||||
<ResourceDictionary Source="../Basic/Converters.xaml"/>
|
||||
<ResourceDictionary Source="../Basic/Paths.xaml"/>
|
||||
<ResourceDictionary Source="../Basic/Geometries.xaml"/>
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
|
||||
<Style x:Key="WindowDefault" BasedOn="{x:Null}" TargetType="Window">
|
||||
@@ -40,16 +36,16 @@
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid Visibility="{TemplateBinding IsFullScreen,Converter={StaticResource Boolean2VisibilityReConverter}}" Background="{TemplateBinding NonClientAreaBackground}" Name="GridMenu" TextElement.Foreground="{TemplateBinding NonClientAreaForeground}">
|
||||
<Grid Background="{TemplateBinding NonClientAreaBackground}" Name="PART_NonClientArea" TextElement.Foreground="{TemplateBinding NonClientAreaForeground}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel shell:WindowChrome.IsHitTestVisibleInChrome="True" UseLayoutRounding="True" VerticalAlignment="Top" Grid.Column="1" HorizontalAlignment="Right" Orientation="Horizontal">
|
||||
<Button Background="{TemplateBinding OtherButtonBackground}" Foreground="{TemplateBinding OtherButtonForeground}" Command="shell:SystemCommands.MinimizeWindowCommand" IsTabStop="False" shell:WindowChrome.IsHitTestVisibleInChrome="True" Name="ButtonMin" Height="29" Style="{StaticResource ButtonIcon}" Width="45" controls:IconElement.Geometry="{StaticResource WindowMinGeometry}" BorderThickness="1,0,1,0" controls:IconElement.Width="10" controls:IconElement.Height="10"/>
|
||||
<Button Background="{TemplateBinding OtherButtonBackground}" Foreground="{TemplateBinding OtherButtonForeground}" Command="shell:SystemCommands.MaximizeWindowCommand" IsTabStop="False" shell:WindowChrome.IsHitTestVisibleInChrome="True" Name="ButtonMax" Height="29" Style="{StaticResource ButtonIcon}" Width="46" controls:IconElement.Geometry="{StaticResource WindowMaxGeometry}" BorderThickness="1,0,1,0" controls:IconElement.Width="10" controls:IconElement.Height="10"/>
|
||||
<Button Background="{TemplateBinding OtherButtonBackground}" Foreground="{TemplateBinding OtherButtonForeground}" Command="shell:SystemCommands.RestoreWindowCommand" IsTabStop="False" shell:WindowChrome.IsHitTestVisibleInChrome="True" Name="ButtonRestore" Height="29" Style="{StaticResource ButtonIcon}" Width="46" controls:IconElement.Geometry="{StaticResource WindowRestoreGeometry}" BorderThickness="1,0,1,0" controls:IconElement.Width="10" controls:IconElement.Height="10"/>
|
||||
<Button Background="{TemplateBinding CloseButtonBackground}" Foreground="{TemplateBinding CloseButtonForeground}" Command="shell:SystemCommands.CloseWindowCommand" IsTabStop="False" shell:WindowChrome.IsHitTestVisibleInChrome="True" Name="ButtonClose" Height="29" Style="{StaticResource ButtonIcon}" Width="46" controls:IconElement.Geometry="{StaticResource CloseGeometry}" BorderThickness="1,0,0,0" controls:IconElement.Width="10" controls:IconElement.Height="10"/>
|
||||
<Button Background="{TemplateBinding OtherButtonBackground}" Foreground="{TemplateBinding OtherButtonForeground}" Command="shell:SystemCommands.MinimizeWindowCommand" IsTabStop="False" Name="ButtonMin" Height="29" Style="{StaticResource ButtonIcon}" Width="45" controls:IconElement.Geometry="{StaticResource WindowMinGeometry}" BorderThickness="1,0,1,0" controls:IconElement.Width="10" controls:IconElement.Height="10"/>
|
||||
<Button Background="{TemplateBinding OtherButtonBackground}" Foreground="{TemplateBinding OtherButtonForeground}" Command="shell:SystemCommands.MaximizeWindowCommand" IsTabStop="False" Name="ButtonMax" Height="29" Style="{StaticResource ButtonIcon}" Width="46" controls:IconElement.Geometry="{StaticResource WindowMaxGeometry}" BorderThickness="1,0,1,0" controls:IconElement.Width="10" controls:IconElement.Height="10"/>
|
||||
<Button Background="{TemplateBinding OtherButtonBackground}" Foreground="{TemplateBinding OtherButtonForeground}" Command="shell:SystemCommands.RestoreWindowCommand" IsTabStop="False" Name="ButtonRestore" Height="29" Style="{StaticResource ButtonIcon}" Width="46" controls:IconElement.Geometry="{StaticResource WindowRestoreGeometry}" BorderThickness="1,0,1,0" controls:IconElement.Width="10" controls:IconElement.Height="10"/>
|
||||
<Button Background="{TemplateBinding CloseButtonBackground}" Foreground="{TemplateBinding CloseButtonForeground}" Command="shell:SystemCommands.CloseWindowCommand" IsTabStop="False" Name="ButtonClose" Height="29" Style="{StaticResource ButtonIcon}" Width="46" controls:IconElement.Geometry="{StaticResource CloseGeometry}" BorderThickness="1,0,0,0" controls:IconElement.Width="10" controls:IconElement.Height="10"/>
|
||||
</StackPanel>
|
||||
<Grid Grid.Column="0">
|
||||
<Grid.ColumnDefinitions>
|
||||
@@ -107,9 +103,6 @@
|
||||
<Setter Property="Background" TargetName="ButtonMin" Value="{Binding OtherButtonHoverBackground,RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
|
||||
<Setter Property="Foreground" TargetName="ButtonMin" Value="{Binding OtherButtonHoverForeground,RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="ShowNonClientArea" Value="False">
|
||||
<Setter Property="Visibility" Value="Collapsed" TargetName="GridMenu"/>
|
||||
</Trigger>
|
||||
<Trigger Property="ShowTitle" Value="False">
|
||||
<Setter Property="Visibility" Value="Collapsed" TargetName="Title"/>
|
||||
</Trigger>
|
||||
@@ -124,81 +117,12 @@
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsFullScreen" Value="True">
|
||||
<Setter Property="shell:WindowChrome.WindowChrome">
|
||||
<Setter.Value>
|
||||
<shell:WindowChrome CornerRadius="0" GlassFrameThickness="1" CaptionHeight="0"/>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="WindowBlur" BasedOn="{StaticResource WindowWin10}" TargetType="controls:BlurWindow">
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="controls:PopupWindow">
|
||||
<Setter Property="WindowStyle" Value="None"/>
|
||||
<Setter Property="MinHeight" Value="220"/>
|
||||
<Setter Property="UseLayoutRounding" Value="True"/>
|
||||
<Setter Property="BorderThickness" Value="20"/>
|
||||
<Setter Property="ShowInTaskbar" Value="False"/>
|
||||
<Setter Property="MinWidth" Value="300"/>
|
||||
<Setter Property="ResizeMode" Value="NoResize"/>
|
||||
<Setter Property="Background" Value="{DynamicResource RegionBrush}"/>
|
||||
<Setter Property="SizeToContent" Value="WidthAndHeight"/>
|
||||
<Setter Property="Effect">
|
||||
<Setter.Value>
|
||||
<DropShadowEffect Opacity=".6" ShadowDepth="0" BlurRadius="15"/>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="controls:PopupWindow">
|
||||
<Border Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid Name="TitleGrid" Height="30" Background="{DynamicResource TitleBrush}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Name="PART_TitleBlock" Background="Transparent" Padding="10,6" Foreground="White" Text="{TemplateBinding Title}" VerticalAlignment="Center" TextWrapping="Wrap" TextTrimming="WordEllipsis"/>
|
||||
<Button Margin="0,0,1,0" Background="Transparent" Name="CloseButton" Foreground="White" Grid.Column="1" controls:BackgroundSwitchElement.MouseHoverBackground="Red" controls:BackgroundSwitchElement.MouseDownBackground="Red" Command="interactivity:ControlCommands.Close" IsCancel="True" Height="28" Style="{StaticResource ButtonCustom}" Width="44" controls:IconElement.Geometry="{StaticResource CloseGeometry}" Padding="9">
|
||||
<Path Fill="{Binding ElementName=CloseButton,Path=Foreground}" Style="{StaticResource ClosePathStyle}"/>
|
||||
</Button>
|
||||
</Grid>
|
||||
<Border BorderBrush="{DynamicResource TitleBrush}" Name="PART_MainBorder" Grid.Row="1">
|
||||
<StackPanel>
|
||||
<TextBlock Text="{TemplateBinding ContentStr}" MinHeight="110" Name="MyTextBlock" TextAlignment="Center" Padding="32" Foreground="{DynamicResource PrimaryTextBrush}" MaxWidth="300" TextWrapping="Wrap" TextTrimming="CharacterEllipsis" Background="{TemplateBinding Background}"/>
|
||||
<StackPanel Margin="0,0,0,32" Orientation="Horizontal" Background="{DynamicResource RegionBrush}" HorizontalAlignment="Center">
|
||||
<Button IsCancel="True" MinWidth="80" Command="interactivity:ControlCommands.Cancel" Content="{x:Static langs:Lang.Cancel}" Visibility="{TemplateBinding ShowCancel,Converter={StaticResource Boolean2VisibilityConverter}}" Margin="0,0,16,0"/>
|
||||
<Button IsDefault="True" MinWidth="80" Command="interactivity:ControlCommands.Confirm" Content="{x:Static langs:Lang.Confirm}" Style="{StaticResource ButtonPrimary}"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</Grid>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="ShowBorder" Value="True">
|
||||
<Setter Property="BorderThickness" Value="1,0,1,1" TargetName="PART_MainBorder"/>
|
||||
</Trigger>
|
||||
<Trigger Property="ShowTitle" Value="False">
|
||||
<Setter Property="Visibility" Value="Collapsed" TargetName="TitleGrid"/>
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="controls:ImageBrowser">
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="MinWidth" Value="400"/>
|
||||
|
||||
@@ -1,16 +1,12 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:controls="clr-namespace:HandyControl.Controls"
|
||||
xmlns:langs="clr-namespace:HandyControl.Properties.Langs"
|
||||
xmlns:interactivity="clr-namespace:HandyControl.Interactivity">
|
||||
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="Button.xaml"/>
|
||||
<ResourceDictionary Source="TextBlock.xaml"/>
|
||||
<ResourceDictionary Source="Border.xaml"/>
|
||||
<ResourceDictionary Source="ToggleButton.xaml"/>
|
||||
<ResourceDictionary Source="../Basic/Converters.xaml"/>
|
||||
<ResourceDictionary Source="../Basic/Paths.xaml"/>
|
||||
<ResourceDictionary Source="../Basic/Geometries.xaml"/>
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
|
||||
<Style x:Key="WindowDefault" BasedOn="{x:Null}" TargetType="Window">
|
||||
@@ -39,16 +35,16 @@
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid Visibility="{TemplateBinding IsFullScreen,Converter={StaticResource Boolean2VisibilityReConverter}}" Background="{TemplateBinding NonClientAreaBackground}" Name="GridMenu" TextElement.Foreground="{TemplateBinding NonClientAreaForeground}">
|
||||
<Grid Background="{TemplateBinding NonClientAreaBackground}" Name="PART_NonClientArea" TextElement.Foreground="{TemplateBinding NonClientAreaForeground}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel WindowChrome.IsHitTestVisibleInChrome="True" UseLayoutRounding="True" VerticalAlignment="Top" Grid.Column="1" HorizontalAlignment="Right" Orientation="Horizontal">
|
||||
<Button Background="{TemplateBinding OtherButtonBackground}" Foreground="{TemplateBinding OtherButtonForeground}" Command="SystemCommands.MinimizeWindowCommand" IsTabStop="False" WindowChrome.IsHitTestVisibleInChrome="True" Name="ButtonMin" Height="29" Style="{StaticResource ButtonIcon}" Width="45" controls:IconElement.Geometry="{StaticResource WindowMinGeometry}" BorderThickness="1,0,1,0" controls:IconElement.Width="10" controls:IconElement.Height="10"/>
|
||||
<Button Background="{TemplateBinding OtherButtonBackground}" Foreground="{TemplateBinding OtherButtonForeground}" Command="SystemCommands.MaximizeWindowCommand" IsTabStop="False" WindowChrome.IsHitTestVisibleInChrome="True" Name="ButtonMax" Height="29" Style="{StaticResource ButtonIcon}" Width="46" controls:IconElement.Geometry="{StaticResource WindowMaxGeometry}" BorderThickness="1,0,1,0" controls:IconElement.Width="10" controls:IconElement.Height="10"/>
|
||||
<Button Background="{TemplateBinding OtherButtonBackground}" Foreground="{TemplateBinding OtherButtonForeground}" Command="SystemCommands.RestoreWindowCommand" IsTabStop="False" WindowChrome.IsHitTestVisibleInChrome="True" Name="ButtonRestore" Height="29" Style="{StaticResource ButtonIcon}" Width="46" controls:IconElement.Geometry="{StaticResource WindowRestoreGeometry}" BorderThickness="1,0,1,0" controls:IconElement.Width="10" controls:IconElement.Height="10"/>
|
||||
<Button Background="{TemplateBinding CloseButtonBackground}" Foreground="{TemplateBinding CloseButtonForeground}" Command="SystemCommands.CloseWindowCommand" IsTabStop="False" WindowChrome.IsHitTestVisibleInChrome="True" Name="ButtonClose" Height="29" Style="{StaticResource ButtonIcon}" Width="46" controls:IconElement.Geometry="{StaticResource CloseGeometry}" BorderThickness="1,0,0,0" controls:IconElement.Width="10" controls:IconElement.Height="10"/>
|
||||
<Button Background="{TemplateBinding OtherButtonBackground}" Foreground="{TemplateBinding OtherButtonForeground}" Command="SystemCommands.MinimizeWindowCommand" IsTabStop="False" Name="ButtonMin" Height="29" Style="{StaticResource ButtonIcon}" Width="45" controls:IconElement.Geometry="{StaticResource WindowMinGeometry}" BorderThickness="1,0,1,0" controls:IconElement.Width="10" controls:IconElement.Height="10"/>
|
||||
<Button Background="{TemplateBinding OtherButtonBackground}" Foreground="{TemplateBinding OtherButtonForeground}" Command="SystemCommands.MaximizeWindowCommand" IsTabStop="False" Name="ButtonMax" Height="29" Style="{StaticResource ButtonIcon}" Width="46" controls:IconElement.Geometry="{StaticResource WindowMaxGeometry}" BorderThickness="1,0,1,0" controls:IconElement.Width="10" controls:IconElement.Height="10"/>
|
||||
<Button Background="{TemplateBinding OtherButtonBackground}" Foreground="{TemplateBinding OtherButtonForeground}" Command="SystemCommands.RestoreWindowCommand" IsTabStop="False" Name="ButtonRestore" Height="29" Style="{StaticResource ButtonIcon}" Width="46" controls:IconElement.Geometry="{StaticResource WindowRestoreGeometry}" BorderThickness="1,0,1,0" controls:IconElement.Width="10" controls:IconElement.Height="10"/>
|
||||
<Button Background="{TemplateBinding CloseButtonBackground}" Foreground="{TemplateBinding CloseButtonForeground}" Command="SystemCommands.CloseWindowCommand" IsTabStop="False" Name="ButtonClose" Height="29" Style="{StaticResource ButtonIcon}" Width="46" controls:IconElement.Geometry="{StaticResource CloseGeometry}" BorderThickness="1,0,0,0" controls:IconElement.Width="10" controls:IconElement.Height="10"/>
|
||||
</StackPanel>
|
||||
<Grid Grid.Column="0">
|
||||
<Grid.ColumnDefinitions>
|
||||
@@ -106,9 +102,6 @@
|
||||
<Setter Property="Background" TargetName="ButtonMin" Value="{Binding OtherButtonHoverBackground,RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
|
||||
<Setter Property="Foreground" TargetName="ButtonMin" Value="{Binding OtherButtonHoverForeground,RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="ShowNonClientArea" Value="False">
|
||||
<Setter Property="Visibility" Value="Collapsed" TargetName="GridMenu"/>
|
||||
</Trigger>
|
||||
<Trigger Property="ShowTitle" Value="False">
|
||||
<Setter Property="Visibility" Value="Collapsed" TargetName="Title"/>
|
||||
</Trigger>
|
||||
@@ -123,81 +116,12 @@
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsFullScreen" Value="True">
|
||||
<Setter Property="WindowChrome.WindowChrome">
|
||||
<Setter.Value>
|
||||
<WindowChrome CornerRadius="0" GlassFrameThickness="1" CaptionHeight="0"/>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="WindowBlur" BasedOn="{StaticResource WindowWin10}" TargetType="controls:BlurWindow">
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="controls:PopupWindow">
|
||||
<Setter Property="WindowStyle" Value="None"/>
|
||||
<Setter Property="MinHeight" Value="220"/>
|
||||
<Setter Property="UseLayoutRounding" Value="True"/>
|
||||
<Setter Property="BorderThickness" Value="20"/>
|
||||
<Setter Property="ShowInTaskbar" Value="False"/>
|
||||
<Setter Property="MinWidth" Value="300"/>
|
||||
<Setter Property="ResizeMode" Value="NoResize"/>
|
||||
<Setter Property="Background" Value="{DynamicResource RegionBrush}"/>
|
||||
<Setter Property="SizeToContent" Value="WidthAndHeight"/>
|
||||
<Setter Property="Effect">
|
||||
<Setter.Value>
|
||||
<DropShadowEffect Opacity=".6" ShadowDepth="0" BlurRadius="15"/>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="controls:PopupWindow">
|
||||
<Border Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid Name="TitleGrid" Height="30" Background="{DynamicResource TitleBrush}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Name="PART_TitleBlock" Background="Transparent" Padding="10,6" Foreground="White" Text="{TemplateBinding Title}" VerticalAlignment="Center" TextWrapping="Wrap" TextTrimming="WordEllipsis"/>
|
||||
<Button Margin="0,0,1,0" Background="Transparent" Name="CloseButton" Foreground="White" Grid.Column="1" controls:BackgroundSwitchElement.MouseHoverBackground="Red" controls:BackgroundSwitchElement.MouseDownBackground="Red" Command="interactivity:ControlCommands.Close" IsCancel="True" Height="28" Style="{StaticResource ButtonCustom}" Width="44" controls:IconElement.Geometry="{StaticResource CloseGeometry}" Padding="9">
|
||||
<Path Fill="{Binding ElementName=CloseButton,Path=Foreground}" Style="{StaticResource ClosePathStyle}"/>
|
||||
</Button>
|
||||
</Grid>
|
||||
<Border BorderBrush="{DynamicResource TitleBrush}" Name="PART_MainBorder" Grid.Row="1">
|
||||
<StackPanel>
|
||||
<TextBlock Text="{TemplateBinding ContentStr}" MinHeight="110" Name="MyTextBlock" TextAlignment="Center" Padding="32" Foreground="{DynamicResource PrimaryTextBrush}" MaxWidth="300" TextWrapping="Wrap" TextTrimming="CharacterEllipsis" Background="{TemplateBinding Background}"/>
|
||||
<StackPanel Margin="0,0,0,32" Orientation="Horizontal" Background="{DynamicResource RegionBrush}" HorizontalAlignment="Center">
|
||||
<Button IsCancel="True" MinWidth="80" Command="interactivity:ControlCommands.Cancel" Content="{x:Static langs:Lang.Cancel}" Visibility="{TemplateBinding ShowCancel,Converter={StaticResource Boolean2VisibilityConverter}}" Margin="0,0,16,0"/>
|
||||
<Button IsDefault="True" MinWidth="80" Command="interactivity:ControlCommands.Confirm" Content="{x:Static langs:Lang.Confirm}" Style="{StaticResource ButtonPrimary}"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</Grid>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="ShowBorder" Value="True">
|
||||
<Setter Property="BorderThickness" Value="1,0,1,1" TargetName="PART_MainBorder"/>
|
||||
</Trigger>
|
||||
<Trigger Property="ShowTitle" Value="False">
|
||||
<Setter Property="Visibility" Value="Collapsed" TargetName="TitleGrid"/>
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="controls:ImageBrowser">
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="MinWidth" Value="400"/>
|
||||
|
||||
@@ -1,16 +1,12 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:controls="clr-namespace:HandyControl.Controls"
|
||||
xmlns:langs="clr-namespace:HandyControl.Properties.Langs"
|
||||
xmlns:interactivity="clr-namespace:HandyControl.Interactivity">
|
||||
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="Button.xaml"/>
|
||||
<ResourceDictionary Source="TextBlock.xaml"/>
|
||||
<ResourceDictionary Source="Border.xaml"/>
|
||||
<ResourceDictionary Source="ToggleButton.xaml"/>
|
||||
<ResourceDictionary Source="../Basic/Converters.xaml"/>
|
||||
<ResourceDictionary Source="../Basic/Paths.xaml"/>
|
||||
<ResourceDictionary Source="../Basic/Geometries.xaml"/>
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
|
||||
<Style x:Key="WindowDefault" BasedOn="{x:Null}" TargetType="Window">
|
||||
@@ -39,16 +35,16 @@
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid Visibility="{TemplateBinding IsFullScreen,Converter={StaticResource Boolean2VisibilityReConverter}}" Background="{TemplateBinding NonClientAreaBackground}" Name="GridMenu" TextElement.Foreground="{TemplateBinding NonClientAreaForeground}">
|
||||
<Grid Background="{TemplateBinding NonClientAreaBackground}" Name="PART_NonClientArea" TextElement.Foreground="{TemplateBinding NonClientAreaForeground}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel WindowChrome.IsHitTestVisibleInChrome="True" UseLayoutRounding="True" VerticalAlignment="Top" Grid.Column="1" HorizontalAlignment="Right" Orientation="Horizontal">
|
||||
<Button Background="{TemplateBinding OtherButtonBackground}" Foreground="{TemplateBinding OtherButtonForeground}" Command="SystemCommands.MinimizeWindowCommand" IsTabStop="False" WindowChrome.IsHitTestVisibleInChrome="True" Name="ButtonMin" Height="29" Style="{StaticResource ButtonIcon}" Width="45" controls:IconElement.Geometry="{StaticResource WindowMinGeometry}" BorderThickness="1,0,1,0" controls:IconElement.Width="10" controls:IconElement.Height="10"/>
|
||||
<Button Background="{TemplateBinding OtherButtonBackground}" Foreground="{TemplateBinding OtherButtonForeground}" Command="SystemCommands.MaximizeWindowCommand" IsTabStop="False" WindowChrome.IsHitTestVisibleInChrome="True" Name="ButtonMax" Height="29" Style="{StaticResource ButtonIcon}" Width="46" controls:IconElement.Geometry="{StaticResource WindowMaxGeometry}" BorderThickness="1,0,1,0" controls:IconElement.Width="10" controls:IconElement.Height="10"/>
|
||||
<Button Background="{TemplateBinding OtherButtonBackground}" Foreground="{TemplateBinding OtherButtonForeground}" Command="SystemCommands.RestoreWindowCommand" IsTabStop="False" WindowChrome.IsHitTestVisibleInChrome="True" Name="ButtonRestore" Height="29" Style="{StaticResource ButtonIcon}" Width="46" controls:IconElement.Geometry="{StaticResource WindowRestoreGeometry}" BorderThickness="1,0,1,0" controls:IconElement.Width="10" controls:IconElement.Height="10"/>
|
||||
<Button Background="{TemplateBinding CloseButtonBackground}" Foreground="{TemplateBinding CloseButtonForeground}" Command="SystemCommands.CloseWindowCommand" IsTabStop="False" WindowChrome.IsHitTestVisibleInChrome="True" Name="ButtonClose" Height="29" Style="{StaticResource ButtonIcon}" Width="46" controls:IconElement.Geometry="{StaticResource CloseGeometry}" BorderThickness="1,0,0,0" controls:IconElement.Width="10" controls:IconElement.Height="10"/>
|
||||
<Button Background="{TemplateBinding OtherButtonBackground}" Foreground="{TemplateBinding OtherButtonForeground}" Command="SystemCommands.MinimizeWindowCommand" IsTabStop="False" Name="ButtonMin" Height="29" Style="{StaticResource ButtonIcon}" Width="45" controls:IconElement.Geometry="{StaticResource WindowMinGeometry}" BorderThickness="1,0,1,0" controls:IconElement.Width="10" controls:IconElement.Height="10"/>
|
||||
<Button Background="{TemplateBinding OtherButtonBackground}" Foreground="{TemplateBinding OtherButtonForeground}" Command="SystemCommands.MaximizeWindowCommand" IsTabStop="False" Name="ButtonMax" Height="29" Style="{StaticResource ButtonIcon}" Width="46" controls:IconElement.Geometry="{StaticResource WindowMaxGeometry}" BorderThickness="1,0,1,0" controls:IconElement.Width="10" controls:IconElement.Height="10"/>
|
||||
<Button Background="{TemplateBinding OtherButtonBackground}" Foreground="{TemplateBinding OtherButtonForeground}" Command="SystemCommands.RestoreWindowCommand" IsTabStop="False" Name="ButtonRestore" Height="29" Style="{StaticResource ButtonIcon}" Width="46" controls:IconElement.Geometry="{StaticResource WindowRestoreGeometry}" BorderThickness="1,0,1,0" controls:IconElement.Width="10" controls:IconElement.Height="10"/>
|
||||
<Button Background="{TemplateBinding CloseButtonBackground}" Foreground="{TemplateBinding CloseButtonForeground}" Command="SystemCommands.CloseWindowCommand" IsTabStop="False" Name="ButtonClose" Height="29" Style="{StaticResource ButtonIcon}" Width="46" controls:IconElement.Geometry="{StaticResource CloseGeometry}" BorderThickness="1,0,0,0" controls:IconElement.Width="10" controls:IconElement.Height="10"/>
|
||||
</StackPanel>
|
||||
<Grid Grid.Column="0">
|
||||
<Grid.ColumnDefinitions>
|
||||
@@ -106,9 +102,6 @@
|
||||
<Setter Property="Background" TargetName="ButtonMin" Value="{Binding OtherButtonHoverBackground,RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
|
||||
<Setter Property="Foreground" TargetName="ButtonMin" Value="{Binding OtherButtonHoverForeground,RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="ShowNonClientArea" Value="False">
|
||||
<Setter Property="Visibility" Value="Collapsed" TargetName="GridMenu"/>
|
||||
</Trigger>
|
||||
<Trigger Property="ShowTitle" Value="False">
|
||||
<Setter Property="Visibility" Value="Collapsed" TargetName="Title"/>
|
||||
</Trigger>
|
||||
@@ -123,81 +116,12 @@
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsFullScreen" Value="True">
|
||||
<Setter Property="WindowChrome.WindowChrome">
|
||||
<Setter.Value>
|
||||
<WindowChrome CornerRadius="0" GlassFrameThickness="1" CaptionHeight="0"/>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="WindowBlur" BasedOn="{StaticResource WindowWin10}" TargetType="controls:BlurWindow">
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="controls:PopupWindow">
|
||||
<Setter Property="WindowStyle" Value="None"/>
|
||||
<Setter Property="MinHeight" Value="220"/>
|
||||
<Setter Property="UseLayoutRounding" Value="True"/>
|
||||
<Setter Property="BorderThickness" Value="20"/>
|
||||
<Setter Property="ShowInTaskbar" Value="False"/>
|
||||
<Setter Property="MinWidth" Value="300"/>
|
||||
<Setter Property="ResizeMode" Value="NoResize"/>
|
||||
<Setter Property="Background" Value="{DynamicResource RegionBrush}"/>
|
||||
<Setter Property="SizeToContent" Value="WidthAndHeight"/>
|
||||
<Setter Property="Effect">
|
||||
<Setter.Value>
|
||||
<DropShadowEffect Opacity=".6" ShadowDepth="0" BlurRadius="15"/>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="controls:PopupWindow">
|
||||
<Border Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid Name="TitleGrid" Height="30" Background="{DynamicResource TitleBrush}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Name="PART_TitleBlock" Background="Transparent" Padding="10,6" Foreground="White" Text="{TemplateBinding Title}" VerticalAlignment="Center" TextWrapping="Wrap" TextTrimming="WordEllipsis"/>
|
||||
<Button Margin="0,0,1,0" Background="Transparent" Name="CloseButton" Foreground="White" Grid.Column="1" controls:BackgroundSwitchElement.MouseHoverBackground="Red" controls:BackgroundSwitchElement.MouseDownBackground="Red" Command="interactivity:ControlCommands.Close" IsCancel="True" Height="28" Style="{StaticResource ButtonCustom}" Width="44" controls:IconElement.Geometry="{StaticResource CloseGeometry}" Padding="9">
|
||||
<Path Fill="{Binding ElementName=CloseButton,Path=Foreground}" Style="{StaticResource ClosePathStyle}"/>
|
||||
</Button>
|
||||
</Grid>
|
||||
<Border BorderBrush="{DynamicResource TitleBrush}" Name="PART_MainBorder" Grid.Row="1">
|
||||
<StackPanel>
|
||||
<TextBlock Text="{TemplateBinding ContentStr}" MinHeight="110" Name="MyTextBlock" TextAlignment="Center" Padding="32" Foreground="{DynamicResource PrimaryTextBrush}" MaxWidth="300" TextWrapping="Wrap" TextTrimming="CharacterEllipsis" Background="{TemplateBinding Background}"/>
|
||||
<StackPanel Margin="0,0,0,32" Orientation="Horizontal" Background="{DynamicResource RegionBrush}" HorizontalAlignment="Center">
|
||||
<Button IsCancel="True" MinWidth="80" Command="interactivity:ControlCommands.Cancel" Content="{x:Static langs:Lang.Cancel}" Visibility="{TemplateBinding ShowCancel,Converter={StaticResource Boolean2VisibilityConverter}}" Margin="0,0,16,0"/>
|
||||
<Button IsDefault="True" MinWidth="80" Command="interactivity:ControlCommands.Confirm" Content="{x:Static langs:Lang.Confirm}" Style="{StaticResource ButtonPrimary}"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</Grid>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="ShowBorder" Value="True">
|
||||
<Setter Property="BorderThickness" Value="1,0,1,1" TargetName="PART_MainBorder"/>
|
||||
</Trigger>
|
||||
<Trigger Property="ShowTitle" Value="False">
|
||||
<Setter Property="Visibility" Value="Collapsed" TargetName="TitleGrid"/>
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="controls:ImageBrowser">
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="MinWidth" Value="400"/>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// ReSharper disable once CheckNamespace
|
||||
|
||||
namespace HandyControlDemo.Data
|
||||
{
|
||||
public enum DemoType
|
||||
|
||||
@@ -64,6 +64,8 @@
|
||||
|
||||
public static readonly string BlurWindow = nameof(BlurWindow);
|
||||
|
||||
public static readonly string NoNonClientAreaDragableWindow = nameof(NoNonClientAreaDragableWindow);
|
||||
|
||||
public static readonly string RateDemoCtl = nameof(RateDemoCtl);
|
||||
|
||||
public static readonly string ShieldDemoCtl = nameof(ShieldDemoCtl);
|
||||
|
||||
@@ -35,6 +35,7 @@ var controlList = new List<string>
|
||||
"FlipClockDemoCtl",
|
||||
"QQGroupView",
|
||||
"BlurWindow",
|
||||
"NoNonClientAreaDragableWindow",
|
||||
"RateDemoCtl",
|
||||
"ShieldDemoCtl",
|
||||
"WaterfallPanelDemoCtl",
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// ReSharper disable once CheckNamespace
|
||||
|
||||
namespace HandyControlDemo.Data
|
||||
{
|
||||
public class ContributorModel
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
// ReSharper disable once CheckNamespace
|
||||
|
||||
namespace HandyControlDemo.Data
|
||||
{
|
||||
public class DemoDataModel
|
||||
|
||||
@@ -328,6 +328,9 @@
|
||||
<Compile Include="Window\CustomNonClientAreaWindow.xaml.cs">
|
||||
<DependentUpon>CustomNonClientAreaWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Window\NoNonClientAreaDragableWindow.xaml.cs">
|
||||
<DependentUpon>NoNonClientAreaDragableWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Page Include="MainWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
@@ -664,6 +667,10 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Window\NoNonClientAreaDragableWindow.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Properties\AssemblyInfo.cs">
|
||||
|
||||
@@ -12,4 +12,4 @@ using System.Windows;
|
||||
[assembly: AssemblyCulture("")]
|
||||
[assembly: ComVisible(false)]
|
||||
[assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)]
|
||||
[assembly: AssemblyVersion("1.5.1.*")]
|
||||
[assembly: AssemblyVersion("1.5.2.*")]
|
||||
+27
@@ -366,6 +366,15 @@ namespace HandyControlDemo.Properties.Langs {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 在这里拖拽 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string DragHere {
|
||||
get {
|
||||
return ResourceManager.GetString("DragHere", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 邮箱 的本地化字符串。
|
||||
/// </summary>
|
||||
@@ -582,6 +591,15 @@ namespace HandyControlDemo.Properties.Langs {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 消息框 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string MessageBox {
|
||||
get {
|
||||
return ResourceManager.GetString("MessageBox", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 名称 的本地化字符串。
|
||||
/// </summary>
|
||||
@@ -672,6 +690,15 @@ namespace HandyControlDemo.Properties.Langs {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 打开无非客户端区域可拖拽窗口 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string OpenNoNonClientAreaDragableWindow {
|
||||
get {
|
||||
return ResourceManager.GetString("OpenNoNonClientAreaDragableWindow", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 轮廓文本 的本地化字符串。
|
||||
/// </summary>
|
||||
|
||||
@@ -464,5 +464,13 @@
|
||||
</data>
|
||||
<data name="PlsEnterKey" xml:space="preserve">
|
||||
<value>Please input a keyword</value>
|
||||
<data name="OpenNoNonClientAreaDragableWindow" xml:space="preserve">
|
||||
<value>open no Non-client Area dragable window</value>
|
||||
</data>
|
||||
<data name="DragHere" xml:space="preserve">
|
||||
<value>Drag here</value>
|
||||
</data>
|
||||
<data name="MessageBox" xml:space="preserve">
|
||||
<value>MessageBox</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -1,76 +1,96 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
Version 1.3
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">1.3</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1">this is my long string</data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
[base64 mime encoded serialized .NET Framework object]
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
[base64 mime encoded string representing a byte array form of the .NET Framework object]
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
@@ -89,13 +109,13 @@
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>1.3</value>
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="Controls" xml:space="preserve">
|
||||
<value>控件</value>
|
||||
@@ -444,5 +464,13 @@
|
||||
</data>
|
||||
<data name="PlsEnterKey" xml:space="preserve">
|
||||
<value>请输入关键字</value>
|
||||
<data name="OpenNoNonClientAreaDragableWindow" xml:space="preserve">
|
||||
<value>打开无非客户端区域可拖拽窗口</value>
|
||||
</data>
|
||||
<data name="DragHere" xml:space="preserve">
|
||||
<value>在这里拖拽</value>
|
||||
</data>
|
||||
<data name="MessageBox" xml:space="preserve">
|
||||
<value>消息框</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -14,8 +14,8 @@
|
||||
<RowDefinition/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Image Source="{Binding Source,RelativeSource={RelativeSource FindAncestor,AncestorType=UserControl}}" Height="120" Width="120" Stretch="Uniform" Margin="10"/>
|
||||
<TextBlock TextTrimming="CharacterEllipsis" TextWrapping="NoWrap" Margin="0,0,0,10" Grid.Row="1" Style="{StaticResource TextBlockDefault}" Text="{Binding UserName,RelativeSource={RelativeSource FindAncestor,AncestorType=UserControl}}"></TextBlock>
|
||||
<Image Source="{Binding Source,RelativeSource={RelativeSource AncestorType=UserControl}}" Height="120" Width="120" Stretch="Uniform" Margin="10"/>
|
||||
<TextBlock TextTrimming="CharacterEllipsis" TextWrapping="NoWrap" Margin="0,0,0,10" Grid.Row="1" Style="{StaticResource TextBlockDefault}" Text="{Binding UserName,RelativeSource={RelativeSource AncestorType=UserControl}}"></TextBlock>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Button>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
using System.Windows;
|
||||
using System.Windows.Media.Imaging;
|
||||
|
||||
// ReSharper disable once CheckNamespace
|
||||
|
||||
namespace HandyControlDemo.UserControl
|
||||
{
|
||||
public partial class Avatar
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// ReSharper disable once CheckNamespace
|
||||
|
||||
namespace HandyControlDemo.UserControl
|
||||
{
|
||||
public partial class AnimationPathDemoCtl
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// ReSharper disable once CheckNamespace
|
||||
|
||||
namespace HandyControlDemo.UserControl
|
||||
{
|
||||
public partial class CarouselDemoCtl
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// ReSharper disable once CheckNamespace
|
||||
|
||||
namespace HandyControlDemo.UserControl
|
||||
{
|
||||
public partial class CircleProgressBarDemoCtl
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// ReSharper disable once CheckNamespace
|
||||
|
||||
namespace HandyControlDemo.UserControl
|
||||
{
|
||||
public partial class ClockDemoCtl
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// ReSharper disable once CheckNamespace
|
||||
|
||||
namespace HandyControlDemo.UserControl
|
||||
{
|
||||
public partial class ColorPickerDemoCtl
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// ReSharper disable once CheckNamespace
|
||||
|
||||
namespace HandyControlDemo.UserControl
|
||||
{
|
||||
public partial class CompareSliderDemoCtl
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// ReSharper disable once CheckNamespace
|
||||
|
||||
namespace HandyControlDemo.UserControl
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// ReSharper disable once CheckNamespace
|
||||
|
||||
namespace HandyControlDemo.UserControl
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// ReSharper disable once CheckNamespace
|
||||
|
||||
namespace HandyControlDemo.UserControl
|
||||
{
|
||||
public partial class LoadingDemoCtl
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using HandyControl.Data;
|
||||
|
||||
// ReSharper disable once CheckNamespace
|
||||
|
||||
namespace HandyControlDemo.UserControl
|
||||
{
|
||||
public partial class NumericUpDownDemoCtl
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
<DataGrid IsReadOnly="True" Width="600" Margin="0,16,0,0" Grid.Row="1" HeadersVisibility="All" RowHeaderWidth="60" AutoGenerateColumns="False" ItemsSource="{Binding DataList}">
|
||||
<DataGrid.RowHeaderTemplate>
|
||||
<DataTemplate>
|
||||
<CheckBox IsChecked="{Binding IsSelected,RelativeSource={RelativeSource FindAncestor,AncestorType=DataGridRow}}"/>
|
||||
<CheckBox IsChecked="{Binding IsSelected,RelativeSource={RelativeSource AncestorType=DataGridRow}}"/>
|
||||
</DataTemplate>
|
||||
</DataGrid.RowHeaderTemplate>
|
||||
<DataGrid.Columns>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// ReSharper disable once CheckNamespace
|
||||
|
||||
namespace HandyControlDemo.UserControl
|
||||
{
|
||||
public partial class PaginationDemoCtl
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// ReSharper disable once CheckNamespace
|
||||
|
||||
namespace HandyControlDemo.UserControl
|
||||
{
|
||||
public partial class PreviewSliderDemoCtl
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// ReSharper disable once CheckNamespace
|
||||
|
||||
namespace HandyControlDemo.UserControl
|
||||
{
|
||||
public partial class ScrollViewerDemoCtl
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// ReSharper disable once CheckNamespace
|
||||
|
||||
namespace HandyControlDemo.UserControl
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// ReSharper disable once CheckNamespace
|
||||
|
||||
namespace HandyControlDemo.UserControl
|
||||
{
|
||||
public partial class TabControlDemoCtl
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// ReSharper disable once CheckNamespace
|
||||
|
||||
namespace HandyControlDemo.UserControl
|
||||
{
|
||||
public partial class TimeBarDemoCtl
|
||||
|
||||
@@ -7,13 +7,14 @@
|
||||
DataContext="{Binding WindowDemo,Source={StaticResource Locator}}"
|
||||
Background="{DynamicResource RegionBrush}">
|
||||
<controls:TransitioningContentControl>
|
||||
<UniformGrid Margin="32" Columns="3" Rows="2" Height="200">
|
||||
<UniformGrid Margin="32" Columns="3" Rows="3" Height="200">
|
||||
<Button Command="{Binding OpenWindowCmd}" CommandParameter="{x:Static data:MessageToken.CommonWindow}" Content="{x:Static langs:Lang.OpenCommonWindow}"/>
|
||||
<Button Command="{Binding OpenWindowCmd}" CommandParameter="{x:Static data:MessageToken.BlurWindow}" Content="{x:Static langs:Lang.OpenBlurWindow}"/>
|
||||
<Button Command="{Binding OpenWindowCmd}" CommandParameter="{x:Static data:MessageToken.CustomNonClientAreaWindow}" Content="{x:Static langs:Lang.OpenCustomNonClientAreaWindow}"/>
|
||||
<Button Click="ButtonMessage_OnClick" Content="{x:Static langs:Lang.OpenMessageWindow}"/>
|
||||
<Button Click="ButtonCustomContent_OnClick" Content="{x:Static langs:Lang.OpenCustomContentWindow}"/>
|
||||
<Button Name="ButtonMouseFollow" Click="ButtonMouseFollow_OnClick" Content="{x:Static langs:Lang.OpenMouseFollowWindow}"/>
|
||||
<Button Command="{Binding OpenWindowCmd}" CommandParameter="{x:Static data:MessageToken.NoNonClientAreaDragableWindow}" Content="{x:Static langs:Lang.OpenNoNonClientAreaDragableWindow}"/>
|
||||
</UniformGrid>
|
||||
</controls:TransitioningContentControl>
|
||||
</UserControl>
|
||||
@@ -1,8 +1,9 @@
|
||||
using System.Windows;
|
||||
using HandyControl.Controls;
|
||||
using HandyControl.Tools;
|
||||
using MessageBox = HandyControl.Controls.MessageBox;
|
||||
|
||||
|
||||
// ReSharper disable once CheckNamespace
|
||||
namespace HandyControlDemo.UserControl
|
||||
{
|
||||
public partial class WindowDemoCtl
|
||||
@@ -14,7 +15,7 @@ namespace HandyControlDemo.UserControl
|
||||
|
||||
private void ButtonMessage_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
PopupWindow.ShowDialog(Properties.Langs.Lang.GrowlAsk, showCancel: true);
|
||||
MessageBox.Show(Properties.Langs.Lang.GrowlAsk, Properties.Langs.Lang.Title, MessageBoxButton.YesNo, MessageBoxImage.Question);
|
||||
}
|
||||
|
||||
private void ButtonMouseFollow_OnClick(object sender, RoutedEventArgs e)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// ReSharper disable once CheckNamespace
|
||||
|
||||
namespace HandyControlDemo.UserControl
|
||||
{
|
||||
public partial class ContributorsView
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
x:Class="HandyControlDemo.UserControl.LeftMainContent"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:data="clr-namespace:HandyControlDemo.Data"
|
||||
Background="{Binding Background,RelativeSource={RelativeSource FindAncestor,AncestorType=Window}}"
|
||||
Background="{Binding Background,RelativeSource={RelativeSource AncestorType=Window}}"
|
||||
xmlns:controls="clr-namespace:HandyControl.Controls;assembly=HandyControl"
|
||||
xmlns:langs="clr-namespace:HandyControlDemo.Properties.Langs"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
|
||||
@@ -352,7 +352,7 @@
|
||||
<Image Source="../../Resources/Img/LeftMainContent/ScrollBox_16x.png"/>
|
||||
</controls:EdgeElement.LeftContent>
|
||||
</ListBoxItem>
|
||||
<ListBoxItem Tag="{x:Static data:MessageToken.WindowDemoCtl}" Content="{x:Static langs:Lang.Window}">
|
||||
<ListBoxItem Style="{StaticResource ListBoxItemNew}" Tag="{x:Static data:MessageToken.WindowDemoCtl}" Content="{x:Static langs:Lang.Window}">
|
||||
<controls:EdgeElement.LeftContent>
|
||||
<Image Source="../../Resources/Img/LeftMainContent/WindowsForm_16x.png"/>
|
||||
</controls:EdgeElement.LeftContent>
|
||||
|
||||
@@ -5,7 +5,7 @@ using System.Windows.Controls;
|
||||
using HandyControl.Data;
|
||||
using HandyControl.Tools.Extension;
|
||||
|
||||
// ReSharper disable once CheckNamespace
|
||||
|
||||
namespace HandyControlDemo.UserControl
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -3,7 +3,7 @@ using GalaSoft.MvvmLight.Messaging;
|
||||
using HandyControl.Tools.Extension;
|
||||
using HandyControlDemo.Data;
|
||||
|
||||
// ReSharper disable once CheckNamespace
|
||||
|
||||
namespace HandyControlDemo.UserControl
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -10,7 +10,7 @@ using HandyControlDemo.Data;
|
||||
using HandyControlDemo.Tools;
|
||||
using HandyControlDemo.Window;
|
||||
|
||||
// ReSharper disable once CheckNamespace
|
||||
|
||||
namespace HandyControlDemo.UserControl
|
||||
{
|
||||
public partial class NoUserContent
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// ReSharper disable once CheckNamespace
|
||||
|
||||
namespace HandyControlDemo.UserControl
|
||||
{
|
||||
public partial class BorderDemoCtl
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// ReSharper disable once CheckNamespace
|
||||
|
||||
namespace HandyControlDemo.UserControl
|
||||
{
|
||||
public partial class BrushDemoCtl
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// ReSharper disable once CheckNamespace
|
||||
|
||||
namespace HandyControlDemo.UserControl
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// ReSharper disable once CheckNamespace
|
||||
|
||||
namespace HandyControlDemo.UserControl
|
||||
{
|
||||
public partial class CalendarDemoCtl
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// ReSharper disable once CheckNamespace
|
||||
|
||||
namespace HandyControlDemo.UserControl
|
||||
{
|
||||
public partial class CheckBoxDemoCtl
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<DataGrid HeadersVisibility="All" RowHeaderWidth="60" AutoGenerateColumns="False" ItemsSource="{Binding DataList}">
|
||||
<DataGrid.RowHeaderTemplate>
|
||||
<DataTemplate>
|
||||
<CheckBox IsChecked="{Binding IsSelected,RelativeSource={RelativeSource FindAncestor,AncestorType=DataGridRow}}"/>
|
||||
<CheckBox IsChecked="{Binding IsSelected,RelativeSource={RelativeSource AncestorType=DataGridRow}}"/>
|
||||
</DataTemplate>
|
||||
</DataGrid.RowHeaderTemplate>
|
||||
<DataGrid.Columns>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// ReSharper disable once CheckNamespace
|
||||
|
||||
namespace HandyControlDemo.UserControl
|
||||
{
|
||||
public partial class DataGridDemoCtl
|
||||
|
||||
Loaded 100 of 114 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user