This project is read-only.

ListPage - Selectem Item

Aug 30, 2012 at 6:35 PM

Hello!

I'm a new user and enthusiast of Fleux library.

I would like to create a ListPage and navigate to next screen with selected item.

 

I have got a code:

  public ListPage()

{

 this.Content.TapHandler = p => this.NavigateToHandler(new ItemPage());

}

How I can get selected (tapped) item by user and pass to next screen?

 

I count on your help!

 

 

Aug 31, 2012 at 9:28 AM

OK, I found solution, single-handedly.

 

 this.Content.AddElement(
                DefaultAnimations.SetHorizontalDefaultAnimations(
                new ListElement<Customer>
                    {
                        DataTemplateSelector = item => i => BuildItem(i, p=>this.NavigateToHandler(new PivotPage(i))),
                        SourceItems = GetSampleData(),
                        Size = this.Content.Size,
                        ShowScrollbars = true,
                    },
                    true));

 

  internal static UIElement BuildItem(object textSource, Func<Point, bool> tapHandler)
        {


canvas.AddElement(new TextElement(text) { Style = MetroTheme.PhoneTextNormalStyle, Location = new Point(80, 0), Size = new Size(400, 50), TapHandler = tapHandler } );


}