Modified Window Style

This commit is contained in:
NaBian committed 2019-06-15 00:06:42 +08:00
1 parent d26b4693c2
commit 82cf0bfcdb
23 files changed
+39 -36

No files matched your search

@@ -246,7 +246,7 @@ namespace HandyControl.Controls
{
if (show)
{
for (int i = 0; i < itemsCount; i++)
for (var i = 0; i < itemsCount; i++)
{
var row = (DataGridRow)generator.ContainerFromIndex(i);
if (row != null)
@@ -257,7 +257,7 @@ namespace HandyControl.Controls
}
else
{
for (int i = 0; i < itemsCount; i++)
for (var i = 0; i < itemsCount; i++)
{
var row = (DataGridRow)generator.ContainerFromIndex(i);
if (row != null)
@@ -333,7 +333,7 @@ namespace HandyControl.Controls
}
var list = new List<bool>();
for (int i = 0; i < 2; i++)
for (var i = 0; i < 2; i++)
{
list.Add(false);
}
@@ -321,7 +321,7 @@ namespace HandyControl.Controls
try
{
for (int i = 0; i < count; i++)
for (var i = 0; i < count; i++)
{
guids[i] = (Guid)ExternDllHelper.PtrToStructure((IntPtr)((long)buffer + size * i), typeof(Guid));
}
@@ -36,11 +36,11 @@ namespace HandyControl.Controls
public static readonly DependencyProperty DotCountProperty = DependencyProperty.Register(
"DotCount", typeof(int), typeof(LoadingBase),
new FrameworkPropertyMetadata(5, FrameworkPropertyMetadataOptions.AffectsRender));
new FrameworkPropertyMetadata(ValueBoxes.Int5Box, FrameworkPropertyMetadataOptions.AffectsRender));
public static readonly DependencyProperty DotIntervalProperty = DependencyProperty.Register(
"DotInterval", typeof(double), typeof(LoadingBase),
new FrameworkPropertyMetadata(10.0, FrameworkPropertyMetadataOptions.AffectsRender));
new FrameworkPropertyMetadata(ValueBoxes.Double10Box, FrameworkPropertyMetadataOptions.AffectsRender));
public static readonly DependencyProperty DotBorderBrushProperty = DependencyProperty.Register(
"DotBorderBrush", typeof(Brush), typeof(LoadingBase),
@@ -122,7 +122,7 @@ namespace HandyControl.Controls
StretchProperty.AddOwner(typeof(AnimationPath), new FrameworkPropertyMetadata(Stretch.Uniform,
OnPropertiesChanged));
StrokeThicknessProperty.AddOwner(typeof(AnimationPath), new FrameworkPropertyMetadata(1.0,
StrokeThicknessProperty.AddOwner(typeof(AnimationPath), new FrameworkPropertyMetadata(ValueBoxes.Double1Box,
OnPropertiesChanged));
}
@@ -82,7 +82,7 @@ namespace HandyControl.Controls
/// 最大页数
/// </summary>
public static readonly DependencyProperty MaxPageCountProperty = DependencyProperty.Register(
"MaxPageCount", typeof(int), typeof(Pagination), new PropertyMetadata(1, (o, args) =>
"MaxPageCount", typeof(int), typeof(Pagination), new PropertyMetadata(ValueBoxes.Int1Box, (o, args) =>
{
if (o is Pagination pagination && args.NewValue is int value)
{
@@ -156,7 +156,7 @@ namespace HandyControl.Controls
/// 当前页
/// </summary>
public static readonly DependencyProperty PageIndexProperty = DependencyProperty.Register(
"PageIndex", typeof(int), typeof(Pagination), new PropertyMetadata(1, (o, args) =>
"PageIndex", typeof(int), typeof(Pagination), new PropertyMetadata(ValueBoxes.Int1Box, (o, args) =>
{
if (o is Pagination pagination && args.NewValue is int value)
{
@@ -312,7 +312,7 @@ namespace HandyControl.Controls
}
var sub = PageIndex;
for (int i = 0; i < MaxPageInterval - 1; i++)
for (var i = 0; i < MaxPageInterval - 1; i++)
{
if (--sub > 1)
{
@@ -324,7 +324,7 @@ namespace HandyControl.Controls
}
}
var add = PageIndex;
for (int i = 0; i < MaxPageInterval - 1; i++)
for (var i = 0; i < MaxPageInterval - 1; i++)
{
if (++add < MaxPageCount)
{
@@ -33,7 +33,7 @@ namespace HandyControl.Controls
base.OnVisualChildrenChanged(visualAdded, visualRemoved);
var count = Items.Count;
for (int i = 0; i < count; i++)
for (var i = 0; i < count; i++)
{
var item = (RadioButton)Items[i];
item.Style = ItemStyleSelector?.SelectStyle(item, this);
@@ -353,7 +353,7 @@ namespace HandyControl.Controls
{
if (_visualChildren == null) return 0;
for (int i = 0; i < _visualChildren.Length; i++)
for (var i = 0; i < _visualChildren.Length; i++)
{
if (_visualChildren[i] == null) return i;
}
@@ -38,7 +38,7 @@ namespace HandyControl.Controls
var count = Items.Count;
if (count <= 0) return;
for (int i = 0; i < count; i++)
for (var i = 0; i < count; i++)
{
if (ItemContainerGenerator.ContainerFromIndex(i) is StepBarItem stepBarItem)
{
@@ -48,7 +48,7 @@ namespace HandyControl.Controls
if (StepIndex < count)
{
for (int i = 0; i < StepIndex; i++)
for (var i = 0; i < StepIndex; i++)
{
if (ItemContainerGenerator.ContainerFromIndex(i) is StepBarItem stepBarItem)
{
@@ -102,7 +102,7 @@ namespace HandyControl.Controls
private void CreateItemsSource(ItemsControl selector, int count)
{
var list = new List<string>();
for (int i = 0; i < count; i++)
for (var i = 0; i < count; i++)
{
list.Add(i.ToString("#00"));
}
@@ -9,7 +9,6 @@ using HandyControl.Tools.Extension;
using Microsoft.Windows.Shell;
#else
using System.Windows.Shell;
#endif
namespace HandyControl.Controls
@@ -66,7 +66,7 @@ namespace HandyControl.Data
//
var values = frameDelayItem.Value;
_frameDelay = new int[FrameCount];
for (int i = 0; i < FrameCount; ++i)
for (var i = 0; i < FrameCount; ++i)
{
_frameDelay[i] = values[i * 4] + 256 * values[i * 4 + 1] + 256 * 256 * values[i * 4 + 2] + 256 * 256 * 256 * values[i * 4 + 3];
}
@@ -59,7 +59,7 @@ namespace HandyControl.Expression.Drawing
}
else
{
for (int i = list.Count - 1; i >= count; i--)
for (var i = list.Count - 1; i >= count; i--)
{
list.RemoveAt(i);
}
@@ -89,7 +89,7 @@ namespace HandyControl.Expression.Drawing
}
else
{
for (int i = list.Count; i < count; i++)
for (var i = list.Count; i < count; i++)
{
list.Add((factory == null) ? default(T) : factory());
}
@@ -2,6 +2,7 @@
using System.Windows;
using System.Windows.Media;
using System.Windows.Shapes;
using HandyControl.Data;
using HandyControl.Expression.Drawing;
using HandyControl.Expression.Media;
@@ -16,7 +17,7 @@ namespace HandyControl.Expression.Shapes
StretchProperty.OverrideMetadata(typeof(PrimitiveShape),
new DrawingPropertyMetadata(Stretch.Fill, DrawingPropertyMetadataOptions.AffectsRender));
StrokeThicknessProperty.OverrideMetadata(typeof(PrimitiveShape),
new DrawingPropertyMetadata(1.0, DrawingPropertyMetadataOptions.AffectsRender));
new DrawingPropertyMetadata(ValueBoxes.Double1Box, DrawingPropertyMetadataOptions.AffectsRender));
}
protected sealed override Geometry DefiningGeometry =>
@@ -162,7 +162,7 @@ namespace HandyControl.Tools
try
{
// Find the corresponding reference and remove it
for (int i = 0; i < ImageInfoList.Count; i++)
for (var i = 0; i < ImageInfoList.Count; i++)
{
var imageInfo = ImageInfoList[i];
@@ -27,23 +27,23 @@ namespace HandyControl.Tools
}
var index = 0;
for (int i = 0; i < 2; i++)
for (var i = 0; i < 2; i++)
{
for (int j = 0; j < 5; j++, index++)
for (var j = 0; j < 5; j++, index++)
{
AddRec(i, j, renderData[index] == 0);
}
}
for (int j = 0; j < 5; j++, index++)
for (var j = 0; j < 5; j++, index++)
{
AddRec(2, j, renderData[index] == 0);
}
index -= 10;
for (int i = 3; i < 5; i++)
for (var i = 3; i < 5; i++)
{
for (int j = 0; j < 5; j++, index++)
for (var j = 0; j < 5; j++, index++)
{
AddRec(i, j, renderData[index] == 0);
}
@@ -78,7 +78,7 @@ namespace HandyControl.Tools
private int[] GetRenderData(string hashcode)
{
var arr = new int[RenderDataMaxLength];
for (int i = 0; i < RenderDataMaxLength; i++)
for (var i = 0; i < RenderDataMaxLength; i++)
{
var c = hashcode[i];
var v = (int) c;
@@ -22,11 +22,11 @@ namespace HandyControl.Tools
var arr = new int[count];
var div = num / count;
var rest = num % count;
for (int i = 0; i < count; i++)
for (var i = 0; i < count; i++)
{
arr[i] = div;
}
for (int i = 0; i < rest; i++)
for (var i = 0; i < rest; i++)
{
arr[i] += 1;
}
@@ -197,7 +197,7 @@ namespace HandyControl.Tools
var isBitmapIconDecoder = frames[0].Decoder is IconBitmapDecoder;
for (int i = 0; i < frames.Count && bestScore != 0; ++i)
for (var i = 0; i < frames.Count && bestScore != 0; ++i)
{
var currentIconBitDepth = isBitmapIconDecoder ? frames[i].Thumbnail.Format.BitsPerPixel : frames[i].Format.BitsPerPixel;
@@ -34,7 +34,7 @@ namespace HandyControl.Tools
return t;
}
for (int i = 0; i < VisualTreeHelper.GetChildrenCount(d); i++)
for (var i = 0; i < VisualTreeHelper.GetChildrenCount(d); i++)
{
var child = VisualTreeHelper.GetChild(d, i);