add Card
This commit is contained in:
1 parent
34cc6b9b8b
commit
78c49e7aaf
33 files changed
+412
-28
No files matched your search
@@ -100,6 +100,8 @@
|
||||
|
||||
public static readonly string ButtonGroupDemoCtl = nameof(ButtonGroupDemoCtl);
|
||||
|
||||
public static readonly string CardDemoCtl = nameof(CardDemoCtl);
|
||||
|
||||
public static readonly string ButtonDemoCtl = nameof(ButtonDemoCtl);
|
||||
|
||||
public static readonly string RepeatButtonDemoCtl = nameof(RepeatButtonDemoCtl);
|
||||
|
||||
@@ -52,7 +52,8 @@ var controlList = new List<string>
|
||||
"SideMenuDemoCtl",
|
||||
"GridDemoCtl",
|
||||
"RangeSliderDemoCtl",
|
||||
"ButtonGroupDemoCtl"
|
||||
"ButtonGroupDemoCtl",
|
||||
"CardDemoCtl"
|
||||
};
|
||||
var styleList = new List<string>
|
||||
{
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
namespace HandyControlDemo.Data
|
||||
{
|
||||
public class CardModel
|
||||
{
|
||||
public string Header { get; set; }
|
||||
|
||||
public string Content { get; set; }
|
||||
|
||||
public string Footer { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -16,6 +16,7 @@
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Data\AppConfig.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Data\Enum\DemoType.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Data\GlobalData.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Data\Model\CardModel.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Data\Model\ChatInfoModel.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Data\Model\AvatarModel.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Data\Model\CoverViewDemoModel.cs" />
|
||||
@@ -47,6 +48,9 @@
|
||||
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Controls\AnimationPathDemoCtl.xaml.cs">
|
||||
<DependentUpon>AnimationPathDemoCtl.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Controls\CardDemoCtl.xaml.cs">
|
||||
<DependentUpon>CardDemoCtl.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Controls\RangeSliderDemoCtl.xaml.cs">
|
||||
<DependentUpon>RangeSliderDemoCtl.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@@ -297,6 +301,7 @@
|
||||
<Compile Include="$(MSBuildThisFileDirectory)ViewModel\Basic\InteractiveDialogViewModel.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)ViewModel\Common\ComboBoxDemoViewModel.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)ViewModel\Controls\BadgeDemoViewModel.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)ViewModel\Controls\CardDemoViewModel.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)ViewModel\Controls\CoverViewModel.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)ViewModel\Controls\DialogDemoViewModel.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)ViewModel\Controls\GrowlDemoViewModel.cs" />
|
||||
@@ -404,6 +409,10 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="$(MSBuildThisFileDirectory)UserControl\Controls\CardDemoCtl.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="$(MSBuildThisFileDirectory)UserControl\Controls\RelativePanelDemoCtl.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
|
||||
@@ -204,6 +204,15 @@ namespace HandyControlDemo.Properties.Langs {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 卡片 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string Card {
|
||||
get {
|
||||
return ResourceManager.GetString("Card", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 轮播 的本地化字符串。
|
||||
/// </summary>
|
||||
|
||||
@@ -621,4 +621,7 @@
|
||||
<data name="ButtonGroup" xml:space="preserve">
|
||||
<value>ButtonGroup</value>
|
||||
</data>
|
||||
<data name="Card" xml:space="preserve">
|
||||
<value>Card</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -621,4 +621,7 @@
|
||||
<data name="ButtonGroup" xml:space="preserve">
|
||||
<value>按钮组</value>
|
||||
</data>
|
||||
<data name="Card" xml:space="preserve">
|
||||
<value>卡片</value>
|
||||
</data>
|
||||
</root>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 165 B |
@@ -76,18 +76,7 @@
|
||||
</Style>
|
||||
|
||||
<ItemsPanelTemplate x:Key="FluidMoveBehaviorWrapPanelItemsPanelTemplate">
|
||||
<WrapPanel HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||
<hc:Interaction.Behaviors>
|
||||
<hc:FluidMoveBehavior AppliesTo="Children" Duration="0:0:.2">
|
||||
<hc:FluidMoveBehavior.EaseX>
|
||||
<PowerEase/>
|
||||
</hc:FluidMoveBehavior.EaseX>
|
||||
<hc:FluidMoveBehavior.EaseY>
|
||||
<PowerEase/>
|
||||
</hc:FluidMoveBehavior.EaseY>
|
||||
</hc:FluidMoveBehavior>
|
||||
</hc:Interaction.Behaviors>
|
||||
</WrapPanel>
|
||||
<WrapPanel HorizontalAlignment="Center" VerticalAlignment="Center" hc:PanelElement.FluidMoveBehavior="{StaticResource BehaviorXY200}"/>
|
||||
</ItemsPanelTemplate>
|
||||
|
||||
<Style x:Key="MessageBoxCustom" TargetType="hc:MessageBox" BasedOn="{StaticResource {x:Type hc:MessageBox}}">
|
||||
|
||||
@@ -145,6 +145,73 @@ namespace HandyControlDemo.Service
|
||||
};
|
||||
}
|
||||
|
||||
internal List<CardModel> GetCardDataList()
|
||||
{
|
||||
return new List<CardModel>
|
||||
{
|
||||
new CardModel
|
||||
{
|
||||
Header = "Atomic",
|
||||
Content = "/HandyControlDemo;component/Resources/Img/Album/1.jpg",
|
||||
Footer = "Stive Morgan"
|
||||
},
|
||||
new CardModel
|
||||
{
|
||||
Header = "Zinderlong",
|
||||
Content = "/HandyControlDemo;component/Resources/Img/Album/2.jpg",
|
||||
Footer = "Zonderling"
|
||||
},
|
||||
new CardModel
|
||||
{
|
||||
Header = "Busy Doin' Nothin'",
|
||||
Content = "/HandyControlDemo;component/Resources/Img/Album/3.jpg",
|
||||
Footer = "Ace Wilder"
|
||||
},
|
||||
new CardModel
|
||||
{
|
||||
Header = "Wrong",
|
||||
Content = "/HandyControlDemo;component/Resources/Img/Album/4.jpg",
|
||||
Footer = "Blaxy Girls"
|
||||
},
|
||||
new CardModel
|
||||
{
|
||||
Header = "The Lights",
|
||||
Content = "/HandyControlDemo;component/Resources/Img/Album/5.jpg",
|
||||
Footer = "Panda Eyes"
|
||||
},
|
||||
new CardModel
|
||||
{
|
||||
Header = "EA7-50-Cent Disco",
|
||||
Content = "/HandyControlDemo;component/Resources/Img/Album/6.jpg",
|
||||
Footer = "еяхат музыка"
|
||||
},
|
||||
new CardModel
|
||||
{
|
||||
Header = "Monsters",
|
||||
Content = "/HandyControlDemo;component/Resources/Img/Album/7.jpg",
|
||||
Footer = "Different Heaven"
|
||||
},
|
||||
new CardModel
|
||||
{
|
||||
Header = "Gangsta Walk",
|
||||
Content = "/HandyControlDemo;component/Resources/Img/Album/8.jpg",
|
||||
Footer = "Illusionize"
|
||||
},
|
||||
new CardModel
|
||||
{
|
||||
Header = "Won't Back Down",
|
||||
Content = "/HandyControlDemo;component/Resources/Img/Album/9.jpg",
|
||||
Footer = "Boehm / Benjamin Francis Leftwich"
|
||||
},
|
||||
new CardModel
|
||||
{
|
||||
Header = "Katchi",
|
||||
Content = "/HandyControlDemo;component/Resources/Img/Album/10.jpg",
|
||||
Footer = "Ofenbach / Nick Waterhouse"
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
internal List<StepBarDemoModel> GetStepBarDemoDataList()
|
||||
{
|
||||
return new List<StepBarDemoModel>
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
<UserControl x:Class="HandyControlDemo.UserControl.CardDemoCtl"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
Background="{DynamicResource RegionBrush}"
|
||||
DataContext="{Binding CardDemo,Source={StaticResource Locator}}"
|
||||
xmlns:hc="https://handyorg.github.io/handycontrol"
|
||||
xmlns:data="clr-namespace:HandyControlDemo.Data">
|
||||
<hc:TransitioningContentControl>
|
||||
<ListBox Margin="32" BorderThickness="0" Style="{StaticResource WrapPanelHorizontalListBox}" ItemsPanel="{StaticResource FluidMoveBehaviorWrapPanelItemsPanelTemplate}" ItemsSource="{Binding DataList}">
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate DataType="data:CardModel">
|
||||
<hc:Card MaxWidth="240" BorderThickness="0" Effect="{StaticResource EffectShadow2}" Margin="8" Footer="{Binding Footer}">
|
||||
<!--<hc:Card.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock HorizontalAlignment="Left" Style="{StaticResource TextBlockLargeBold}" Text="{Binding}" Margin="10"/>
|
||||
</DataTemplate>
|
||||
</hc:Card.HeaderTemplate>-->
|
||||
<Border CornerRadius="4,4,0,0" Style="{StaticResource BorderClip}">
|
||||
<Image Width="240" Height="240" Source="{Binding Content}" Stretch="Uniform"/>
|
||||
</Border>
|
||||
<hc:Card.FooterTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Margin="10">
|
||||
<TextBlock TextWrapping="NoWrap" TextTrimming="CharacterEllipsis" Style="{StaticResource TextBlockLargeBold}" Text="{Binding DataContext.Header,RelativeSource={RelativeSource AncestorType=hc:Card}}" HorizontalAlignment="Left"/>
|
||||
<TextBlock TextWrapping="NoWrap" TextTrimming="CharacterEllipsis" Style="{StaticResource TextBlockDefault}" Text="{Binding}" Margin="0,6,0,0" HorizontalAlignment="Left"/>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</hc:Card.FooterTemplate>
|
||||
</hc:Card>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
</hc:TransitioningContentControl>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace HandyControlDemo.UserControl
|
||||
{
|
||||
public partial class CardDemoCtl
|
||||
{
|
||||
public CardDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -225,7 +225,7 @@
|
||||
<Image Source="../../Resources/Img/LeftMainContent/Bubble_16xLG.png"/>
|
||||
</hc:EdgeElement.LeftContent>
|
||||
</ListBoxItem>
|
||||
<ListBoxItem Style="{StaticResource ListBoxItemNew}" Tag="{x:Static data:MessageToken.NotifyIconDemoCtl}" Content="{x:Static langs:Lang.NotifyIcon}">
|
||||
<ListBoxItem Tag="{x:Static data:MessageToken.NotifyIconDemoCtl}" Content="{x:Static langs:Lang.NotifyIcon}">
|
||||
<hc:EdgeElement.LeftContent>
|
||||
<Image Source="../../Resources/Img/LeftMainContent/NotificationHub_16x.png"/>
|
||||
</hc:EdgeElement.LeftContent>
|
||||
@@ -315,6 +315,11 @@
|
||||
<Image Source="../../Resources/Img/LeftMainContent/TextBlock_16x.png"/>
|
||||
</hc:EdgeElement.LeftContent>
|
||||
</ListBoxItem>
|
||||
<ListBoxItem Style="{StaticResource ListBoxItemNew}" Tag="{x:Static data:MessageToken.CardDemoCtl}" Content="{x:Static langs:Lang.Card}">
|
||||
<hc:EdgeElement.LeftContent>
|
||||
<Image Source="../../Resources/Img/LeftMainContent/VSO_Card_16x.png"/>
|
||||
</hc:EdgeElement.LeftContent>
|
||||
</ListBoxItem>
|
||||
<ListBoxItem Tag="{x:Static data:MessageToken.CirclePanelDemoCtl}" Content="{x:Static langs:Lang.CirclePanel}">
|
||||
<hc:EdgeElement.LeftContent>
|
||||
<Image Source="../../Resources/Img/LeftMainContent/ColorWheel_16x.png"/>
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
using HandyControlDemo.Data;
|
||||
using HandyControlDemo.Service;
|
||||
|
||||
namespace HandyControlDemo.ViewModel
|
||||
{
|
||||
public class CardDemoViewModel : DemoViewModelBase<CardModel>
|
||||
{
|
||||
public CardDemoViewModel(DataService dataService)
|
||||
{
|
||||
DataList = dataService.GetCardDataList();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -38,6 +38,7 @@ namespace HandyControlDemo.ViewModel
|
||||
SimpleIoc.Default.Register<SideMenuDemoViewModel>();
|
||||
SimpleIoc.Default.Register<TabControlDemoViewModel>();
|
||||
SimpleIoc.Default.Register<NoUserViewModel>();
|
||||
SimpleIoc.Default.Register<CardDemoViewModel>();
|
||||
}
|
||||
|
||||
public static ViewModelLocator Instance => new Lazy<ViewModelLocator>(() =>
|
||||
@@ -87,6 +88,8 @@ namespace HandyControlDemo.ViewModel
|
||||
|
||||
public NoUserViewModel NoUser => ServiceLocator.Current.GetInstance<NoUserViewModel>();
|
||||
|
||||
public CardDemoViewModel CardDemo => ServiceLocator.Current.GetInstance<CardDemoViewModel>();
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user