user3162111
user3162111

Reputation: 21

Customized MultiSelectList in windows phone 8 app

In my app, when i am clicking on a button btn_setting this convas visibility is visible so it is showing like a popup having multiselect list with OK and Cancel buttons but the problem i am facing is that i want to add items in multiselectlist dynamically with checkbox border colour blue and foreground color to be black and the most important after every item i want a horizontal blue-line as a separator between two items.

I put foreground ="Black" for MultiSelectList but itis showing the white colour for the items.

<Canvas x:Name="Setting_popup"  Width="485" Height="770" Visibility="Collapsed">

                    <Border   Margin="10" >
                    <StackPanel  Background="White">
                        <toolkit:MultiselectList x:Name="Setting_list" Background="Blue" Width="456" Height="700" FontWeight="Bold" Foreground="Black">
                            <CheckBox Content="Celsius" />
                            <CheckBox Content="Fahrenheit"/>
                            <CheckBox Content="Kelvin"/>
                            <CheckBox Content="Rankine"/>

                        </toolkit:MultiselectList>
                        <StackPanel Orientation="Horizontal">
                            <Button x:Name="btn_OK" Content="Ok" Width="223" HorizontalAlignment="Left" Foreground="White" Background="#FF3498DB" />
                            <Button x:Name="btn_Cancel" Content="Cancel" Width="223" HorizontalAlignment="Right" Foreground="White" Background="#FF3498DB" Click="Button_Click_1"  />
                        </StackPanel>
                    </StackPanel>
                </Border>

            </Canvas>

Upvotes: 0

Views: 199

Answers (1)

berXpert
berXpert

Reputation: 149

You can change the check boxes style, for example:

<phone:PhoneApplicationPage.Resources>

<Style x:Key="CheckBoxStyle1" TargetType="CheckBox">
    <Setter Property="BorderBrush" Value="Blue"/>
    <Setter Property="Foreground" Value="Black"/>
</Style>

</phone:PhoneApplicationPage.Resources>

And then set the style to each check box:

   <toolkit:MultiselectList x:Name="Setting_list" Width="456" Height="400" >
                    <CheckBox Content="Celsius" Style="{StaticResource CheckBoxStyle1}" />
                    <CheckBox Content="Fahrenheit" Style="{StaticResource CheckBoxStyle1}"/>
                    <CheckBox Content="Kelvin" Style="{StaticResource CheckBoxStyle1}"/>
                    <CheckBox Content="Rankine" Style="{StaticResource CheckBoxStyle1}"/>
   </toolkit:MultiselectList>

Upvotes: 0

Related Questions