Question

I'm sure it has been asked before, but i cant find the answer. Is it possible using the LongListSelector control to always show the name of the current group? Just like it works in the People hub.

Était-ce utile?

La solution

This is just a snippet. Please modify it as necessary.

var transform = llstItems.TransformToVisual(Application.Current.RootVisual);
Point pointTarget = transform.Transform(new Point(0, 0));
pointTarget.X += 5;
pointTarget.Y += 6;
List<UIElement> elements = (List<UIElement>)VisualTreeHelper.FindElementsInHostCoordinates(pointTarget, Application.Current.RootVisual);
if (elements != null && elements.Count > 0)
{
    TextBlock textGroupedHeader = elements[0] as TextBlock;
    if (textGroupedHeader != null)
    {
        Main.GroupTitle = textGroupedHeader.Text;
    }
}

Autres conseils

You can get the control as part of the Windows Phone Toolkit

https://nuget.org/packages/WPtoolkit

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top