locked
Help.Background ="#f3f3f3" on listbox but when It was debuged on listbox is background = white.???I dont understand. RRS feed

  • Question

  • On vs2015 ctp. AS the photos. Why is background getting white when I clicked on listbox??? How to remove it.

    ..<ListBox x:Name="MainMenu" Background="#e3e3e3">
    ..<ListBox x:Name="MainOther" Background="#e3e3e3">


    Thursday, April 2, 2015 11:53 AM

Answers

  • Background="#e3e3e3" is the white color. So your listbox should be white.

    What do you mean why is background getting white when I clicked on listbox? You should post all the code here.

    Friday, April 3, 2015 10:20 AM

All replies

  • Background="#e3e3e3" is the white color. So your listbox should be white.

    What do you mean why is background getting white when I clicked on listbox? You should post all the code here.

    Friday, April 3, 2015 10:20 AM
  • <ListBox x:Name="MainMenu" Background="#e3e3e3" SelectionChanged="MainMenu_SelectionChanged">
                            <ListBox.ItemTemplate>
                                <DataTemplate>
                                    <Grid>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="80"></ColumnDefinition>
                                            <ColumnDefinition Width="*"></ColumnDefinition>
                                        </Grid.ColumnDefinitions>
                                        <!--Thumb icon-->
                                        <Grid Grid.Column="0" Height="50">
                                            <Grid VerticalAlignment="Center" HorizontalAlignment="Center">
                                                <Image Source="{Binding thumbIcon}" Width="20" Height="20"></Image>
                                            </Grid>
                                        </Grid>
    
                                        <!--Text-->
                                        <Grid Grid.Column="1" Height="50">
                                            <Grid VerticalAlignment="Center" HorizontalAlignment="Left">
                                                <TextBlock Text="{Binding text}" Foreground="#1f1f1f" FontSize="13"></TextBlock>
                                            </Grid>
                                        </Grid>
                                    </Grid>
                                </DataTemplate>
                            </ListBox.ItemTemplate>
                        </ListBox>

    <ListBox x:Name="MainOther" Background="#e3e3e3" SelectionChanged="MainOther_SelectionChanged">
                            <ListBox.ItemTemplate>
                                <DataTemplate>
                                    <Grid>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="80"></ColumnDefinition>
                                            <ColumnDefinition Width="*"></ColumnDefinition>
                                        </Grid.ColumnDefinitions>
                                        <!--Thumb icon-->
                                        <Grid Grid.Column="0" Height="50">
                                            <Grid VerticalAlignment="Center" HorizontalAlignment="Center">
                                                <Image Source="{Binding thumbIcon}" Width="20" Height="20"></Image>
                                            </Grid>
                                        </Grid>
    
                                        <!--Text-->
                                        <Grid Grid.Column="1" Height="50">
                                            <Grid VerticalAlignment="Center" HorizontalAlignment="Left">
                                                <TextBlock Text="{Binding text}" Foreground="#1f1f1f" FontSize="13"></TextBlock>
                                            </Grid>
                                        </Grid>
                                    </Grid>
                                </DataTemplate>
                            </ListBox.ItemTemplate>
                        </ListBox>

     protected override void OnNavigatedTo(NavigationEventArgs e)
            {
                //base.OnNavigatedTo(e);
                MainMenuLoading();

    Friday, April 3, 2015 1:59 PM
  • When I clicked outside on listbox then it's normal. Clicked inside then background of listbox getting white.
    Friday, April 3, 2015 2:07 PM