ready for coverview

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

No files matched your search

@@ -0,0 +1,9 @@
using System.Windows.Controls;
namespace HandyControl.Controls
{
public class CoverView : ItemsControl
{
}
}
@@ -0,0 +1,9 @@
using System.Windows.Controls;
namespace HandyControl.Controls
{
public class CoverViewItem : HeaderedContentControl
{
}
}
+13 -2
View File
@@ -49,14 +49,25 @@ namespace HandyControl.Controls
protected override void OnMouseWheel(MouseWheelEventArgs e) protected override void OnMouseWheel(MouseWheelEventArgs e)
{ {
if (!CanMouseWheel) return;
if (!IsEnableInertia) 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; return;
} }
e.Handled = true; e.Handled = true;
if (!CanMouseWheel) return;
if (Orientation == Orientation.Vertical) if (Orientation == Orientation.Vertical)
{ {
if (!_isRunning) if (!_isRunning)
+10
View File
@@ -117,6 +117,7 @@
<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" />
<Compile Include="Controls\CoverView\CoverViewItem.cs" />
<Compile Include="Controls\Other\AnimationPath.cs" /> <Compile Include="Controls\Other\AnimationPath.cs" />
<Compile Include="Controls\Attach\BackgroundSwitchElement.cs" /> <Compile Include="Controls\Attach\BackgroundSwitchElement.cs" />
<Compile Include="Controls\Attach\BorderElement.cs" /> <Compile Include="Controls\Attach\BorderElement.cs" />
@@ -131,6 +132,7 @@
<Compile Include="Controls\Button\ContextMenuButton.cs" /> <Compile Include="Controls\Button\ContextMenuButton.cs" />
<Compile Include="Controls\Button\ContextMenuToggleButton.cs" /> <Compile Include="Controls\Button\ContextMenuToggleButton.cs" />
<Compile Include="Controls\Other\Carousel.cs" /> <Compile Include="Controls\Other\Carousel.cs" />
<Compile Include="Controls\CoverView\CoverView.cs" />
<Compile Include="Controls\Panel\CirclePanel.cs" /> <Compile Include="Controls\Panel\CirclePanel.cs" />
<Compile Include="Controls\Other\CircleProgressBar.cs" /> <Compile Include="Controls\Other\CircleProgressBar.cs" />
<Compile Include="Controls\Other\RadioGroup.cs" /> <Compile Include="Controls\Other\RadioGroup.cs" />
@@ -375,6 +377,10 @@
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</Page> </Page>
<Page Include="Themes\Styles\Base\CoverViewBaseStyle.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Themes\Styles\Base\DatePickerBaseStyle.xaml"> <Page Include="Themes\Styles\Base\DatePickerBaseStyle.xaml">
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
@@ -407,6 +413,10 @@
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</Page> </Page>
<Page Include="Themes\Styles\CoverView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Themes\Styles\FlipClock.xaml"> <Page Include="Themes\Styles\FlipClock.xaml">
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
@@ -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>
@@ -0,0 +1,4 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
</ResourceDictionary>
+1
View File
@@ -50,6 +50,7 @@
<ResourceDictionary Source="FlipClock.xaml"/> <ResourceDictionary Source="FlipClock.xaml"/>
<ResourceDictionary Source="Rate.xaml"/> <ResourceDictionary Source="Rate.xaml"/>
<ResourceDictionary Source="Shield.xaml"/> <ResourceDictionary Source="Shield.xaml"/>
<ResourceDictionary Source="CoverView.xaml"/>
</ResourceDictionary.MergedDictionaries> </ResourceDictionary.MergedDictionaries>
</ResourceDictionary> </ResourceDictionary>
+2
View File
@@ -70,6 +70,8 @@
public static readonly string WaterfallPanelDemoCtl = nameof(WaterfallPanelDemoCtl); 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 ButtonDemoCtl = nameof(ButtonDemoCtl);
public static readonly string ToggleButtonDemoCtl = nameof(ToggleButtonDemoCtl); public static readonly string ToggleButtonDemoCtl = nameof(ToggleButtonDemoCtl);
+2 -1
View File
@@ -37,7 +37,8 @@ var controlList = new List<string>
"BlurWindow", "BlurWindow",
"RateDemoCtl", "RateDemoCtl",
"ShieldDemoCtl", "ShieldDemoCtl",
"WaterfallPanelDemoCtl" "WaterfallPanelDemoCtl",
"CoverViewDemoCtl"
}; };
var styleList = new List<string> var styleList = new List<string>
{ {
+8
View File
@@ -139,6 +139,9 @@
<Compile Include="UserControl\Controls\CompareSliderDemoCtl.xaml.cs"> <Compile Include="UserControl\Controls\CompareSliderDemoCtl.xaml.cs">
<DependentUpon>CompareSliderDemoCtl.xaml</DependentUpon> <DependentUpon>CompareSliderDemoCtl.xaml</DependentUpon>
</Compile> </Compile>
<Compile Include="UserControl\Controls\CoverViewDemoCtl.xaml.cs">
<DependentUpon>CoverViewDemoCtl.xaml</DependentUpon>
</Compile>
<Compile Include="UserControl\Controls\DatePickerDemoCtl.xaml.cs"> <Compile Include="UserControl\Controls\DatePickerDemoCtl.xaml.cs">
<DependentUpon>DatePickerDemoCtl.xaml</DependentUpon> <DependentUpon>DatePickerDemoCtl.xaml</DependentUpon>
</Compile> </Compile>
@@ -418,6 +421,10 @@
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</Page> </Page>
<Page Include="UserControl\Controls\CoverViewDemoCtl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="UserControl\Controls\DatePickerDemoCtl.xaml"> <Page Include="UserControl\Controls\DatePickerDemoCtl.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType> <SubType>Designer</SubType>
@@ -678,6 +685,7 @@
<Generator>TextTemplatingFileGenerator</Generator> <Generator>TextTemplatingFileGenerator</Generator>
<LastGenOutput>MessageToken.cs</LastGenOutput> <LastGenOutput>MessageToken.cs</LastGenOutput>
</Content> </Content>
<Resource Include="Resources\Img\LeftMainContent\DetailDataView_16x.png" />
<Resource Include="Resources\Img\LeftMainContent\Panel_16x.png" /> <Resource Include="Resources\Img\LeftMainContent\Panel_16x.png" />
<Resource Include="Resources\Img\LeftMainContent\Shield_16x.png" /> <Resource Include="Resources\Img\LeftMainContent\Shield_16x.png" />
<Resource Include="Resources\Img\LeftMainContent\Star.png" /> <Resource Include="Resources\Img\LeftMainContent\Star.png" />
+10 -1
View File
@@ -47,7 +47,7 @@ namespace HandyControlDemo.Properties.Langs {
} }
/// <summary> /// <summary>
/// 使用此强类型资源类,为所有资源查找 /// 重写当前线程的 CurrentUICulture 属性
/// 重写当前线程的 CurrentUICulture 属性。 /// 重写当前线程的 CurrentUICulture 属性。
/// </summary> /// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] [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>
/// 查找类似 危险 的本地化字符串。 /// 查找类似 危险 的本地化字符串。
/// </summary> /// </summary>
@@ -456,4 +456,7 @@
<data name="Groups" xml:space="preserve"> <data name="Groups" xml:space="preserve">
<value>Groups</value> <value>Groups</value>
</data> </data>
<data name="CoverView" xml:space="preserve">
<value>CoverView</value>
</data>
</root> </root>
@@ -436,4 +436,7 @@
<data name="Groups" xml:space="preserve"> <data name="Groups" xml:space="preserve">
<value>组数</value> <value>组数</value>
</data> </data>
<data name="CoverView" xml:space="preserve">
<value>封面视图</value>
</data>
</root> </root>
Binary file not shown.

After

Width:  |  Height:  |  Size: 129 B

@@ -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> </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"/> <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"> <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}"> <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"> <Border Height="100" Background="{DynamicResource PrimaryBrush}" Effect="{StaticResource EffectShadow1}" Margin="5">
<TextBlock Text="{x:Static langs:Lang.ContentDemoStr}" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="White"/> <TextBlock Text="{x:Static langs:Lang.ContentDemoStr}" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="White"/>
@@ -32,18 +32,8 @@
</Border> </Border>
</controls:WaterfallPanel> </controls:WaterfallPanel>
</controls:ScrollViewer> </controls:ScrollViewer>
<controls:ScrollViewer Margin="32,0,0,0" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Hidden" Orientation="Horizontal" IsEnableInertia="True" MaxWidth="300"> <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:WaterfallPanel VerticalAlignment="Center" Height="300" Orientation="Vertical" Groups="{Binding Value,ElementName=UpDownGroups}" controls:PanelElement.FluidMoveBehavior="{StaticResource BehaviorXY200}">
<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>
<Border Width="100" Background="{DynamicResource PrimaryBrush}" Effect="{StaticResource EffectShadow1}" Margin="5"> <Border Width="100" Background="{DynamicResource PrimaryBrush}" Effect="{StaticResource EffectShadow1}" Margin="5">
<TextBlock Text="{x:Static langs:Lang.ContentDemoStr}" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="White"/> <TextBlock Text="{x:Static langs:Lang.ContentDemoStr}" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="White"/>
</Border> </Border>
@@ -235,6 +235,11 @@
<Image Source="../../Resources/Img/LeftMainContent/Panel_16x.png"/> <Image Source="../../Resources/Img/LeftMainContent/Panel_16x.png"/>
</controls:EdgeElement.LeftContent> </controls:EdgeElement.LeftContent>
</ListBoxItem> </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}"> <ListBoxItem Tag="{x:Static data:MessageToken.CircleProgressBarDemoCtl}" Content="{x:Static langs:Lang.CircleProgressBar}">
<controls:EdgeElement.LeftContent> <controls:EdgeElement.LeftContent>
<Image Source="../../Resources/Img/LeftMainContent/ShapeArcRing_16x.png"/> <Image Source="../../Resources/Img/LeftMainContent/ShapeArcRing_16x.png"/>