Skip to content

Commit

Permalink
Add ListTour Layout to W10 DJNano Show
Browse files Browse the repository at this point in the history
  • Loading branch information
mvegaca committed Sep 4, 2015
1 parent aa1cd8f commit 3da25ed
Show file tree
Hide file tree
Showing 5 changed files with 138 additions and 2 deletions.
8 changes: 8 additions & 0 deletions W10/DJNanoShow.W10/DJNanoShow.W10.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@
</AppxManifest>
</ItemGroup>
<ItemGroup>
<Compile Include="Layouts\List\ListTour.xaml.cs">
<DependentUpon>ListTour.xaml</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Config\ActionConfig.cs" />
<Compile Include="Config\ConfigBase.cs" />
Expand Down Expand Up @@ -296,6 +299,10 @@
<Compile Include="Layouts\List\ListPhoto.xaml.cs">
<DependentUpon>ListPhoto.xaml</DependentUpon>
</Compile>
<Page Include="Layouts\List\ListTour.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Layouts\List\ListTextCard.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
Expand Down Expand Up @@ -485,6 +492,7 @@
</Page>
</ItemGroup>
<ItemGroup>
<Content Include="Layouts\List\Breakpoints.Large.ListTour.json" />
<None Include="Service References\Application Insights\ConnectedService.json" />
<None Include="project.json" />
</ItemGroup>
Expand Down
53 changes: 53 additions & 0 deletions W10/DJNanoShow.W10/Layouts/List/Breakpoints.Large.ListTour.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"_import": "/Layouts/List/Breakpoints.Large.json",
"breakpoints": [
{
"maxwidth": "321",
"properties": {
"itemsDesiredWidth": "140",
"itemsHeight": "60",
"titleMaxLines": "3"
}
},
{
"itemsDesiredWidth": "170",
"maxwidth": "500",
"properties": {
"itemsHeight": "65",
"titleMaxLines": "4"
}
},
{
"maxwidth": "900",
"properties": {
"itemsDesiredWidth": "220",
"itemsHeight": "80",
"titleMaxLines": "5"
}
},
{
"maxwidth": "1140",
"properties": {
"itemsDesiredWidth": "280",
"itemsHeight": "80",
"titleMaxLines": "5"
}
},
{
"maxwidth": "1650",
"properties": {
"itemsDesiredWidth": "360",
"itemsHeight": "90",
"titleMaxLines": "5"
}
},
{
"maxwidth": "*",
"properties": {
"itemsDesiredWidth": "450",
"itemsHeight": "120",
"titleMaxLines": "6"
}
}
]
}
50 changes: 50 additions & 0 deletions W10/DJNanoShow.W10/Layouts/List/ListTour.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<local:ListLayoutBase
x:Class="DJNanoShow.Layouts.List.ListTour"
x:Name="root"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:DJNanoShow.Layouts.List"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:was_controls="using:AppStudio.Controls"
DataContext="{Binding RelativeSource={RelativeSource Self}}"
mc:Ignorable="d"
d:DesignHeight="300"
d:DesignWidth="400">
<UserControl.Resources>
<was_controls:VisualBreakpoints x:Name="vbp" ConfigFile="/Layouts/List/Breakpoints.Large.ListTour.json"></was_controls:VisualBreakpoints>
</UserControl.Resources>
<Grid x:Name="main">
<was_controls:ResponsiveGridView
x:Name="responsiveGridView"
ItemsSource="{Binding ItemsSource, ElementName=root}"
Margin="0,7,2,0"
ItemClickCommand="{Binding ItemClickCommand, ElementName=root}"
DesiredWidth="{Binding Active.itemsDesiredWidth, Source={StaticResource vbp}}"
ItemHeight="{Binding Active.itemsHeight, Source={StaticResource vbp}}"
OneRowModeEnabled="{Binding OneRowModeEnabled, ElementName=root}">
<was_controls:ResponsiveGridView.ItemTemplate>
<DataTemplate>
<Grid
Height="{Binding Active.itemsHeight, Source={StaticResource vbp}}">
<RelativePanel
HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
Margin="{Binding Active.itemMargin, Source={StaticResource vbp}}">
<TextBlock x:Name="title"
Text="{Binding Title}" Style="{StaticResource TitleStyle}"
FontSize="{Binding Active.titleFontSize, Source={StaticResource vbp}}"
MaxLines="{Binding Active.titleMaxLines, Source={StaticResource vbp}}"
RelativePanel.AlignTopWithPanel="True"/>
<TextBlock
Text="{Binding SubTitle}"
Style="{StaticResource SubtitleStyle}"
Margin="0,6,0,0"
RelativePanel.Below="title"
FontSize="{Binding Active.subTitleFontSize, Source={StaticResource vbp}}"/>
</RelativePanel>
</Grid>
</DataTemplate>
</was_controls:ResponsiveGridView.ItemTemplate>
</was_controls:ResponsiveGridView>
</Grid>
</local:ListLayoutBase>
24 changes: 24 additions & 0 deletions W10/DJNanoShow.W10/Layouts/List/ListTour.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using AppStudio.Controls;

namespace DJNanoShow.Layouts.List
{
public sealed partial class ListTour : ListLayoutBase
{
public ListTour() : base()
{
this.InitializeComponent();
}

//protected override double VBPItemHeight0 { get { return 130; } }
//protected override double VBPItemHeight1 { get { return 180; } }
//protected override double VBPItemHeight2 { get { return 180; } }
//protected override double VBPItemHeight3 { get { return 220; } }
//protected override double VBPItemHeight4 { get { return 280; } }
//protected override double VBPItemHeight5 { get { return 320; } }

//protected override ResponsiveGridView GridView()
//{
// return responsiveGridView;
//}
}
}
5 changes: 3 additions & 2 deletions W10/DJNanoShow.W10/Views/HomePage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
</was_controls:SectionList.LoadingTemplate>
<was_controls:SectionListItem
HeaderLinkVisibility="Collapsed"
TitleVisibility="Collapsed"
TitleVisibility="Collapsed"
ErrorVisibility="Collapsed"
LoadingVisibility="Collapsed"
ManageLoading="False">
Expand All @@ -90,11 +90,12 @@
DataContext="{Binding Tours}"
HeaderLinkClickCommand="{Binding SectionHeaderClickCommand}"
HeaderLinkVisibility="Visible"
Background="{StaticResource AppBarBackground}"
ErrorVisibility="{Binding HasLoadDataErrors, Converter={StaticResource BoolToVisibilityConverter}, FallbackValue=Collapsed}"
LoadingVisibility="{Binding IsBusy, Converter={StaticResource BoolToVisibilityConverter}, FallbackValue=Collapsed}"
d:DataContext="{d:DesignData Source=/Assets/Design/DesignData.json, Type=vm:DesignViewModel, IsDesignTimeCreatable=true}">
<DataTemplate>
<list_layouts:ListTextCard DataContext="{Binding}" ItemsSource="{Binding Items}" ItemClickCommand="{Binding ItemClickCommand}" OneRowModeEnabled="True" Margin="14,0,6,0"/>
<list_layouts:ListTour DataContext="{Binding}" ItemsSource="{Binding Items}" ItemClickCommand="{Binding ItemClickCommand}" OneRowModeEnabled="True" Margin="14,0,6,0"/>
</DataTemplate>
</was_controls:SectionListItem>
<was_controls:SectionListItem
Expand Down

0 comments on commit 3da25ed

Please sign in to comment.