Coder Social home page Coder Social logo

Comments (10)

YZahringer avatar YZahringer commented on August 10, 2024 2

This also works:

[assembly: Xamarin.Forms.Platform.UWP.ExportRenderer(typeof(DLToolkit.Forms.Controls.FlowListView), typeof(App.UWP.Controls.AlternateListViewRenderer))]
namespace App.UWP.Controls
{
    using Xamarin.Forms.Platform.UWP;

    public class AlternateListViewRenderer : ListViewRenderer
    {
        protected override void OnElementChanged(ElementChangedEventArgs<Xamarin.Forms.ListView> e)
        {
            base.OnElementChanged(e);

            if (List != null)
                List.SelectionMode = Windows.UI.Xaml.Controls.ListViewSelectionMode.None;
        }
    }
}

from dltoolkit.forms.controls.

 avatar commented on August 10, 2024 1

@daniel-luberda Little update : I managed to do it for a normal listview this should be the same way to implement it on your FlowListView.

public class AlternateListViewRenderer : ListViewRenderer
 {
     protected override void OnElementChanged(ElementChangedEventArgs<Xamarin.Forms.ListView> e)
     {
         base.OnElementChanged(e);
         if (this.List != null)
             this.List.ItemContainerStyle = (Style)App.Current.Resources["ListViewItemStyle1"];
     }

 }

this is the CustomRenderer i'm using for my listview

And the style is this :

  <Style x:Key="ListViewItemStyle1" TargetType="ListViewItem">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="ListViewItem">
                        <ContentPresenter/>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

Normally the ContentPresenter is a ListViewItemPresenter by changing it to a ContentPresenter i'm disabling all animations on the cell since i don't want it to be clicked.

I think that for the issue i asked first (disabling row animation but keeping item animation) maybe it can be done at a cell level or disabling all native animations then adding animations from xamarin. I'll try to do it with the FlowListView when i have a little more time

from dltoolkit.forms.controls.

zuckerthoben avatar zuckerthoben commented on August 10, 2024 1

Can you link to this on the front page (Readme)? I just lost an hour trying to write my own CustomRenderer for ViewCellRenderer on UWP.

from dltoolkit.forms.controls.

daniel-luberda avatar daniel-luberda commented on August 10, 2024

Something like this (but from code): http://stackoverflow.com/questions/38705396/how-to-change-selectedbackground-in-listviewitempresenter-inside-a-gridview

from dltoolkit.forms.controls.

 avatar commented on August 10, 2024

Well i can't seem to make that work in my custom renderer, i'll try to post on XF Forums for other ideas, maybe someone will be able to help. I'll update here anyway as soon as i fix this :)
Thanks,

from dltoolkit.forms.controls.

daniel-luberda avatar daniel-luberda commented on August 10, 2024

@R3VV Any news about this?

from dltoolkit.forms.controls.

 avatar commented on August 10, 2024

@daniel-luberda unfortunately no. I changed my way of approach and created a WrapLayout with an ItemsSource to get a semblant of gallery without the animations from the Windows ListView. But it's pretty annoying to do it this way since you can't get all the nice features from the listview. It's the same with normal listview. If you want to create some repeated content without clickable animation on the cell itself.

from dltoolkit.forms.controls.

daniel-luberda avatar daniel-luberda commented on August 10, 2024

@R3VV @YZahringer That's cool. Thanks! :)

from dltoolkit.forms.controls.

zippo227 avatar zippo227 commented on August 10, 2024

I just lost an hour looking for how to do this as well.

from dltoolkit.forms.controls.

daniel-luberda avatar daniel-luberda commented on August 10, 2024

Also this 6798761 should help. I'll also add @YZahringer solution to README.md

Thanks

from dltoolkit.forms.controls.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.