0

I'm using the header of the listview to filter item inside it. What I'd want, would be, to have the TextBox Collapsed by default and on PointerReleased on the TextBlock to put it Visible.

When SearchParametrageList_TextChanged is called if Textbox is empty it's Collapsed again.

<ItemsRepeater Grid.Column="0" ItemsSource="{Binding ListViewColonnes, Mode=TwoWay}" VerticalAlignment="Center" HorizontalAlignment="Stretch">
    <ItemsRepeater.Layout>
        <UniformGridLayout Orientation="Horizontal" MinItemWidth="200" MinColumnSpacing="20" ItemsJustification="SpaceAround"/>
    </ItemsRepeater.Layout>

    <ItemsRepeater.ItemTemplate>
        <DataTemplate x:DataType="x:String">
            <StackPanel Orientation="Vertical">
                <TextBlock x:Name="ColonneParametrageList" Height="20" Text="{x:Bind}" Style="{StaticResource Text_ListViewTitle}" PointerReleased="ColonneParametrageList_PointerReleased"/>
                <TextBox x:Name="FiltreParametrageList" Tag="{x:Bind}"  Height="25" TextChanged="SearchParametrageList_TextChanged" Visibility="Collapsed"/>
            </StackPanel>
        </DataTemplate>
    </ItemsRepeater.ItemTemplate>
</ItemsRepeater>

Case all TextBox open

ListView preview

Case any TextBox is Collapsed other than the first

ListView Column 2 Collapsed

Case ListView Column 1 Collapsed and everything not shown ListView Column 1 Collapsed and everything not shown

I'm thinking of managing myself the items in the header so I can have the hand on the logic behind it but maybe i'm missing something in the initiation of the ItemsRepeater. Do you have a suggestion on how to manage the Header of this listview?

2
  • One "enables" and "disables" controls in these types of situations ... "disappearing" controls is "disturbing" to the user. Commented Oct 14 at 17:19
  • Can you elaborate a bit? When do you want to switch the visibility of the TextBox? Commented Oct 16 at 0:49

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.