Merge branch 'master' into pr/28

This commit is contained in:
NaBian authored and GitHub committed 2019-01-17 15:11:33 +08:00
commit 82ba91395a
114 files changed
+1054 -552

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; using System.Windows.Controls;
// ReSharper disable once CheckNamespace
namespace HandyControl.Controls namespace HandyControl.Controls
{ {
/// <summary> /// <summary>
@@ -1,7 +1,7 @@
using System.Windows.Controls; using System.Windows.Controls;
using System.Windows.Controls.Primitives; using System.Windows.Controls.Primitives;
// ReSharper disable once CheckNamespace
namespace HandyControl.Controls namespace HandyControl.Controls
{ {
/// <summary> /// <summary>
+3 -3
View File
@@ -197,7 +197,7 @@ namespace HandyControl.Controls
} }
catch 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) if (Math.Abs(height - 0) < 0.001 || Math.Abs(width - 0) < 0.001)
{ {
PopupWindow.ShowDialog(Lang.ErrorImgSize); MessageBox.Show(Lang.ErrorImgSize);
return; return;
} }
@@ -544,7 +544,7 @@ namespace HandyControl.Controls
} }
catch (Exception exception) catch (Exception exception)
{ {
PopupWindow.ShowDialog(exception.Message); MessageBox.Show(exception.Message);
} }
} }
+1 -1
View File
@@ -1,7 +1,7 @@
using System; using System;
using HandyControl.Data; using HandyControl.Data;
// ReSharper disable once CheckNamespace
namespace HandyControl.Controls namespace HandyControl.Controls
{ {
/// <summary> /// <summary>
+1 -1
View File
@@ -6,7 +6,7 @@ using System.Windows.Media.Animation;
using System.Windows.Shapes; using System.Windows.Shapes;
using HandyControl.Data; using HandyControl.Data;
// ReSharper disable once CheckNamespace
namespace HandyControl.Controls namespace HandyControl.Controls
{ {
public abstract class LoadingBase : ContentControl public abstract class LoadingBase : ContentControl
@@ -5,7 +5,7 @@ using System.Windows.Data;
using System.Windows.Media; using System.Windows.Media;
using System.Windows.Media.Animation; using System.Windows.Media.Animation;
// ReSharper disable once CheckNamespace
namespace HandyControl.Controls namespace HandyControl.Controls
{ {
public class LoadingCircle : LoadingBase public class LoadingCircle : LoadingBase
+1 -1
View File
@@ -4,7 +4,7 @@ using System.Windows.Data;
using System.Windows.Media.Animation; using System.Windows.Media.Animation;
using System.Windows.Shapes; using System.Windows.Shapes;
// ReSharper disable once CheckNamespace
namespace HandyControl.Controls namespace HandyControl.Controls
{ {
public class LoadingLine : LoadingBase public class LoadingLine : LoadingBase
@@ -1,7 +1,7 @@
using System.Windows; using System.Windows;
using System.Windows.Controls; using System.Windows.Controls;
// ReSharper disable once CheckNamespace
namespace HandyControl.Controls namespace HandyControl.Controls
{ {
public class CompareSlider : Slider public class CompareSlider : Slider
@@ -6,7 +6,7 @@ using System.Windows.Input;
using System.Windows.Media; using System.Windows.Media;
using HandyControl.Data; using HandyControl.Data;
// ReSharper disable once CheckNamespace
namespace HandyControl.Controls namespace HandyControl.Controls
{ {
[TemplatePart(Name = PreviewContentKey, Type = typeof(ContentControl))] [TemplatePart(Name = PreviewContentKey, Type = typeof(ContentControl))]
File renamed without changes.
@@ -1,6 +1,6 @@
using System.Windows.Controls; using System.Windows.Controls;
// ReSharper disable once CheckNamespace
namespace HandyControl.Controls namespace HandyControl.Controls
{ {
public class ClockRadioButton : RadioButton public class ClockRadioButton : RadioButton
@@ -1,7 +1,7 @@
using System; using System;
using System.Windows.Controls; using System.Windows.Controls;
// ReSharper disable once CheckNamespace
namespace HandyControl.Controls namespace HandyControl.Controls
{ {
/// <summary> /// <summary>
@@ -8,7 +8,7 @@ using HandyControl.Data;
using HandyControl.Interactivity; using HandyControl.Interactivity;
using HandyControl.Tools; using HandyControl.Tools;
// ReSharper disable once CheckNamespace
namespace HandyControl.Controls namespace HandyControl.Controls
{ {
/// <summary> /// <summary>
+1 -1
View File
@@ -66,7 +66,7 @@ namespace HandyControl.Controls
} }
catch catch
{ {
PopupWindow.ShowDialog(Properties.Langs.Lang.ErrorImgPath); MessageBox.Show(Properties.Langs.Lang.ErrorImgPath);
} }
}; };
} }
+328
View File
@@ -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.Interactivity;
using HandyControl.Tools; using HandyControl.Tools;
// ReSharper disable once CheckNamespace
namespace HandyControl.Controls namespace HandyControl.Controls
{ {
/// <summary> /// <summary>
+210 -131
View File
@@ -6,17 +6,20 @@ using System.Windows.Input;
using System.Windows.Media; using System.Windows.Media;
using HandyControl.Data; using HandyControl.Data;
using HandyControl.Tools; using HandyControl.Tools;
using HandyControl.Tools.Extension;
#if netle40 #if netle40
using Microsoft.Windows.Shell; using Microsoft.Windows.Shell;
#else #else
using System.Windows.Shell; using System.Windows.Shell;
#endif #endif
namespace HandyControl.Controls namespace HandyControl.Controls
{ {
[TemplatePart(Name = ElementNonClientArea, Type = typeof(UIElement))]
public class Window : System.Windows.Window public class Window : System.Windows.Window
{ {
private Thickness _tempThickness; private const string ElementNonClientArea = "PART_NonClientArea";
public static readonly DependencyProperty NonClientAreaContentProperty = DependencyProperty.Register( public static readonly DependencyProperty NonClientAreaContentProperty = DependencyProperty.Register(
"NonClientAreaContent", typeof(object), typeof(Window), new PropertyMetadata(default(object))); "NonClientAreaContent", typeof(object), typeof(Window), new PropertyMetadata(default(object)));
@@ -66,42 +69,38 @@ namespace HandyControl.Controls
new PropertyMetadata(28.0)); new PropertyMetadata(28.0));
public static readonly DependencyProperty ShowNonClientAreaProperty = DependencyProperty.Register( 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( public static readonly DependencyProperty ShowTitleProperty = DependencyProperty.Register(
"ShowTitle", typeof(bool), typeof(Window), new PropertyMetadata(ValueBoxes.FalseBox)); "ShowTitle", typeof(bool), typeof(Window), new PropertyMetadata(ValueBoxes.FalseBox));
public static readonly DependencyProperty IsFullScreenProperty = DependencyProperty.Register( public static readonly DependencyProperty IsFullScreenProperty = DependencyProperty.Register(
"IsFullScreen", typeof(bool), typeof(Window), new PropertyMetadata(ValueBoxes.FalseBox, "IsFullScreen", typeof(bool), typeof(Window),
(o, args) => new PropertyMetadata(ValueBoxes.FalseBox, OnIsFullScreenChanged));
{
var ctl = (Window)o; private bool _isFullScreen;
var v = (bool)args.NewValue;
if (v) private UIElement _nonClientArea;
{
ctl.OriginState = ctl.WindowState; private bool _showNonClientArea = true;
ctl.OriginStyle = ctl.WindowStyle;
ctl.OriginResizeMode = ctl.ResizeMode; private double _tempNonClientAreaHeight;
ctl.WindowStyle = WindowStyle.None;
//下面三行不能改变,就是故意的 private Thickness _tempThickness;
ctl.WindowState = WindowState.Maximized;
ctl.WindowState = WindowState.Minimized; private WindowState _tempWindowState;
ctl.WindowState = WindowState.Maximized;
} private WindowStyle _tempWindowStyle;
else
{ private ResizeMode _tempResizeMode;
ctl.WindowState = ctl.OriginState;
ctl.WindowStyle = ctl.OriginStyle;
ctl.ResizeMode = ctl.OriginResizeMode;
}
}));
public Window() public Window()
{ {
var chrome = new WindowChrome var chrome = new WindowChrome
{ {
CornerRadius = new CornerRadius(), CornerRadius = new CornerRadius(),
GlassFrameThickness = new Thickness(1) GlassFrameThickness = new Thickness(0, 0, 0, 1)
}; };
BindingOperations.SetBinding(chrome, WindowChrome.CaptionHeightProperty, BindingOperations.SetBinding(chrome, WindowChrome.CaptionHeightProperty,
new Binding(NonClientAreaHeightProperty.Name) {Source = this}); new Binding(NonClientAreaHeightProperty.Name) {Source = this});
@@ -123,9 +122,192 @@ namespace HandyControl.Controls
(s, e) => WindowState = WindowState.Normal)); (s, e) => WindowState = WindowState.Normal));
CommandBindings.Add(new CommandBinding(SystemCommands.CloseWindowCommand, (s, e) => Close())); CommandBindings.Add(new CommandBinding(SystemCommands.CloseWindowCommand, (s, e) => Close()));
CommandBindings.Add(new CommandBinding(SystemCommands.ShowSystemMenuCommand, ShowSystemMenu)); 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) protected override void OnStateChanged(EventArgs e)
{ {
base.OnStateChanged(e); base.OnStateChanged(e);
@@ -143,6 +325,8 @@ namespace HandyControl.Controls
{ {
base.OnApplyTemplate(); base.OnApplyTemplate();
_nonClientArea = GetTemplateChild(ElementNonClientArea) as UIElement;
if (SizeToContent != SizeToContent.WidthAndHeight) if (SizeToContent != SizeToContent.WidthAndHeight)
return; return;
@@ -150,111 +334,6 @@ namespace HandyControl.Controls
Dispatcher.BeginInvoke(new Action(() => { SizeToContent = SizeToContent.WidthAndHeight; })); 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) private void ShowSystemMenu(object sender, ExecutedRoutedEventArgs e)
{ {
var point = WindowState == WindowState.Maximized var point = WindowState == WindowState.Maximized
+1 -1
View File
@@ -1,4 +1,4 @@
// ReSharper disable once CheckNamespace
namespace HandyControl.Data namespace HandyControl.Data
{ {
public enum InfoType public enum InfoType
+1 -1
View File
@@ -1,4 +1,4 @@
// ReSharper disable once CheckNamespace
namespace HandyControl.Data namespace HandyControl.Data
{ {
/// <summary> /// <summary>
+1 -1
View File
@@ -1,4 +1,4 @@
// ReSharper disable once CheckNamespace
namespace HandyControl.Data namespace HandyControl.Data
{ {
/// <summary> /// <summary>
+1 -1
View File
@@ -1,4 +1,4 @@
// ReSharper disable once CheckNamespace
namespace HandyControl.Data namespace HandyControl.Data
{ {
public enum SkinType public enum SkinType
+1 -1
View File
@@ -1,4 +1,4 @@
// ReSharper disable once CheckNamespace
namespace HandyControl.Data namespace HandyControl.Data
{ {
/// <summary> /// <summary>
+1 -1
View File
@@ -1,4 +1,4 @@
// ReSharper disable once CheckNamespace
namespace HandyControl.Data namespace HandyControl.Data
{ {
public enum TipPlacement public enum TipPlacement
+1 -1
View File
@@ -1,4 +1,4 @@
// ReSharper disable once CheckNamespace
namespace HandyControl.Data namespace HandyControl.Data
{ {
/// <summary> /// <summary>
+12 -2
View File
@@ -114,6 +114,7 @@
</When> </When>
</Choose> </Choose>
<ItemGroup> <ItemGroup>
<Compile Include="Controls\Attach\WindowAttach.cs" />
<Compile Include="Controls\Attach\LinkElement.cs" /> <Compile Include="Controls\Attach\LinkElement.cs" />
<Compile Include="Controls\Attach\PanelElement.cs" /> <Compile Include="Controls\Attach\PanelElement.cs" />
<Compile Include="Controls\Attach\VisualElement.cs" /> <Compile Include="Controls\Attach\VisualElement.cs" />
@@ -151,8 +152,8 @@
<Compile Include="Controls\Text\OutlineText.cs" /> <Compile Include="Controls\Text\OutlineText.cs" />
<Compile Include="Controls\Image\GifImage.cs" /> <Compile Include="Controls\Image\GifImage.cs" />
<Compile Include="Controls\Input\SearchBar.cs" /> <Compile Include="Controls\Input\SearchBar.cs" />
<Compile Include="Controls\Tag\TagPanel.cs" /> <Compile Include="Controls\Text\Tag\TagPanel.cs" />
<Compile Include="Controls\Tag\Tag.cs" /> <Compile Include="Controls\Text\Tag\Tag.cs" />
<Compile Include="Controls\Time\CalendarWithClock.cs" /> <Compile Include="Controls\Time\CalendarWithClock.cs" />
<Compile Include="Controls\Time\Clock\Clock.cs" /> <Compile Include="Controls\Time\Clock\Clock.cs" />
<Compile Include="Controls\Time\Clock\ClockRadioButton.cs" /> <Compile Include="Controls\Time\Clock\ClockRadioButton.cs" />
@@ -182,6 +183,7 @@
<Compile Include="Controls\Time\FlipClock\FlipClock.cs" /> <Compile Include="Controls\Time\FlipClock\FlipClock.cs" />
<Compile Include="Controls\Time\FlipClock\FlipNumber.cs" /> <Compile Include="Controls\Time\FlipClock\FlipNumber.cs" />
<Compile Include="Controls\Window\BlurWindow.cs" /> <Compile Include="Controls\Window\BlurWindow.cs" />
<Compile Include="Controls\Window\MessageBox.cs" />
<Compile Include="Data\Args\CancelRoutedEventArgs.cs" /> <Compile Include="Data\Args\CancelRoutedEventArgs.cs" />
<Compile Include="Data\Enum\InfoType.cs" /> <Compile Include="Data\Enum\InfoType.cs" />
<Compile Include="Data\Enum\ResultType.cs" /> <Compile Include="Data\Enum\ResultType.cs" />
@@ -617,6 +619,10 @@
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</Page> </Page>
<Page Include="Themes\Styles\MessageBox.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Themes\Styles\NumericUpDown.xaml"> <Page Include="Themes\Styles\NumericUpDown.xaml">
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
@@ -629,6 +635,10 @@
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</Page> </Page>
<Page Include="Themes\Styles\PopupWindow.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Themes\Styles\ProgressBar.xaml"> <Page Include="Themes\Styles\ProgressBar.xaml">
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
@@ -77,6 +77,16 @@ namespace HandyControl.Interactivity
/// </summary> /// </summary>
public static RoutedCommand Confirm { get; } = new RoutedCommand(nameof(Confirm), typeof(ControlCommands)); 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>
/// 关闭所有 /// 关闭所有
/// </summary> /// </summary>
+1 -1
View File
@@ -10,4 +10,4 @@ using System.Runtime.InteropServices;
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
[assembly: ComVisible(false)] [assembly: ComVisible(false)]
[assembly: AssemblyVersion("1.5.1.*")] [assembly: AssemblyVersion("1.5.2.*")]
+18
View File
@@ -240,6 +240,15 @@ namespace HandyControl.Properties.Langs {
} }
} }
/// <summary>
/// 查找类似 否 的本地化字符串。
/// </summary>
public static string No {
get {
return ResourceManager.GetString("No", resourceCulture);
}
}
/// <summary> /// <summary>
/// 查找类似 不在范围内 的本地化字符串。 /// 查找类似 不在范围内 的本地化字符串。
/// </summary> /// </summary>
@@ -302,5 +311,14 @@ namespace HandyControl.Properties.Langs {
return ResourceManager.GetString("UnknownSize", resourceCulture); return ResourceManager.GetString("UnknownSize", resourceCulture);
} }
} }
/// <summary>
/// 查找类似 是 的本地化字符串。
/// </summary>
public static string Yes {
get {
return ResourceManager.GetString("Yes", resourceCulture);
}
}
} }
} }
+6 -1
View File
@@ -53,7 +53,6 @@
value : The object must be serialized with value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding. : and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64 mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter : using a System.ComponentModel.TypeConverter
@@ -198,4 +197,10 @@
<data name="CannotRegisterSameCommandTwice" xml:space="preserve"> <data name="CannotRegisterSameCommandTwice" xml:space="preserve">
<value>Cannot Register Same Command Twice</value> <value>Cannot Register Same Command Twice</value>
</data> </data>
<data name="Yes" xml:space="preserve">
<value>Yes</value>
</data>
<data name="No" xml:space="preserve">
<value>No</value>
</data>
</root> </root>
+6
View File
@@ -178,4 +178,10 @@
<data name="CannotRegisterSameCommandTwice" xml:space="preserve"> <data name="CannotRegisterSameCommandTwice" xml:space="preserve">
<value>不能注册同一命令两次</value> <value>不能注册同一命令两次</value>
</data> </data>
<data name="Yes" xml:space="preserve">
<value>是</value>
</data>
<data name="No" xml:space="preserve">
<value>否</value>
</data>
</root> </root>
@@ -54,7 +54,7 @@
</Grid.ColumnDefinitions> </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"/> <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"/> <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> </Grid>
<ControlTemplate.Triggers> <ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="True"> <Trigger Property="IsChecked" Value="True">
@@ -203,6 +203,7 @@
<Style x:Key="ContextMenuBaseStyle" TargetType="ContextMenu"> <Style x:Key="ContextMenuBaseStyle" TargetType="ContextMenu">
<Setter Property="MaxHeight" Value="199"/> <Setter Property="MaxHeight" Value="199"/>
<Setter Property="Background" Value="{DynamicResource RegionBrush}"/> <Setter Property="Background" Value="{DynamicResource RegionBrush}"/>
<Setter Property="SnapsToDevicePixels" Value="True"/>
<Setter Property="Template"> <Setter Property="Template">
<Setter.Value> <Setter.Value>
<ControlTemplate TargetType="ContextMenu"> <ControlTemplate TargetType="ContextMenu">
@@ -3,8 +3,8 @@
xmlns:controls="clr-namespace:HandyControl.Controls"> xmlns:controls="clr-namespace:HandyControl.Controls">
<!--<Style x:Key="CoverFlowItemBaseStyle" TargetType="controls:CoverFlowItem"> <!--<Style x:Key="CoverFlowItemBaseStyle" TargetType="controls:CoverFlowItem">
<Setter Property="Width" Value="{Binding ItemWidth,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 FindAncestor, AncestorType=controls:CoverFlow}}"/> <Setter Property="Height" Value="{Binding ItemHeight,RelativeSource={RelativeSource AncestorType=controls:CoverFlow}}"/>
<Setter Property="Template"> <Setter Property="Template">
<Setter.Value> <Setter.Value>
<ControlTemplate TargetType="controls:CoverFlowItem"> <ControlTemplate TargetType="controls:CoverFlowItem">
@@ -3,9 +3,9 @@
xmlns:controls="clr-namespace:HandyControl.Controls"> xmlns:controls="clr-namespace:HandyControl.Controls">
<Style x:Key="CoverViewItemBaseStyle" TargetType="controls:CoverViewItem"> <Style x:Key="CoverViewItemBaseStyle" TargetType="controls:CoverViewItem">
<Setter Property="Margin" Value="{Binding ItemMargin,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 FindAncestor, AncestorType=controls:CoverView}}"/> <Setter Property="Width" Value="{Binding ItemWidth,RelativeSource={RelativeSource AncestorType=controls:CoverView}}"/>
<Setter Property="Height" Value="{Binding ItemHeight,RelativeSource={RelativeSource FindAncestor, AncestorType=controls:CoverView}}"/> <Setter Property="Height" Value="{Binding ItemHeight,RelativeSource={RelativeSource AncestorType=controls:CoverView}}"/>
<Setter Property="Template"> <Setter Property="Template">
<Setter.Value> <Setter.Value>
<ControlTemplate TargetType="controls:CoverViewItem"> <ControlTemplate TargetType="controls:CoverViewItem">
@@ -18,7 +18,7 @@
<ControlTemplate TargetType="DatePickerTextBox"> <ControlTemplate TargetType="DatePickerTextBox">
<Grid x:Name="WatermarkContent"> <Grid x:Name="WatermarkContent">
<Border x:Name="ContentElement"/> <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}"/> <ScrollViewer x:Name="PART_ContentHost" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="0" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>
</Grid> </Grid>
</ControlTemplate> </ControlTemplate>
@@ -9,7 +9,7 @@
<Setter Property="Padding" Value="10,0"/> <Setter Property="Padding" Value="10,0"/>
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}"/> <Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}"/>
<Setter Property="Height" Value="32"/> <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="VerticalContentAlignment" Value="Center"/>
<Setter Property="Background" Value="{DynamicResource RegionBrush}"/> <Setter Property="Background" Value="{DynamicResource RegionBrush}"/>
<Setter Property="BorderBrush" Value="Transparent"/> <Setter Property="BorderBrush" Value="Transparent"/>
@@ -187,7 +187,7 @@
<Trigger Property="IsChecked" Value="True"> <Trigger Property="IsChecked" Value="True">
<Setter Property="Panel.ZIndex" Value="{x:Static system:Int32.MaxValue}"/> <Setter Property="Panel.ZIndex" Value="{x:Static system:Int32.MaxValue}"/>
</Trigger> </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"/> <Setter Property="Margin" Value="0,-1,0,0"/>
</DataTrigger> </DataTrigger>
</Style.Triggers> </Style.Triggers>
@@ -8,14 +8,14 @@
</ResourceDictionary.MergedDictionaries> </ResourceDictionary.MergedDictionaries>
<Style x:Key="RateRateItemBaseStyle" TargetType="controls:RateItem"> <Style x:Key="RateRateItemBaseStyle" TargetType="controls:RateItem">
<Setter Property="Margin" Value="{Binding ItemMargin,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 FindAncestor, AncestorType=controls:Rate}}"/> <Setter Property="Width" Value="{Binding ItemWidth,RelativeSource={RelativeSource AncestorType=controls:Rate}}"/>
<Setter Property="Height" Value="{Binding ItemHeight,RelativeSource={RelativeSource FindAncestor, AncestorType=controls:Rate}}"/> <Setter Property="Height" Value="{Binding ItemHeight,RelativeSource={RelativeSource AncestorType=controls:Rate}}"/>
<Setter Property="AllowHalf" Value="{Binding AllowHalf,RelativeSource={RelativeSource FindAncestor, AncestorType=controls:Rate}}"/> <Setter Property="AllowHalf" Value="{Binding AllowHalf,RelativeSource={RelativeSource AncestorType=controls:Rate}}"/>
<Setter Property="AllowClear" Value="{Binding AllowClear,RelativeSource={RelativeSource FindAncestor, AncestorType=controls:Rate}}"/> <Setter Property="AllowClear" Value="{Binding AllowClear,RelativeSource={RelativeSource AncestorType=controls:Rate}}"/>
<Setter Property="Icon" Value="{Binding Icon,RelativeSource={RelativeSource FindAncestor, AncestorType=controls:Rate}}"/> <Setter Property="Icon" Value="{Binding Icon,RelativeSource={RelativeSource AncestorType=controls:Rate}}"/>
<Setter Property="IsReadOnly" Value="{Binding IsReadOnly,RelativeSource={RelativeSource FindAncestor, AncestorType=controls:Rate}}"/> <Setter Property="IsReadOnly" Value="{Binding IsReadOnly,RelativeSource={RelativeSource AncestorType=controls:Rate}}"/>
<Setter Property="Background" Value="{Binding Background,RelativeSource={RelativeSource FindAncestor, AncestorType=controls:Rate}}"/> <Setter Property="Background" Value="{Binding Background,RelativeSource={RelativeSource AncestorType=controls:Rate}}"/>
<Setter Property="Template"> <Setter Property="Template">
<Setter.Value> <Setter.Value>
<ControlTemplate TargetType="controls:RateItem"> <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"> <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}}"/> <TextBlock Foreground="{TemplateBinding Foreground}" Style="{StaticResource TextBlockDefaultThiLight}" Text="{Binding Index,RelativeSource={RelativeSource TemplatedParent}}"/>
</Border> </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> </StackPanel>
</ControlTemplate> </ControlTemplate>
</Setter.Value> </Setter.Value>
@@ -44,7 +44,7 @@
<Setter.Value> <Setter.Value>
<ControlTemplate TargetType="controls:StepBarItem"> <ControlTemplate TargetType="controls:StepBarItem">
<StackPanel> <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"> <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}}"/> <TextBlock Foreground="{TemplateBinding Foreground}" Style="{StaticResource TextBlockDefaultThiLight}" Text="{Binding Index,RelativeSource={RelativeSource TemplatedParent}}"/>
</Border> </Border>
@@ -63,7 +63,7 @@
<Border Background="{DynamicResource RegionBrush}" HorizontalAlignment="Center" CornerRadius="12" BorderThickness="2" BorderBrush="{TemplateBinding Foreground}" Height="24" MinWidth="24"> <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}}"/> <TextBlock Foreground="{TemplateBinding Foreground}" Style="{StaticResource TextBlockDefaultThiLight}" Text="{Binding Index,RelativeSource={RelativeSource TemplatedParent}}"/>
</Border> </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> </StackPanel>
</ControlTemplate> </ControlTemplate>
</Setter.Value> </Setter.Value>
@@ -22,23 +22,23 @@
<ControlTemplate TargetType="TabItem"> <ControlTemplate TargetType="TabItem">
<Grid x:Name="templateRoot" SnapsToDevicePixels="true"> <Grid x:Name="templateRoot" SnapsToDevicePixels="true">
<Border x:Name="mainBorder" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0" Background="{TemplateBinding Background}" Margin="0"/> <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> </Grid>
<ControlTemplate.Triggers> <ControlTemplate.Triggers>
<MultiDataTrigger> <MultiDataTrigger>
<MultiDataTrigger.Conditions> <MultiDataTrigger.Conditions>
<Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="false"/> <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> </MultiDataTrigger.Conditions>
<Setter Property="BorderThickness" TargetName="mainBorder" Value="0,0,0,0"/> <Setter Property="BorderThickness" TargetName="mainBorder" Value="0,0,0,0"/>
</MultiDataTrigger> </MultiDataTrigger>
<MultiDataTrigger> <MultiDataTrigger>
<MultiDataTrigger.Conditions> <MultiDataTrigger.Conditions>
<Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="true"/> <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> </MultiDataTrigger.Conditions>
<Setter Property="Panel.ZIndex" Value="1"/> <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"/> <Setter Property="BorderThickness" TargetName="mainBorder" Value="0,0,0,3"/>
</MultiDataTrigger> </MultiDataTrigger>
</ControlTemplate.Triggers> </ControlTemplate.Triggers>
@@ -17,7 +17,7 @@
<Setter.Value> <Setter.Value>
<ControlTemplate TargetType="ToggleButton"> <ControlTemplate TargetType="ToggleButton">
<Border Background="Transparent" Height="16" Padding="4" Width="16"> <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> <Path.RenderTransform>
<RotateTransform Angle="-90"/> <RotateTransform Angle="-90"/>
</Path.RenderTransform> </Path.RenderTransform>
@@ -53,7 +53,7 @@
<RowDefinition/> <RowDefinition/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true"> <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}"/> <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}"/> <ContentPresenter VerticalAlignment="Center" x:Name="PART_Header" ContentSource="Header" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
</StackPanel> </StackPanel>
+2 -2
View File
@@ -214,11 +214,11 @@
</Border> </Border>
</Grid> </Grid>
<ControlTemplate.Triggers> <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_MonthView" Value="Hidden"/>
<Setter Property="Visibility" TargetName="PART_YearView" Value="Visible"/> <Setter Property="Visibility" TargetName="PART_YearView" Value="Visible"/>
</DataTrigger> </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_MonthView" Value="Hidden"/>
<Setter Property="Visibility" TargetName="PART_YearView" Value="Visible"/> <Setter Property="Visibility" TargetName="PART_YearView" Value="Visible"/>
</DataTrigger> </DataTrigger>
+1 -2
View File
@@ -1,5 +1,4 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ResourceDictionary.MergedDictionaries> <ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Base/ContextMenuBaseStyle.xaml"/> <ResourceDictionary Source="Base/ContextMenuBaseStyle.xaml"/>
+5 -5
View File
@@ -79,8 +79,8 @@
</SelectiveScrollingGrid.RowDefinitions> </SelectiveScrollingGrid.RowDefinitions>
<Border CornerRadius="4" Grid.ColumnSpan="2" x:Name="DGR_Border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True"/> <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}"/> <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}"/> <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={x:Type DataGrid}}}"/> <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> </SelectiveScrollingGrid>
</ControlTemplate> </ControlTemplate>
</Setter.Value> </Setter.Value>
@@ -237,13 +237,13 @@
<RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/>
<RowDefinition Height="*"/> <RowDefinition Height="*"/>
</Grid.RowDefinitions> </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}"/> <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={x:Type DataGrid}}}"/> <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"/> <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}"/> <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 Grid.Column="1" Grid.Row="1">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="{Binding NonFrozenColumnsViewportHorizontalOffset, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/> <ColumnDefinition Width="{Binding NonFrozenColumnsViewportHorizontalOffset, RelativeSource={RelativeSource AncestorType=DataGrid}}"/>
<ColumnDefinition Width="*"/> <ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions> </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}"/> <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}"/>
+1 -1
View File
@@ -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}"/> <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"> <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 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> </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"> <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}"/> <Path Data="{StaticResource ErrorGeometry}" Stretch="Uniform" Fill="{DynamicResource SecondaryTextBrush}"/>
+2 -2
View File
@@ -12,7 +12,7 @@
<Setter Property="SnapsToDevicePixels" Value="True"/> <Setter Property="SnapsToDevicePixels" Value="True"/>
<Setter Property="FocusVisualStyle" Value="{x:Null}"/> <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
<Setter Property="Padding" Value="0"/> <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="VerticalContentAlignment" Value="Top"/>
<Setter Property="Background" Value="Transparent"/> <Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderBrush" Value="Transparent"/> <Setter Property="BorderBrush" Value="Transparent"/>
@@ -29,7 +29,7 @@
<Style x:Key="ListBoxItemFullStyle" BasedOn="{StaticResource ListBoxItemStyle}" TargetType="ListBoxItem"> <Style x:Key="ListBoxItemFullStyle" BasedOn="{StaticResource ListBoxItemStyle}" TargetType="ListBoxItem">
<Setter Property="HorizontalContentAlignment" Value="Stretch"/> <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
<Setter Property="VerticalContentAlignment" 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> </Style>
<ItemsPanelTemplate x:Key="WrapPanelItemsPanelTemplate"> <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 -2
View File
@@ -2,7 +2,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:HandyControl.Controls"> 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="Background" Value="{DynamicResource RegionBrush}"/>
<Setter Property="BorderBrush" Value="{DynamicResource BorderBrush}"/> <Setter Property="BorderBrush" Value="{DynamicResource BorderBrush}"/>
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}"/> <Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}"/>
@@ -20,7 +20,7 @@
<Setter Property="Stylus.IsFlicksEnabled" Value="False"/> <Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
<Setter Property="Template"> <Setter Property="Template">
<Setter.Value> <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"> <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}}"/> <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> </Border>
+4 -4
View File
@@ -504,7 +504,7 @@
<ControlTemplate x:Key="TipSliderThumbHorizontalTop" TargetType="Thumb"> <ControlTemplate x:Key="TipSliderThumbHorizontalTop" TargetType="Thumb">
<controls:InternalCanvas> <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"/> <Border Canvas.Bottom="0" Effect="{StaticResource EffectShadow1}" Name="BorderDot" BorderThickness="0" BorderBrush="{DynamicResource PrimaryBrush}" Width="18" Height="18" Background="White" CornerRadius="9"/>
</controls:InternalCanvas> </controls:InternalCanvas>
<ControlTemplate.Triggers> <ControlTemplate.Triggers>
@@ -535,7 +535,7 @@
<ControlTemplate x:Key="TipSliderThumbHorizontalBottom" TargetType="Thumb"> <ControlTemplate x:Key="TipSliderThumbHorizontalBottom" TargetType="Thumb">
<controls:InternalCanvas> <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"/> <Border Canvas.Bottom="0" Effect="{StaticResource EffectShadow1}" Name="BorderDot" BorderThickness="0" BorderBrush="{DynamicResource PrimaryBrush}" Width="18" Height="18" Background="White" CornerRadius="9"/>
</controls:InternalCanvas> </controls:InternalCanvas>
<ControlTemplate.Triggers> <ControlTemplate.Triggers>
@@ -566,7 +566,7 @@
<ControlTemplate x:Key="TipSliderThumbVerticalLeft" TargetType="Thumb"> <ControlTemplate x:Key="TipSliderThumbVerticalLeft" TargetType="Thumb">
<controls:InternalCanvas Orientation="Vertical"> <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"/> <Border Canvas.Right="0" Effect="{StaticResource EffectShadow1}" Name="BorderDot" BorderThickness="0" BorderBrush="{DynamicResource PrimaryBrush}" Width="18" Height="18" Background="White" CornerRadius="9"/>
</controls:InternalCanvas> </controls:InternalCanvas>
<ControlTemplate.Triggers> <ControlTemplate.Triggers>
@@ -597,7 +597,7 @@
<ControlTemplate x:Key="TipSliderThumbVerticalRight" TargetType="Thumb"> <ControlTemplate x:Key="TipSliderThumbVerticalRight" TargetType="Thumb">
<controls:InternalCanvas Orientation="Vertical"> <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"/> <Border Canvas.Right="0" Effect="{StaticResource EffectShadow1}" Name="BorderDot" BorderThickness="0" BorderBrush="{DynamicResource PrimaryBrush}" Width="18" Height="18" Background="White" CornerRadius="9"/>
</controls:InternalCanvas> </controls:InternalCanvas>
<ControlTemplate.Triggers> <ControlTemplate.Triggers>
+2
View File
@@ -2,6 +2,8 @@
<ResourceDictionary.MergedDictionaries> <ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Window.xaml"/> <ResourceDictionary Source="Window.xaml"/>
<ResourceDictionary Source="PopupWindow.xaml"/>
<ResourceDictionary Source="MessageBox.xaml"/>
<ResourceDictionary Source="Button.xaml"/> <ResourceDictionary Source="Button.xaml"/>
<ResourceDictionary Source="ToggleButton.xaml"/> <ResourceDictionary Source="ToggleButton.xaml"/>
<ResourceDictionary Source="TextBlock.xaml"/> <ResourceDictionary Source="TextBlock.xaml"/>
+2 -2
View File
@@ -26,7 +26,7 @@
<Setter Property="HeaderTemplate"> <Setter Property="HeaderTemplate">
<Setter.Value> <Setter.Value>
<DataTemplate> <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> </DataTemplate>
</Setter.Value> </Setter.Value>
</Setter> </Setter>
@@ -56,7 +56,7 @@
</LinearGradientBrush> </LinearGradientBrush>
</ContentPresenter.OpacityMask> </ContentPresenter.OpacityMask>
</ContentPresenter> </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}"/> <Path Fill="{DynamicResource PrimaryTextBrush}" Width="8" Height="8" Style="{StaticResource ClosePathStyle}"/>
</Button> </Button>
</Grid> </Grid>
+6 -82
View File
@@ -1,17 +1,13 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:HandyControl.Controls" xmlns:controls="clr-namespace:HandyControl.Controls"
xmlns:langs="clr-namespace:HandyControl.Properties.Langs"
xmlns:interactivity="clr-namespace:HandyControl.Interactivity" xmlns:interactivity="clr-namespace:HandyControl.Interactivity"
xmlns:shell="http://schemas.microsoft.com/winfx/2006/xaml/presentation/shell"> xmlns:shell="http://schemas.microsoft.com/winfx/2006/xaml/presentation/shell">
<ResourceDictionary.MergedDictionaries> <ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Button.xaml"/> <ResourceDictionary Source="Button.xaml"/>
<ResourceDictionary Source="TextBlock.xaml"/>
<ResourceDictionary Source="Border.xaml"/>
<ResourceDictionary Source="ToggleButton.xaml"/>
<ResourceDictionary Source="../Basic/Converters.xaml"/> <ResourceDictionary Source="../Basic/Converters.xaml"/>
<ResourceDictionary Source="../Basic/Paths.xaml"/> <ResourceDictionary Source="../Basic/Geometries.xaml"/>
</ResourceDictionary.MergedDictionaries> </ResourceDictionary.MergedDictionaries>
<Style x:Key="WindowDefault" BasedOn="{x:Null}" TargetType="Window"> <Style x:Key="WindowDefault" BasedOn="{x:Null}" TargetType="Window">
@@ -40,16 +36,16 @@
<RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/>
<RowDefinition/> <RowDefinition/>
</Grid.RowDefinitions> </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> <Grid.ColumnDefinitions>
<ColumnDefinition/> <ColumnDefinition/>
<ColumnDefinition Width="Auto"/> <ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<StackPanel shell:WindowChrome.IsHitTestVisibleInChrome="True" UseLayoutRounding="True" VerticalAlignment="Top" Grid.Column="1" HorizontalAlignment="Right" Orientation="Horizontal"> <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.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" 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.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" 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 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" 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 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> </StackPanel>
<Grid Grid.Column="0"> <Grid Grid.Column="0">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
@@ -107,9 +103,6 @@
<Setter Property="Background" TargetName="ButtonMin" Value="{Binding OtherButtonHoverBackground,RelativeSource={RelativeSource Mode=TemplatedParent}}"/> <Setter Property="Background" TargetName="ButtonMin" Value="{Binding OtherButtonHoverBackground,RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
<Setter Property="Foreground" TargetName="ButtonMin" Value="{Binding OtherButtonHoverForeground,RelativeSource={RelativeSource Mode=TemplatedParent}}"/> <Setter Property="Foreground" TargetName="ButtonMin" Value="{Binding OtherButtonHoverForeground,RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
</Trigger> </Trigger>
<Trigger Property="ShowNonClientArea" Value="False">
<Setter Property="Visibility" Value="Collapsed" TargetName="GridMenu"/>
</Trigger>
<Trigger Property="ShowTitle" Value="False"> <Trigger Property="ShowTitle" Value="False">
<Setter Property="Visibility" Value="Collapsed" TargetName="Title"/> <Setter Property="Visibility" Value="Collapsed" TargetName="Title"/>
</Trigger> </Trigger>
@@ -124,81 +117,12 @@
</ControlTemplate> </ControlTemplate>
</Setter.Value> </Setter.Value>
</Setter> </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>
<Style x:Key="WindowBlur" BasedOn="{StaticResource WindowWin10}" TargetType="controls:BlurWindow"> <Style x:Key="WindowBlur" BasedOn="{StaticResource WindowWin10}" TargetType="controls:BlurWindow">
<Setter Property="Background" Value="Transparent"/> <Setter Property="Background" Value="Transparent"/>
</Style> </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"> <Style TargetType="controls:ImageBrowser">
<Setter Property="Background" Value="Transparent"/> <Setter Property="Background" Value="Transparent"/>
<Setter Property="MinWidth" Value="400"/> <Setter Property="MinWidth" Value="400"/>
+6 -82
View File
@@ -1,16 +1,12 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:HandyControl.Controls" xmlns:controls="clr-namespace:HandyControl.Controls"
xmlns:langs="clr-namespace:HandyControl.Properties.Langs"
xmlns:interactivity="clr-namespace:HandyControl.Interactivity"> xmlns:interactivity="clr-namespace:HandyControl.Interactivity">
<ResourceDictionary.MergedDictionaries> <ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Button.xaml"/> <ResourceDictionary Source="Button.xaml"/>
<ResourceDictionary Source="TextBlock.xaml"/>
<ResourceDictionary Source="Border.xaml"/>
<ResourceDictionary Source="ToggleButton.xaml"/>
<ResourceDictionary Source="../Basic/Converters.xaml"/> <ResourceDictionary Source="../Basic/Converters.xaml"/>
<ResourceDictionary Source="../Basic/Paths.xaml"/> <ResourceDictionary Source="../Basic/Geometries.xaml"/>
</ResourceDictionary.MergedDictionaries> </ResourceDictionary.MergedDictionaries>
<Style x:Key="WindowDefault" BasedOn="{x:Null}" TargetType="Window"> <Style x:Key="WindowDefault" BasedOn="{x:Null}" TargetType="Window">
@@ -39,16 +35,16 @@
<RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/>
<RowDefinition/> <RowDefinition/>
</Grid.RowDefinitions> </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> <Grid.ColumnDefinitions>
<ColumnDefinition/> <ColumnDefinition/>
<ColumnDefinition Width="Auto"/> <ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<StackPanel WindowChrome.IsHitTestVisibleInChrome="True" UseLayoutRounding="True" VerticalAlignment="Top" Grid.Column="1" HorizontalAlignment="Right" Orientation="Horizontal"> <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.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" 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.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" 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 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" 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 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> </StackPanel>
<Grid Grid.Column="0"> <Grid Grid.Column="0">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
@@ -106,9 +102,6 @@
<Setter Property="Background" TargetName="ButtonMin" Value="{Binding OtherButtonHoverBackground,RelativeSource={RelativeSource Mode=TemplatedParent}}"/> <Setter Property="Background" TargetName="ButtonMin" Value="{Binding OtherButtonHoverBackground,RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
<Setter Property="Foreground" TargetName="ButtonMin" Value="{Binding OtherButtonHoverForeground,RelativeSource={RelativeSource Mode=TemplatedParent}}"/> <Setter Property="Foreground" TargetName="ButtonMin" Value="{Binding OtherButtonHoverForeground,RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
</Trigger> </Trigger>
<Trigger Property="ShowNonClientArea" Value="False">
<Setter Property="Visibility" Value="Collapsed" TargetName="GridMenu"/>
</Trigger>
<Trigger Property="ShowTitle" Value="False"> <Trigger Property="ShowTitle" Value="False">
<Setter Property="Visibility" Value="Collapsed" TargetName="Title"/> <Setter Property="Visibility" Value="Collapsed" TargetName="Title"/>
</Trigger> </Trigger>
@@ -123,81 +116,12 @@
</ControlTemplate> </ControlTemplate>
</Setter.Value> </Setter.Value>
</Setter> </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>
<Style x:Key="WindowBlur" BasedOn="{StaticResource WindowWin10}" TargetType="controls:BlurWindow"> <Style x:Key="WindowBlur" BasedOn="{StaticResource WindowWin10}" TargetType="controls:BlurWindow">
<Setter Property="Background" Value="Transparent"/> <Setter Property="Background" Value="Transparent"/>
</Style> </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"> <Style TargetType="controls:ImageBrowser">
<Setter Property="Background" Value="Transparent"/> <Setter Property="Background" Value="Transparent"/>
<Setter Property="MinWidth" Value="400"/> <Setter Property="MinWidth" Value="400"/>
+6 -82
View File
@@ -1,16 +1,12 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:HandyControl.Controls" xmlns:controls="clr-namespace:HandyControl.Controls"
xmlns:langs="clr-namespace:HandyControl.Properties.Langs"
xmlns:interactivity="clr-namespace:HandyControl.Interactivity"> xmlns:interactivity="clr-namespace:HandyControl.Interactivity">
<ResourceDictionary.MergedDictionaries> <ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Button.xaml"/> <ResourceDictionary Source="Button.xaml"/>
<ResourceDictionary Source="TextBlock.xaml"/>
<ResourceDictionary Source="Border.xaml"/>
<ResourceDictionary Source="ToggleButton.xaml"/>
<ResourceDictionary Source="../Basic/Converters.xaml"/> <ResourceDictionary Source="../Basic/Converters.xaml"/>
<ResourceDictionary Source="../Basic/Paths.xaml"/> <ResourceDictionary Source="../Basic/Geometries.xaml"/>
</ResourceDictionary.MergedDictionaries> </ResourceDictionary.MergedDictionaries>
<Style x:Key="WindowDefault" BasedOn="{x:Null}" TargetType="Window"> <Style x:Key="WindowDefault" BasedOn="{x:Null}" TargetType="Window">
@@ -39,16 +35,16 @@
<RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/>
<RowDefinition/> <RowDefinition/>
</Grid.RowDefinitions> </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> <Grid.ColumnDefinitions>
<ColumnDefinition/> <ColumnDefinition/>
<ColumnDefinition Width="Auto"/> <ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<StackPanel WindowChrome.IsHitTestVisibleInChrome="True" UseLayoutRounding="True" VerticalAlignment="Top" Grid.Column="1" HorizontalAlignment="Right" Orientation="Horizontal"> <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.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" 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.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" 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 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" 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 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> </StackPanel>
<Grid Grid.Column="0"> <Grid Grid.Column="0">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
@@ -106,9 +102,6 @@
<Setter Property="Background" TargetName="ButtonMin" Value="{Binding OtherButtonHoverBackground,RelativeSource={RelativeSource Mode=TemplatedParent}}"/> <Setter Property="Background" TargetName="ButtonMin" Value="{Binding OtherButtonHoverBackground,RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
<Setter Property="Foreground" TargetName="ButtonMin" Value="{Binding OtherButtonHoverForeground,RelativeSource={RelativeSource Mode=TemplatedParent}}"/> <Setter Property="Foreground" TargetName="ButtonMin" Value="{Binding OtherButtonHoverForeground,RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
</Trigger> </Trigger>
<Trigger Property="ShowNonClientArea" Value="False">
<Setter Property="Visibility" Value="Collapsed" TargetName="GridMenu"/>
</Trigger>
<Trigger Property="ShowTitle" Value="False"> <Trigger Property="ShowTitle" Value="False">
<Setter Property="Visibility" Value="Collapsed" TargetName="Title"/> <Setter Property="Visibility" Value="Collapsed" TargetName="Title"/>
</Trigger> </Trigger>
@@ -123,81 +116,12 @@
</ControlTemplate> </ControlTemplate>
</Setter.Value> </Setter.Value>
</Setter> </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>
<Style x:Key="WindowBlur" BasedOn="{StaticResource WindowWin10}" TargetType="controls:BlurWindow"> <Style x:Key="WindowBlur" BasedOn="{StaticResource WindowWin10}" TargetType="controls:BlurWindow">
<Setter Property="Background" Value="Transparent"/> <Setter Property="Background" Value="Transparent"/>
</Style> </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"> <Style TargetType="controls:ImageBrowser">
<Setter Property="Background" Value="Transparent"/> <Setter Property="Background" Value="Transparent"/>
<Setter Property="MinWidth" Value="400"/> <Setter Property="MinWidth" Value="400"/>
+1 -1
View File
@@ -1,4 +1,4 @@
// ReSharper disable once CheckNamespace
namespace HandyControlDemo.Data namespace HandyControlDemo.Data
{ {
public enum DemoType public enum DemoType
+2
View File
@@ -64,6 +64,8 @@
public static readonly string BlurWindow = nameof(BlurWindow); 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 RateDemoCtl = nameof(RateDemoCtl);
public static readonly string ShieldDemoCtl = nameof(ShieldDemoCtl); public static readonly string ShieldDemoCtl = nameof(ShieldDemoCtl);
+1
View File
@@ -35,6 +35,7 @@ var controlList = new List<string>
"FlipClockDemoCtl", "FlipClockDemoCtl",
"QQGroupView", "QQGroupView",
"BlurWindow", "BlurWindow",
"NoNonClientAreaDragableWindow",
"RateDemoCtl", "RateDemoCtl",
"ShieldDemoCtl", "ShieldDemoCtl",
"WaterfallPanelDemoCtl", "WaterfallPanelDemoCtl",
@@ -1,4 +1,4 @@
// ReSharper disable once CheckNamespace
namespace HandyControlDemo.Data namespace HandyControlDemo.Data
{ {
public class ContributorModel public class ContributorModel
+1 -1
View File
@@ -1,6 +1,6 @@
using System.Collections.Generic; using System.Collections.Generic;
// ReSharper disable once CheckNamespace
namespace HandyControlDemo.Data namespace HandyControlDemo.Data
{ {
public class DemoDataModel public class DemoDataModel
+7
View File
@@ -328,6 +328,9 @@
<Compile Include="Window\CustomNonClientAreaWindow.xaml.cs"> <Compile Include="Window\CustomNonClientAreaWindow.xaml.cs">
<DependentUpon>CustomNonClientAreaWindow.xaml</DependentUpon> <DependentUpon>CustomNonClientAreaWindow.xaml</DependentUpon>
</Compile> </Compile>
<Compile Include="Window\NoNonClientAreaDragableWindow.xaml.cs">
<DependentUpon>NoNonClientAreaDragableWindow.xaml</DependentUpon>
</Compile>
<Page Include="MainWindow.xaml"> <Page Include="MainWindow.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType> <SubType>Designer</SubType>
@@ -664,6 +667,10 @@
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</Page> </Page>
<Page Include="Window\NoNonClientAreaDragableWindow.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs"> <Compile Include="Properties\AssemblyInfo.cs">
+1 -1
View File
@@ -12,4 +12,4 @@ using System.Windows;
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
[assembly: ComVisible(false)] [assembly: ComVisible(false)]
[assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)] [assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)]
[assembly: AssemblyVersion("1.5.1.*")] [assembly: AssemblyVersion("1.5.2.*")]
+27
View File
@@ -366,6 +366,15 @@ namespace HandyControlDemo.Properties.Langs {
} }
} }
/// <summary>
/// 查找类似 在这里拖拽 的本地化字符串。
/// </summary>
public static string DragHere {
get {
return ResourceManager.GetString("DragHere", resourceCulture);
}
}
/// <summary> /// <summary>
/// 查找类似 邮箱 的本地化字符串。 /// 查找类似 邮箱 的本地化字符串。
/// </summary> /// </summary>
@@ -582,6 +591,15 @@ namespace HandyControlDemo.Properties.Langs {
} }
} }
/// <summary>
/// 查找类似 消息框 的本地化字符串。
/// </summary>
public static string MessageBox {
get {
return ResourceManager.GetString("MessageBox", resourceCulture);
}
}
/// <summary> /// <summary>
/// 查找类似 名称 的本地化字符串。 /// 查找类似 名称 的本地化字符串。
/// </summary> /// </summary>
@@ -672,6 +690,15 @@ namespace HandyControlDemo.Properties.Langs {
} }
} }
/// <summary>
/// 查找类似 打开无非客户端区域可拖拽窗口 的本地化字符串。
/// </summary>
public static string OpenNoNonClientAreaDragableWindow {
get {
return ResourceManager.GetString("OpenNoNonClientAreaDragableWindow", resourceCulture);
}
}
/// <summary> /// <summary>
/// 查找类似 轮廓文本 的本地化字符串。 /// 查找类似 轮廓文本 的本地化字符串。
/// </summary> /// </summary>
@@ -464,5 +464,13 @@
</data> </data>
<data name="PlsEnterKey" xml:space="preserve"> <data name="PlsEnterKey" xml:space="preserve">
<value>Please input a keyword</value> <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> </data>
</root> </root>
+78 -50
View File
@@ -1,76 +1,96 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<root> <root>
<!-- <!--
Microsoft ResX Schema Microsoft ResX Schema
Version 1.3 Version 2.0
The primary goals of this format is to allow a simple XML format The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes various data types are done through the TypeConverter classes
associated with the data types. associated with the data types.
Example: Example:
... ado.net/XML headers & schema ... ... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader> <resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">1.3</resheader> <resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, 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="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="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
[base64 mime encoded serialized .NET Framework object] <value>[base64 mime encoded serialized .NET Framework object]</value>
</data> </data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <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] <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
</data> <comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple There are any number of "resheader" rows that contain simple
name/value pairs. name/value pairs.
Each data row contains a name, and value. The row also contains a Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture. text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the Classes that don't support this are serialized and stored with the
mimetype set. mimetype set.
The mimetype is used for serialized objects, and tells the The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly: extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below. read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64 mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding. : and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64 mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding. : and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64 mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter : using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding. : 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: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:element name="root" msdata:IsDataSet="true">
<xsd:complexType> <xsd:complexType>
<xsd:choice maxOccurs="unbounded"> <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:element name="data">
<xsd:complexType> <xsd:complexType>
<xsd:sequence> <xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> <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:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence> </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="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType> </xsd:complexType>
</xsd:element> </xsd:element>
<xsd:element name="resheader"> <xsd:element name="resheader">
@@ -89,13 +109,13 @@
<value>text/microsoft-resx</value> <value>text/microsoft-resx</value>
</resheader> </resheader>
<resheader name="version"> <resheader name="version">
<value>1.3</value> <value>2.0</value>
</resheader> </resheader>
<resheader name="reader"> <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>
<resheader name="writer"> <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> </resheader>
<data name="Controls" xml:space="preserve"> <data name="Controls" xml:space="preserve">
<value>控件</value> <value>控件</value>
@@ -444,5 +464,13 @@
</data> </data>
<data name="PlsEnterKey" xml:space="preserve"> <data name="PlsEnterKey" xml:space="preserve">
<value>请输入关键字</value> <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> </data>
</root> </root>
@@ -14,8 +14,8 @@
<RowDefinition/> <RowDefinition/>
<RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Image Source="{Binding Source,RelativeSource={RelativeSource FindAncestor,AncestorType=UserControl}}" Height="120" Width="120" Stretch="Uniform" Margin="10"/> <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 FindAncestor,AncestorType=UserControl}}"></TextBlock> <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> </Grid>
</Border> </Border>
</Button> </Button>
@@ -2,7 +2,7 @@
using System.Windows; using System.Windows;
using System.Windows.Media.Imaging; using System.Windows.Media.Imaging;
// ReSharper disable once CheckNamespace
namespace HandyControlDemo.UserControl namespace HandyControlDemo.UserControl
{ {
public partial class Avatar public partial class Avatar
@@ -1,4 +1,4 @@
// ReSharper disable once CheckNamespace
namespace HandyControlDemo.UserControl namespace HandyControlDemo.UserControl
{ {
public partial class AnimationPathDemoCtl public partial class AnimationPathDemoCtl
@@ -1,4 +1,4 @@
// ReSharper disable once CheckNamespace
namespace HandyControlDemo.UserControl namespace HandyControlDemo.UserControl
{ {
public partial class CarouselDemoCtl public partial class CarouselDemoCtl
@@ -1,4 +1,4 @@
// ReSharper disable once CheckNamespace
namespace HandyControlDemo.UserControl namespace HandyControlDemo.UserControl
{ {
public partial class CircleProgressBarDemoCtl public partial class CircleProgressBarDemoCtl
@@ -1,4 +1,4 @@
// ReSharper disable once CheckNamespace
namespace HandyControlDemo.UserControl namespace HandyControlDemo.UserControl
{ {
public partial class ClockDemoCtl public partial class ClockDemoCtl
@@ -1,4 +1,4 @@
// ReSharper disable once CheckNamespace
namespace HandyControlDemo.UserControl namespace HandyControlDemo.UserControl
{ {
public partial class ColorPickerDemoCtl public partial class ColorPickerDemoCtl
@@ -1,4 +1,4 @@
// ReSharper disable once CheckNamespace
namespace HandyControlDemo.UserControl namespace HandyControlDemo.UserControl
{ {
public partial class CompareSliderDemoCtl public partial class CompareSliderDemoCtl
@@ -1,4 +1,4 @@
// ReSharper disable once CheckNamespace
namespace HandyControlDemo.UserControl namespace HandyControlDemo.UserControl
{ {
/// <summary> /// <summary>
@@ -1,4 +1,4 @@
// ReSharper disable once CheckNamespace
namespace HandyControlDemo.UserControl namespace HandyControlDemo.UserControl
{ {
/// <summary> /// <summary>
@@ -1,4 +1,4 @@
// ReSharper disable once CheckNamespace
namespace HandyControlDemo.UserControl namespace HandyControlDemo.UserControl
{ {
public partial class LoadingDemoCtl public partial class LoadingDemoCtl
@@ -1,6 +1,6 @@
using HandyControl.Data; using HandyControl.Data;
// ReSharper disable once CheckNamespace
namespace HandyControlDemo.UserControl namespace HandyControlDemo.UserControl
{ {
public partial class NumericUpDownDemoCtl 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 IsReadOnly="True" Width="600" Margin="0,16,0,0" Grid.Row="1" HeadersVisibility="All" RowHeaderWidth="60" AutoGenerateColumns="False" ItemsSource="{Binding DataList}">
<DataGrid.RowHeaderTemplate> <DataGrid.RowHeaderTemplate>
<DataTemplate> <DataTemplate>
<CheckBox IsChecked="{Binding IsSelected,RelativeSource={RelativeSource FindAncestor,AncestorType=DataGridRow}}"/> <CheckBox IsChecked="{Binding IsSelected,RelativeSource={RelativeSource AncestorType=DataGridRow}}"/>
</DataTemplate> </DataTemplate>
</DataGrid.RowHeaderTemplate> </DataGrid.RowHeaderTemplate>
<DataGrid.Columns> <DataGrid.Columns>
@@ -1,4 +1,4 @@
// ReSharper disable once CheckNamespace
namespace HandyControlDemo.UserControl namespace HandyControlDemo.UserControl
{ {
public partial class PaginationDemoCtl public partial class PaginationDemoCtl
@@ -1,4 +1,4 @@
// ReSharper disable once CheckNamespace
namespace HandyControlDemo.UserControl namespace HandyControlDemo.UserControl
{ {
public partial class PreviewSliderDemoCtl public partial class PreviewSliderDemoCtl
@@ -1,4 +1,4 @@
// ReSharper disable once CheckNamespace
namespace HandyControlDemo.UserControl namespace HandyControlDemo.UserControl
{ {
public partial class ScrollViewerDemoCtl public partial class ScrollViewerDemoCtl
@@ -1,4 +1,4 @@
// ReSharper disable once CheckNamespace
namespace HandyControlDemo.UserControl namespace HandyControlDemo.UserControl
{ {
/// <summary> /// <summary>
@@ -1,4 +1,4 @@
// ReSharper disable once CheckNamespace
namespace HandyControlDemo.UserControl namespace HandyControlDemo.UserControl
{ {
public partial class TabControlDemoCtl public partial class TabControlDemoCtl
@@ -1,4 +1,4 @@
// ReSharper disable once CheckNamespace
namespace HandyControlDemo.UserControl namespace HandyControlDemo.UserControl
{ {
public partial class TimeBarDemoCtl public partial class TimeBarDemoCtl
@@ -7,13 +7,14 @@
DataContext="{Binding WindowDemo,Source={StaticResource Locator}}" DataContext="{Binding WindowDemo,Source={StaticResource Locator}}"
Background="{DynamicResource RegionBrush}"> Background="{DynamicResource RegionBrush}">
<controls:TransitioningContentControl> <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.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.BlurWindow}" Content="{x:Static langs:Lang.OpenBlurWindow}"/>
<Button Command="{Binding OpenWindowCmd}" CommandParameter="{x:Static data:MessageToken.CustomNonClientAreaWindow}" Content="{x:Static langs:Lang.OpenCustomNonClientAreaWindow}"/> <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="ButtonMessage_OnClick" Content="{x:Static langs:Lang.OpenMessageWindow}"/>
<Button Click="ButtonCustomContent_OnClick" Content="{x:Static langs:Lang.OpenCustomContentWindow}"/> <Button Click="ButtonCustomContent_OnClick" Content="{x:Static langs:Lang.OpenCustomContentWindow}"/>
<Button Name="ButtonMouseFollow" Click="ButtonMouseFollow_OnClick" Content="{x:Static langs:Lang.OpenMouseFollowWindow}"/> <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> </UniformGrid>
</controls:TransitioningContentControl> </controls:TransitioningContentControl>
</UserControl> </UserControl>
@@ -1,8 +1,9 @@
using System.Windows; using System.Windows;
using HandyControl.Controls; using HandyControl.Controls;
using HandyControl.Tools; using HandyControl.Tools;
using MessageBox = HandyControl.Controls.MessageBox;
// ReSharper disable once CheckNamespace
namespace HandyControlDemo.UserControl namespace HandyControlDemo.UserControl
{ {
public partial class WindowDemoCtl public partial class WindowDemoCtl
@@ -14,7 +15,7 @@ namespace HandyControlDemo.UserControl
private void ButtonMessage_OnClick(object sender, RoutedEventArgs e) 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) private void ButtonMouseFollow_OnClick(object sender, RoutedEventArgs e)
@@ -1,4 +1,4 @@
// ReSharper disable once CheckNamespace
namespace HandyControlDemo.UserControl namespace HandyControlDemo.UserControl
{ {
public partial class ContributorsView public partial class ContributorsView
@@ -4,7 +4,7 @@
x:Class="HandyControlDemo.UserControl.LeftMainContent" x:Class="HandyControlDemo.UserControl.LeftMainContent"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:data="clr-namespace:HandyControlDemo.Data" 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:controls="clr-namespace:HandyControl.Controls;assembly=HandyControl"
xmlns:langs="clr-namespace:HandyControlDemo.Properties.Langs" xmlns:langs="clr-namespace:HandyControlDemo.Properties.Langs"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"> xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
@@ -352,7 +352,7 @@
<Image Source="../../Resources/Img/LeftMainContent/ScrollBox_16x.png"/> <Image Source="../../Resources/Img/LeftMainContent/ScrollBox_16x.png"/>
</controls:EdgeElement.LeftContent> </controls:EdgeElement.LeftContent>
</ListBoxItem> </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> <controls:EdgeElement.LeftContent>
<Image Source="../../Resources/Img/LeftMainContent/WindowsForm_16x.png"/> <Image Source="../../Resources/Img/LeftMainContent/WindowsForm_16x.png"/>
</controls:EdgeElement.LeftContent> </controls:EdgeElement.LeftContent>
@@ -5,7 +5,7 @@ using System.Windows.Controls;
using HandyControl.Data; using HandyControl.Data;
using HandyControl.Tools.Extension; using HandyControl.Tools.Extension;
// ReSharper disable once CheckNamespace
namespace HandyControlDemo.UserControl namespace HandyControlDemo.UserControl
{ {
/// <summary> /// <summary>
@@ -3,7 +3,7 @@ using GalaSoft.MvvmLight.Messaging;
using HandyControl.Tools.Extension; using HandyControl.Tools.Extension;
using HandyControlDemo.Data; using HandyControlDemo.Data;
// ReSharper disable once CheckNamespace
namespace HandyControlDemo.UserControl namespace HandyControlDemo.UserControl
{ {
/// <summary> /// <summary>
@@ -10,7 +10,7 @@ using HandyControlDemo.Data;
using HandyControlDemo.Tools; using HandyControlDemo.Tools;
using HandyControlDemo.Window; using HandyControlDemo.Window;
// ReSharper disable once CheckNamespace
namespace HandyControlDemo.UserControl namespace HandyControlDemo.UserControl
{ {
public partial class NoUserContent public partial class NoUserContent
@@ -1,4 +1,4 @@
// ReSharper disable once CheckNamespace
namespace HandyControlDemo.UserControl namespace HandyControlDemo.UserControl
{ {
public partial class BorderDemoCtl public partial class BorderDemoCtl
@@ -1,4 +1,4 @@
// ReSharper disable once CheckNamespace
namespace HandyControlDemo.UserControl namespace HandyControlDemo.UserControl
{ {
public partial class BrushDemoCtl public partial class BrushDemoCtl
@@ -1,4 +1,4 @@
// ReSharper disable once CheckNamespace
namespace HandyControlDemo.UserControl namespace HandyControlDemo.UserControl
{ {
/// <summary> /// <summary>
@@ -1,4 +1,4 @@
// ReSharper disable once CheckNamespace
namespace HandyControlDemo.UserControl namespace HandyControlDemo.UserControl
{ {
public partial class CalendarDemoCtl public partial class CalendarDemoCtl
@@ -1,4 +1,4 @@
// ReSharper disable once CheckNamespace
namespace HandyControlDemo.UserControl namespace HandyControlDemo.UserControl
{ {
public partial class CheckBoxDemoCtl public partial class CheckBoxDemoCtl
@@ -11,7 +11,7 @@
<DataGrid HeadersVisibility="All" RowHeaderWidth="60" AutoGenerateColumns="False" ItemsSource="{Binding DataList}"> <DataGrid HeadersVisibility="All" RowHeaderWidth="60" AutoGenerateColumns="False" ItemsSource="{Binding DataList}">
<DataGrid.RowHeaderTemplate> <DataGrid.RowHeaderTemplate>
<DataTemplate> <DataTemplate>
<CheckBox IsChecked="{Binding IsSelected,RelativeSource={RelativeSource FindAncestor,AncestorType=DataGridRow}}"/> <CheckBox IsChecked="{Binding IsSelected,RelativeSource={RelativeSource AncestorType=DataGridRow}}"/>
</DataTemplate> </DataTemplate>
</DataGrid.RowHeaderTemplate> </DataGrid.RowHeaderTemplate>
<DataGrid.Columns> <DataGrid.Columns>
@@ -1,4 +1,4 @@
// ReSharper disable once CheckNamespace
namespace HandyControlDemo.UserControl namespace HandyControlDemo.UserControl
{ {
public partial class DataGridDemoCtl 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