mirror of
https://gitee.com/handyorg/HandyControl.git
synced 2024-12-02 03:47:48 +08:00
ready for coverview
This commit is contained in:
parent
15d96290ad
commit
912a10b56d
9
HandyControl/Controls/CoverView/CoverView.cs
Normal file
9
HandyControl/Controls/CoverView/CoverView.cs
Normal file
@ -0,0 +1,9 @@
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace HandyControl.Controls
|
||||
{
|
||||
public class CoverView : ItemsControl
|
||||
{
|
||||
|
||||
}
|
||||
}
|
9
HandyControl/Controls/CoverView/CoverViewItem.cs
Normal file
9
HandyControl/Controls/CoverView/CoverViewItem.cs
Normal file
@ -0,0 +1,9 @@
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace HandyControl.Controls
|
||||
{
|
||||
public class CoverViewItem : HeaderedContentControl
|
||||
{
|
||||
|
||||
}
|
||||
}
|
@ -49,14 +49,25 @@ namespace HandyControl.Controls
|
||||
|
||||
protected override void OnMouseWheel(MouseWheelEventArgs e)
|
||||
{
|
||||
if (!CanMouseWheel) return;
|
||||
|
||||
if (!IsEnableInertia)
|
||||
{
|
||||
if (Orientation == Orientation.Vertical)
|
||||
{
|
||||
base.OnMouseWheel(e);
|
||||
}
|
||||
else
|
||||
{
|
||||
_totalHorizontalOffset = HorizontalOffset;
|
||||
CurrentHorizontalOffset = HorizontalOffset;
|
||||
_totalHorizontalOffset = Math.Min(Math.Max(0, _totalHorizontalOffset - e.Delta), ScrollableWidth);
|
||||
CurrentHorizontalOffset = _totalHorizontalOffset;
|
||||
}
|
||||
return;
|
||||
}
|
||||
e.Handled = true;
|
||||
|
||||
if (!CanMouseWheel) return;
|
||||
if (Orientation == Orientation.Vertical)
|
||||
{
|
||||
if (!_isRunning)
|
||||
|
@ -117,6 +117,7 @@
|
||||
<Compile Include="Controls\Attach\LinkElement.cs" />
|
||||
<Compile Include="Controls\Attach\PanelElement.cs" />
|
||||
<Compile Include="Controls\Attach\VisualElement.cs" />
|
||||
<Compile Include="Controls\CoverView\CoverViewItem.cs" />
|
||||
<Compile Include="Controls\Other\AnimationPath.cs" />
|
||||
<Compile Include="Controls\Attach\BackgroundSwitchElement.cs" />
|
||||
<Compile Include="Controls\Attach\BorderElement.cs" />
|
||||
@ -131,6 +132,7 @@
|
||||
<Compile Include="Controls\Button\ContextMenuButton.cs" />
|
||||
<Compile Include="Controls\Button\ContextMenuToggleButton.cs" />
|
||||
<Compile Include="Controls\Other\Carousel.cs" />
|
||||
<Compile Include="Controls\CoverView\CoverView.cs" />
|
||||
<Compile Include="Controls\Panel\CirclePanel.cs" />
|
||||
<Compile Include="Controls\Other\CircleProgressBar.cs" />
|
||||
<Compile Include="Controls\Other\RadioGroup.cs" />
|
||||
@ -375,6 +377,10 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Themes\Styles\Base\CoverViewBaseStyle.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Themes\Styles\Base\DatePickerBaseStyle.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
@ -407,6 +413,10 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Themes\Styles\CoverView.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Themes\Styles\FlipClock.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
|
13
HandyControl/Themes/Styles/Base/CoverViewBaseStyle.xaml
Normal file
13
HandyControl/Themes/Styles/Base/CoverViewBaseStyle.xaml
Normal file
@ -0,0 +1,13 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:controls="clr-namespace:HandyControl.Controls">
|
||||
|
||||
<Style x:Key="CoverViewItemBaseStyle" TargetType="controls:CoverViewItem">
|
||||
|
||||
</Style>
|
||||
|
||||
<Style x:Key="CoverViewBaseStyle" TargetType="controls:CoverView">
|
||||
<!--<Setter Property="item"/>-->
|
||||
</Style>
|
||||
|
||||
</ResourceDictionary>
|
4
HandyControl/Themes/Styles/CoverView.xaml
Normal file
4
HandyControl/Themes/Styles/CoverView.xaml
Normal file
@ -0,0 +1,4 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
|
||||
</ResourceDictionary>
|
@ -50,6 +50,7 @@
|
||||
<ResourceDictionary Source="FlipClock.xaml"/>
|
||||
<ResourceDictionary Source="Rate.xaml"/>
|
||||
<ResourceDictionary Source="Shield.xaml"/>
|
||||
<ResourceDictionary Source="CoverView.xaml"/>
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
|
||||
</ResourceDictionary>
|
@ -70,6 +70,8 @@
|
||||
|
||||
public static readonly string WaterfallPanelDemoCtl = nameof(WaterfallPanelDemoCtl);
|
||||
|
||||
public static readonly string CoverViewDemoCtl = nameof(CoverViewDemoCtl);
|
||||
|
||||
public static readonly string ButtonDemoCtl = nameof(ButtonDemoCtl);
|
||||
|
||||
public static readonly string ToggleButtonDemoCtl = nameof(ToggleButtonDemoCtl);
|
||||
|
@ -37,7 +37,8 @@ var controlList = new List<string>
|
||||
"BlurWindow",
|
||||
"RateDemoCtl",
|
||||
"ShieldDemoCtl",
|
||||
"WaterfallPanelDemoCtl"
|
||||
"WaterfallPanelDemoCtl",
|
||||
"CoverViewDemoCtl"
|
||||
};
|
||||
var styleList = new List<string>
|
||||
{
|
||||
|
@ -139,6 +139,9 @@
|
||||
<Compile Include="UserControl\Controls\CompareSliderDemoCtl.xaml.cs">
|
||||
<DependentUpon>CompareSliderDemoCtl.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="UserControl\Controls\CoverViewDemoCtl.xaml.cs">
|
||||
<DependentUpon>CoverViewDemoCtl.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="UserControl\Controls\DatePickerDemoCtl.xaml.cs">
|
||||
<DependentUpon>DatePickerDemoCtl.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@ -418,6 +421,10 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="UserControl\Controls\CoverViewDemoCtl.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="UserControl\Controls\DatePickerDemoCtl.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
@ -678,6 +685,7 @@
|
||||
<Generator>TextTemplatingFileGenerator</Generator>
|
||||
<LastGenOutput>MessageToken.cs</LastGenOutput>
|
||||
</Content>
|
||||
<Resource Include="Resources\Img\LeftMainContent\DetailDataView_16x.png" />
|
||||
<Resource Include="Resources\Img\LeftMainContent\Panel_16x.png" />
|
||||
<Resource Include="Resources\Img\LeftMainContent\Shield_16x.png" />
|
||||
<Resource Include="Resources\Img\LeftMainContent\Star.png" />
|
||||
|
11
HandyControlDemo/Properties/Langs/Lang.Designer.cs
generated
11
HandyControlDemo/Properties/Langs/Lang.Designer.cs
generated
@ -47,7 +47,7 @@ namespace HandyControlDemo.Properties.Langs {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 使用此强类型资源类,为所有资源查找
|
||||
/// 重写当前线程的 CurrentUICulture 属性
|
||||
/// 重写当前线程的 CurrentUICulture 属性。
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
@ -303,6 +303,15 @@ namespace HandyControlDemo.Properties.Langs {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 封面视图 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string CoverView {
|
||||
get {
|
||||
return ResourceManager.GetString("CoverView", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 危险 的本地化字符串。
|
||||
/// </summary>
|
||||
|
@ -456,4 +456,7 @@
|
||||
<data name="Groups" xml:space="preserve">
|
||||
<value>Groups</value>
|
||||
</data>
|
||||
<data name="CoverView" xml:space="preserve">
|
||||
<value>CoverView</value>
|
||||
</data>
|
||||
</root>
|
@ -436,4 +436,7 @@
|
||||
<data name="Groups" xml:space="preserve">
|
||||
<value>组数</value>
|
||||
</data>
|
||||
<data name="CoverView" xml:space="preserve">
|
||||
<value>封面视图</value>
|
||||
</data>
|
||||
</root>
|
Binary file not shown.
After Width: | Height: | Size: 129 B |
13
HandyControlDemo/UserControl/Controls/CoverViewDemoCtl.xaml
Normal file
13
HandyControlDemo/UserControl/Controls/CoverViewDemoCtl.xaml
Normal file
@ -0,0 +1,13 @@
|
||||
<UserControl x:Class="HandyControlDemo.UserControl.CoverViewDemoCtl"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:controls="clr-namespace:HandyControl.Controls;assembly=HandyControl"
|
||||
xmlns:interactivity="clr-namespace:HandyControl.Interactivity;assembly=HandyControl"
|
||||
Background="{DynamicResource RegionBrush}">
|
||||
<controls:TransitioningContentControl>
|
||||
<StackPanel Margin="32" VerticalAlignment="Center">
|
||||
<TextBlock Text="Under construction" Style="{StaticResource TextBlockLargeBold}"/>
|
||||
<Button Margin="0,32,0,0" Content="Target" Style="{StaticResource ButtonPrimary}" Width="180" Command="interactivity:ControlCommands.OpenLink" controls:LinkElement.Link="https://dribbble.com/shots/1538492-iTunes-Redesign/attachments/233957"/>
|
||||
</StackPanel>
|
||||
</controls:TransitioningContentControl>
|
||||
</UserControl>
|
@ -0,0 +1,10 @@
|
||||
namespace HandyControlDemo.UserControl
|
||||
{
|
||||
public partial class CoverViewDemoCtl
|
||||
{
|
||||
public CoverViewDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
@ -13,7 +13,7 @@
|
||||
</Grid.RowDefinitions>
|
||||
<controls:NumericUpDown x:Name="UpDownGroups" HorizontalAlignment="Center" Value="2" Minimum="1" Maximum="3" Width="200" Style="{StaticResource NumericUpDownExtend}" controls:TitleElement.Title="{x:Static langs:Lang.Groups}" controls:TitleElement.TitleWidth="50" controls:TitleElement.TitleAlignment="Left"/>
|
||||
<StackPanel Grid.Row="1" Orientation="Horizontal" Margin="0,16,0,0">
|
||||
<controls:ScrollViewer MaxHeight="300" IsEnableInertia="True">
|
||||
<controls:ScrollViewer MaxHeight="300">
|
||||
<controls:WaterfallPanel VerticalAlignment="Center" Width="300" Groups="{Binding Value,ElementName=UpDownGroups}" controls:PanelElement.FluidMoveBehavior="{StaticResource BehaviorXY200}">
|
||||
<Border Height="100" Background="{DynamicResource PrimaryBrush}" Effect="{StaticResource EffectShadow1}" Margin="5">
|
||||
<TextBlock Text="{x:Static langs:Lang.ContentDemoStr}" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="White"/>
|
||||
@ -32,18 +32,8 @@
|
||||
</Border>
|
||||
</controls:WaterfallPanel>
|
||||
</controls:ScrollViewer>
|
||||
<controls:ScrollViewer Margin="32,0,0,0" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Hidden" Orientation="Horizontal" IsEnableInertia="True" MaxWidth="300">
|
||||
<controls:WaterfallPanel VerticalAlignment="Center" Height="300" Orientation="Vertical" Groups="{Binding Value,ElementName=UpDownGroups}">
|
||||
<interactivity:Interaction.Behaviors>
|
||||
<interactivity:FluidMoveBehavior AppliesTo="Children" Duration="0:0:.2">
|
||||
<interactivity:FluidMoveBehavior.EaseX>
|
||||
<PowerEase/>
|
||||
</interactivity:FluidMoveBehavior.EaseX>
|
||||
<interactivity:FluidMoveBehavior.EaseY>
|
||||
<PowerEase/>
|
||||
</interactivity:FluidMoveBehavior.EaseY>
|
||||
</interactivity:FluidMoveBehavior>
|
||||
</interactivity:Interaction.Behaviors>
|
||||
<controls:ScrollViewer Margin="32,0,0,0" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Hidden" Orientation="Horizontal" MaxWidth="300">
|
||||
<controls:WaterfallPanel VerticalAlignment="Center" Height="300" Orientation="Vertical" Groups="{Binding Value,ElementName=UpDownGroups}" controls:PanelElement.FluidMoveBehavior="{StaticResource BehaviorXY200}">
|
||||
<Border Width="100" Background="{DynamicResource PrimaryBrush}" Effect="{StaticResource EffectShadow1}" Margin="5">
|
||||
<TextBlock Text="{x:Static langs:Lang.ContentDemoStr}" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="White"/>
|
||||
</Border>
|
||||
|
@ -235,6 +235,11 @@
|
||||
<Image Source="../../Resources/Img/LeftMainContent/Panel_16x.png"/>
|
||||
</controls:EdgeElement.LeftContent>
|
||||
</ListBoxItem>
|
||||
<ListBoxItem Style="{StaticResource ListBoxItemNew}" Tag="{x:Static data:MessageToken.CoverViewDemoCtl}" Content="{x:Static langs:Lang.CoverView}">
|
||||
<controls:EdgeElement.LeftContent>
|
||||
<Image Source="../../Resources/Img/LeftMainContent/DetailDataView_16x.png"/>
|
||||
</controls:EdgeElement.LeftContent>
|
||||
</ListBoxItem>
|
||||
<ListBoxItem Tag="{x:Static data:MessageToken.CircleProgressBarDemoCtl}" Content="{x:Static langs:Lang.CircleProgressBar}">
|
||||
<controls:EdgeElement.LeftContent>
|
||||
<Image Source="../../Resources/Img/LeftMainContent/ShapeArcRing_16x.png"/>
|
||||
|
Loading…
Reference in New Issue
Block a user