ready for coverview

This commit is contained in:
NaBian 2018-12-29 13:33:33 +08:00
parent 15d96290ad
commit 912a10b56d
18 changed files with 118 additions and 17 deletions

View File

@ -0,0 +1,9 @@
using System.Windows.Controls;
namespace HandyControl.Controls
{
public class CoverView : ItemsControl
{
}
}

View File

@ -0,0 +1,9 @@
using System.Windows.Controls;
namespace HandyControl.Controls
{
public class CoverViewItem : HeaderedContentControl
{
}
}

View File

@ -49,14 +49,25 @@ namespace HandyControl.Controls
protected override void OnMouseWheel(MouseWheelEventArgs e)
{
if (!CanMouseWheel) return;
if (!IsEnableInertia)
{
base.OnMouseWheel(e);
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)

View File

@ -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>

View 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>

View 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>

View File

@ -50,6 +50,7 @@
<ResourceDictionary Source="FlipClock.xaml"/>
<ResourceDictionary Source="Rate.xaml"/>
<ResourceDictionary Source="Shield.xaml"/>
<ResourceDictionary Source="CoverView.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>

View File

@ -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);

View File

@ -37,7 +37,8 @@ var controlList = new List<string>
"BlurWindow",
"RateDemoCtl",
"ShieldDemoCtl",
"WaterfallPanelDemoCtl"
"WaterfallPanelDemoCtl",
"CoverViewDemoCtl"
};
var styleList = new List<string>
{

View File

@ -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" />

View File

@ -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>

View File

@ -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>

View File

@ -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

View 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>

View File

@ -0,0 +1,10 @@
namespace HandyControlDemo.UserControl
{
public partial class CoverViewDemoCtl
{
public CoverViewDemoCtl()
{
InitializeComponent();
}
}
}

View File

@ -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>

View File

@ -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"/>