I would like to be add ListBoxItems to a ListBox.

I don't want to bind the items to a data source. I need to have more control
than that.

 

In fact what I need to do is to add a ListBoxItem I need to

.         Prompt user for a file.

.         Parse the file for a some data items (XML attributes)

.         If its ok, then create a new ListBoxItem containing some of these
attributes

.         Check that the same item has not been already added, if so prompt
the user to replace it.

.         If it does not already exist, add the ListBoxItem to the ListBox.

 

I would like to add nicely formatted ListBoxItems with a border that has
rounded corners etc.

 

I am not sure how to create a new ListBoxItem.

 

The XAML I am starting with is

 

            <ListBox  Margin="10" Name="listBoxKeys">

                <ListBox.ItemTemplate>

                    <DataTemplate>

                        <Border>

                            <StackPanel Orientation="Horizontal">

                                <!--<CheckBox IsChecked="{Binding
Deleteable, Mode=TwoWay}" />-->

                                <CheckBox IsChecked="False" />

                                <!--<Label Content="{Binding Name}" />-->

                                <Label x:Name="Client" />

                                <Label x:Name="Generated" />

                                <Label x:Name="Description" />

                            </StackPanel>

                        </Border>

                    </DataTemplate>

                </ListBox.ItemTemplate>

            </ListBox>

 

How do I create a new ListBoxItem that conforms to this template?

 

Any help very much appreciated.

 

Regards Peter Maddin
Applications Development Officer
PathWest Laboratory Medicine WA
Phone : +618 6396 4285
Mobile: 0414 240 307 
E-Mail : [email protected]; [email protected]
The contents of this e-mail transmission outside of the WAGHS network are
intended solely for the named recipient's), may be confidential, and may be
privileged or otherwise protected from disclosure in the public interest.
The use, reproduction, disclosure or distribution of the contents of this
e-mail transmission by any person other than the named recipient(s) is
prohibited. If you are not a named recipient please notify the sender
immediately.

 

 

_______________________________________________
ozwpf mailing list
[email protected]
http://prdlxvm0001.codify.net/mailman/listinfo/ozwpf

Reply via email to