mirror of
https://gitee.com/handyorg/HandyControl.git
synced 2024-11-29 18:38:30 +08:00
completed the branch
This commit is contained in:
parent
7dd3f7183c
commit
029c81438d
10
README.md
10
README.md
@ -63,6 +63,12 @@ Step 4:enjoy coding
|
||||
|
||||
## Latest examples
|
||||
|
||||
### ImageBlock
|
||||
|
||||
![ImageBlock](https://raw.githubusercontent.com/NaBian/HandyControl/master/Resources/ImageBlock.gif)
|
||||
|
||||
![ImageBlock](https://raw.githubusercontent.com/NaBian/HandyControl/master/Resources/ImageBlock.png)
|
||||
|
||||
### Magnifier
|
||||
|
||||
![Magnifier](https://raw.githubusercontent.com/NaBian/HandyControl/master/Resources/Magnifier.png)
|
||||
@ -75,6 +81,8 @@ Step 4:enjoy coding
|
||||
|
||||
![ButtonGroup](https://raw.githubusercontent.com/NaBian/HandyControl/master/Resources/ButtonGroup.png)
|
||||
|
||||
## History publication
|
||||
|
||||
### Grid
|
||||
|
||||
![Grid](https://raw.githubusercontent.com/NaBian/HandyControl/master/Resources/Grid.gif)
|
||||
@ -83,8 +91,6 @@ Step 4:enjoy coding
|
||||
|
||||
![SideMenu](https://raw.githubusercontent.com/NaBian/HandyControl/master/Resources/SideMenu.png)
|
||||
|
||||
## History publication
|
||||
|
||||
### NotifyIcon
|
||||
|
||||
![NotifyIcon](https://raw.githubusercontent.com/NaBian/HandyControl/master/Resources/NotifyIcon.png)
|
||||
|
BIN
Resources/ImageBlock.gif
Normal file
BIN
Resources/ImageBlock.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 220 KiB |
BIN
Resources/ImageBlock.png
Normal file
BIN
Resources/ImageBlock.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 158 KiB |
@ -5,7 +5,7 @@
|
||||
<UseWPF>true</UseWPF>
|
||||
<AssemblyName>HandyControlDemo</AssemblyName>
|
||||
<RootNamespace>HandyControlDemo</RootNamespace>
|
||||
<Version>2.0.0</Version>
|
||||
<Version>2.1.0</Version>
|
||||
<ApplicationIcon>..\..\Shared\HandyControlDemo_Shared\Resources\Img\icon.ico</ApplicationIcon>
|
||||
<Configurations>Debug;Release</Configurations>
|
||||
<Copyright>Copyright © HandyOrg 2018-2019</Copyright>
|
||||
|
@ -4,7 +4,7 @@
|
||||
<UseWPF>true</UseWPF>
|
||||
<AssemblyName>HandyControl</AssemblyName>
|
||||
<RootNamespace>HandyControl</RootNamespace>
|
||||
<Version>2.0.0</Version>
|
||||
<Version>2.1.0</Version>
|
||||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||||
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
|
||||
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
|
||||
|
@ -13,5 +13,5 @@ using System.Windows;
|
||||
[assembly: AssemblyCulture("")]
|
||||
[assembly: ComVisible(false)]
|
||||
[assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)]
|
||||
[assembly: AssemblyVersion("2.0.0")]
|
||||
[assembly: AssemblyVersion("2.1.0")]
|
||||
#endif
|
@ -1,18 +1,20 @@
|
||||
<UserControl x:Class="HandyControlDemo.UserControl.ImageBlockDemoCtl"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:userControl="clr-namespace:HandyControlDemo.UserControl"
|
||||
Background="{DynamicResource RegionBrush}"
|
||||
xmlns:hc="https://handyorg.github.io/handycontrol">
|
||||
<UniformGrid Rows="3" Columns="4">
|
||||
<hc:ImageBlock Source="/HandyControlDemo;component/Resources/Img/Dance.png" Interval="0:0:0.125" Columns="8" Rows="10" StartColumn="0" StartRow="0" EndColumn="7" EndRow="0" Width="110" Height="128"/>
|
||||
<hc:ImageBlock Source="/HandyControlDemo;component/Resources/Img/Dance.png" Interval="0:0:0.125" Columns="8" Rows="10" StartColumn="0" StartRow="1" EndColumn="7" EndRow="1" Width="110" Height="128"/>
|
||||
<hc:ImageBlock Source="/HandyControlDemo;component/Resources/Img/Dance.png" Interval="0:0:0.125" Columns="8" Rows="10" StartColumn="0" StartRow="2" EndColumn="7" EndRow="2" Width="110" Height="128"/>
|
||||
<hc:ImageBlock Source="/HandyControlDemo;component/Resources/Img/Dance.png" Interval="0:0:0.125" Columns="8" Rows="10" StartColumn="0" StartRow="3" EndColumn="7" EndRow="3" Width="110" Height="128"/>
|
||||
<hc:ImageBlock Source="/HandyControlDemo;component/Resources/Img/Dance.png" Interval="0:0:0.125" Columns="8" Rows="10" StartColumn="0" StartRow="4" EndColumn="7" EndRow="4" Width="110" Height="128"/>
|
||||
<hc:ImageBlock Source="/HandyControlDemo;component/Resources/Img/Dance.png" Interval="0:0:0.125" Columns="8" Rows="10" StartColumn="0" StartRow="5" EndColumn="7" EndRow="5" Width="110" Height="128"/>
|
||||
<hc:ImageBlock Source="/HandyControlDemo;component/Resources/Img/Dance.png" Interval="0:0:0.125" Columns="8" Rows="10" StartColumn="0" StartRow="6" EndColumn="7" EndRow="6" Width="110" Height="128"/>
|
||||
<hc:ImageBlock Source="/HandyControlDemo;component/Resources/Img/Dance.png" Interval="0:0:0.125" Columns="8" Rows="10" StartColumn="0" StartRow="7" EndColumn="7" EndRow="7" Width="110" Height="128"/>
|
||||
<hc:ImageBlock Source="/HandyControlDemo;component/Resources/Img/Dance.png" Interval="0:0:0.125" Columns="8" Rows="10" StartColumn="0" StartRow="8" EndColumn="7" EndRow="8" Width="110" Height="128"/>
|
||||
<hc:ImageBlock Source="/HandyControlDemo;component/Resources/Img/Dance.png" Interval="0:0:0.125" Columns="8" Rows="10" StartColumn="0" StartRow="9" EndColumn="7" EndRow="9" Width="110" Height="128"/>
|
||||
</UniformGrid>
|
||||
<hc:TransitioningContentControl>
|
||||
<UniformGrid Rows="3" Columns="4" Margin="32">
|
||||
<hc:ImageBlock Source="/HandyControlDemo;component/Resources/Img/Dance.png" Interval="0:0:0.125" Columns="8" Rows="10" StartColumn="0" StartRow="0" Width="110" Height="128"/>
|
||||
<hc:ImageBlock Source="/HandyControlDemo;component/Resources/Img/Dance.png" Interval="0:0:0.125" Columns="8" Rows="10" StartColumn="0" StartRow="1" Width="110" Height="128"/>
|
||||
<hc:ImageBlock Source="/HandyControlDemo;component/Resources/Img/Dance.png" Interval="0:0:0.125" Columns="8" Rows="10" StartColumn="0" StartRow="2" Width="110" Height="128"/>
|
||||
<hc:ImageBlock Source="/HandyControlDemo;component/Resources/Img/Dance.png" Interval="0:0:0.125" Columns="8" Rows="10" StartColumn="0" StartRow="3" Width="110" Height="128"/>
|
||||
<hc:ImageBlock Source="/HandyControlDemo;component/Resources/Img/Dance.png" Interval="0:0:0.1" Columns="8" Rows="10" StartColumn="0" StartRow="4" EndColumn="7" EndRow="4" Width="110" Height="128" IsPlaying="True"/>
|
||||
<hc:ImageBlock Source="/HandyControlDemo;component/Resources/Img/Dance.png" Interval="0:0:0.125" Columns="8" Rows="10" StartColumn="0" StartRow="5" EndColumn="7" EndRow="5" Width="110" Height="128" IsPlaying="True"/>
|
||||
<hc:ImageBlock Source="/HandyControlDemo;component/Resources/Img/Dance.png" Interval="0:0:0.125" Columns="8" Rows="10" StartColumn="0" StartRow="6" Width="110" Height="128"/>
|
||||
<hc:ImageBlock Source="/HandyControlDemo;component/Resources/Img/Dance.png" Interval="0:0:0.1" Columns="8" Rows="10" StartColumn="0" StartRow="7" EndColumn="7" EndRow="7" Width="110" Height="128" IsPlaying="True"/>
|
||||
<hc:ImageBlock Source="/HandyControlDemo;component/Resources/Img/Dance.png" Interval="0:0:0.125" Columns="8" Rows="10" StartColumn="0" StartRow="8" Width="110" Height="128"/>
|
||||
<hc:ImageBlock Source="/HandyControlDemo;component/Resources/Img/Dance.png" Interval="0:0:0.125" Columns="8" Rows="10" StartColumn="0" StartRow="9" Width="110" Height="128"/>
|
||||
</UniformGrid>
|
||||
</hc:TransitioningContentControl>
|
||||
</UserControl>
|
@ -24,25 +24,13 @@ namespace HandyControl.Controls
|
||||
Interval = Interval
|
||||
};
|
||||
_dispatcherTimer.Tick += DispatcherTimer_Tick;
|
||||
_dispatcherTimer.Start();
|
||||
}
|
||||
|
||||
protected override void OnRenderSizeChanged(SizeChangedInfo sizeInfo)
|
||||
{
|
||||
base.OnRenderSizeChanged(sizeInfo);
|
||||
OnPositionsChanged();
|
||||
}
|
||||
|
||||
private void DispatcherTimer_Tick(object sender, EventArgs e) => InvalidateVisual();
|
||||
|
||||
public static readonly DependencyProperty StartColumnProperty = DependencyProperty.Register(
|
||||
"StartColumn", typeof(int), typeof(ImageBlock), new FrameworkPropertyMetadata(ValueBoxes.Int0Box,
|
||||
FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsRender, OnPositionsChanged));
|
||||
|
||||
private void OnPositionsChanged()
|
||||
{
|
||||
_indexMin = StartRow * Columns + StartColumn;
|
||||
_indexMax = EndRow * Columns + EndColumn;
|
||||
_currentIndex = _indexMin;
|
||||
}
|
||||
|
||||
private static void OnPositionsChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
@ -51,6 +39,12 @@ namespace HandyControl.Controls
|
||||
ctl.OnPositionsChanged();
|
||||
}
|
||||
|
||||
private void DispatcherTimer_Tick(object sender, EventArgs e) => InvalidateVisual();
|
||||
|
||||
public static readonly DependencyProperty StartColumnProperty = DependencyProperty.Register(
|
||||
"StartColumn", typeof(int), typeof(ImageBlock), new FrameworkPropertyMetadata(ValueBoxes.Int0Box,
|
||||
FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsRender, OnPositionsChanged));
|
||||
|
||||
public int StartColumn
|
||||
{
|
||||
get => (int) GetValue(StartColumnProperty);
|
||||
@ -88,13 +82,20 @@ namespace HandyControl.Controls
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty IsPlayingProperty = DependencyProperty.Register(
|
||||
"IsPlaying", typeof(bool), typeof(ImageBlock), new FrameworkPropertyMetadata(ValueBoxes.TrueBox,
|
||||
"IsPlaying", typeof(bool), typeof(ImageBlock), new FrameworkPropertyMetadata(ValueBoxes.FalseBox,
|
||||
FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsRender, OnIsPlayingChanged));
|
||||
|
||||
private static void OnIsPlayingChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
var ctl = (ImageBlock)d;
|
||||
ctl._dispatcherTimer.IsEnabled = (bool) e.NewValue;
|
||||
if ((bool) e.NewValue)
|
||||
{
|
||||
ctl._dispatcherTimer.Start();
|
||||
}
|
||||
else
|
||||
{
|
||||
ctl._dispatcherTimer.Stop();
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsPlaying
|
||||
|
@ -12,7 +12,7 @@ using System.Runtime.InteropServices;
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
[assembly: ComVisible(false)]
|
||||
[assembly: AssemblyVersion("2.0.0")]
|
||||
[assembly: AssemblyVersion("2.1.0")]
|
||||
#endif
|
||||
|
||||
[assembly: XmlnsDefinition("https://handyorg.github.io/handycontrol", "HandyControl.Controls")]
|
||||
|
Loading…
Reference in New Issue
Block a user