Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request: A few additional samples #2

Closed
ravensorb opened this issue Dec 31, 2015 · 12 comments
Closed

Request: A few additional samples #2

ravensorb opened this issue Dec 31, 2015 · 12 comments

Comments

@ravensorb
Copy link

Any chance you could add a few additional samples that show other types of configurations?

Thoughts on scenarios

  • Simple Data Template (basic usage with 1 template)
  • Horizontal Scroll Grid (1 row)
@daniel-luberda
Copy link
Owner

Hi @ravensorb,

Simple Data Template (basic usage with 1 template)

Sure. Could you give more details?

Horizontal Scroll Grid (1 row)

Horizontal scrolling is not supported as Xamarin.Forms ListView doesn't support that (and FlowListView derives from it)

@ravensorb
Copy link
Author

I was looking over the sample and am having a little bit of a tough time figuring out how to use it :)

Example:

  • Line 17 and 18 as well as 19 and 20 appear to be duplicate lines. But I am not sure why each entry is being declared twice
  • How would I use this for a single data template (one template for all items) in a Grid type layout? Say a Grid of Pictures (like a gallery)

@daniel-luberda
Copy link
Owner

Line 17 and 18 as well as 19 and 20 appear to be duplicate lines. But I am not sure why each entry is being declared twice

What file are you referring to?:)

How would I use this for a single data template (one template for all items) in a Grid type layout? Say a Grid of Pictures (like a gallery)

I'll upload some new better examples today.

@ravensorb
Copy link
Author

@daniel-luberda
Copy link
Owner

Column definitions (4 columns with 2 layout used multiple times). The new thing (not on nuget yet) is FlowAutomaticColumnCount with FlowAutomaticColumnMinimumWidth. You define just one column template and set it to true, and column number will be automatically calculated to fill container.

@daniel-luberda
Copy link
Owner

FlowSelectors.CustomAdvancedTemplateSelector is advanced template selector (basing on current binding context - it can provide different template for a cell for every item)

@ravensorb
Copy link
Author

So do that mean if I have 6 columns, I need to define the type 6 times? Wouldn't it be easier to have it match a selector to an object type during binding -- that would allow more reuse (and less copy/pasting in the xaml)

@daniel-luberda
Copy link
Owner

You can have one definition only with FlowAutomaticColumnCount set to true.

You don't need to define any type multiple times. Could you elaborate?:) FlowColumnSimpleTemplateSelector is built in and can be used for simple scenarios. Multiple column definitions are used in scenarios where you want left/center/right items to be different - so it's needed.

Why selectors? It's because you can have any cell to have any type of view dynamically basing or binding context. I didn't find simpler way to do it and be compatible with XAML.

@daniel-luberda
Copy link
Owner

@dylinmaust
Copy link

dylinmaust commented Jul 22, 2016

How would I use this for a single data template (one template for all items) in a Grid type layout? Say a Grid of Pictures (like a gallery)

Forgive me if it's obvious, but is it possible to just define an inline column template rather than abstracting it out to a view? I'm trying to create a 3 column gallery similar to the previous request and it's not immediately clear to me.

@daniel-luberda
Copy link
Owner

@TimeBomb006 You mean that you don't want to have view definition defined in a separate file? If yes it's not possible yet, but the new release will have this (standard Forms data templates).

If you want to have auto generated column count just use FlowAutoColumnCount and FlowMinimumWidth, property and define just one column template. Column count will be calculated automatically then.

@daniel-luberda
Copy link
Owner

Samples should be better now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants