Click here to Skip to main content
15,900,110 members
Home / Discussions / C#
   

C#

 
AnswerRe: Custom progressbar doesn't update Pin
teknolog12322-Sep-09 4:02
teknolog12322-Sep-09 4:02 
GeneralRe: Custom progressbar doesn't update Pin
Programm3r22-Sep-09 21:21
Programm3r22-Sep-09 21:21 
GeneralRe: Custom progressbar doesn't update Pin
teknolog12323-Sep-09 9:26
teknolog12323-Sep-09 9:26 
QuestionBinary Serialization of Dictionary Pin
FJJCENTU22-Sep-09 1:28
FJJCENTU22-Sep-09 1:28 
AnswerRe: Binary Serialization of Dictionary Pin
Henry Minute22-Sep-09 1:44
Henry Minute22-Sep-09 1:44 
QuestionText over Progressbar - Question Pin
Programm3r22-Sep-09 1:25
Programm3r22-Sep-09 1:25 
AnswerRe: Text over Progressbar - Question Pin
Programm3r22-Sep-09 1:36
Programm3r22-Sep-09 1:36 
AnswerRe: Text over Progressbar - Question Pin
firda-cze18-Apr-10 22:21
firda-cze18-Apr-10 22:21 
GeneralRe: Text over Progressbar - Question Pin
Scott Sherin28-May-10 4:15
Scott Sherin28-May-10 4:15 
Questionhow to use a macro in c# Pin
Ajithevn22-Sep-09 0:58
Ajithevn22-Sep-09 0:58 
AnswerRe: how to use a macro in c# Pin
Programm3r22-Sep-09 1:39
Programm3r22-Sep-09 1:39 
GeneralRe: how to use a macro in c# Pin
Ajithevn22-Sep-09 2:29
Ajithevn22-Sep-09 2:29 
GeneralRe: how to use a macro in c# Pin
Programm3r22-Sep-09 2:50
Programm3r22-Sep-09 2:50 
GeneralRe: how to use a macro in c# Pin
Programm3r22-Sep-09 2:53
Programm3r22-Sep-09 2:53 
GeneralRe: how to use a macro in c# Pin
thecodedemon23-Sep-09 13:30
thecodedemon23-Sep-09 13:30 
AnswerRe: how to use a macro in c# Pin
Programm3r22-Sep-09 2:57
Programm3r22-Sep-09 2:57 
QuestionPlaying with Enumerations Pin
ezazazel22-Sep-09 0:45
ezazazel22-Sep-09 0:45 
AnswerRe: Playing with Enumerations Pin
harold aptroot22-Sep-09 0:54
harold aptroot22-Sep-09 0:54 
AnswerRe: Playing with Enumerations Pin
Gideon Engelberth22-Sep-09 2:51
Gideon Engelberth22-Sep-09 2:51 
GeneralRe: Playing with Enumerations Pin
ezazazel22-Sep-09 6:49
ezazazel22-Sep-09 6:49 
AnswerRe: Playing with Enumerations Pin
PIEBALDconsult22-Sep-09 4:07
mvePIEBALDconsult22-Sep-09 4:07 
GeneralRe: Playing with Enumerations Pin
ezazazel22-Sep-09 6:47
ezazazel22-Sep-09 6:47 
GeneralRe: Playing with Enumerations Pin
PIEBALDconsult22-Sep-09 13:52
mvePIEBALDconsult22-Sep-09 13:52 
QuestionGetting data from a Listbox controlled by WPF and XML Pin
reg.orton22-Sep-09 0:24
reg.orton22-Sep-09 0:24 
Hi there,
I am quite new to C# and WPF especially. I have a form, with 2 listboxes on. The first looks up an xml file and gets some data items (themes), the next listbox is bound to the first, and gets some data (scenes) from inside the selected theme tag.

This works wonderfully.

I would now like to get the value of an element (FreeStyleCue) and use that in a c# function tied to the OnSelectionChanged handler.

However I cant work out for the life of me how to get the information from the FreeStyleCue tag.

Can anyone help me??

Here is the xml file.


<?xml version="1.0" encoding="utf-8" ?><br />
<themes><br />
  <theme name="Yellow" description="A yellow theme" order="1"><br />
    <scene name="PreShow" order ="1"><br />
      <description>For before the show yellow.</description><br />
      <FreeStyleCue>y12</FreeStyleCue><br />
    </scene><br />
    <scene name="Scenex" order ="1"><br />
      <description>During yellow show</description><br />
      <FreeStyleCue>y122</FreeStyleCue><br />
    </scene><br />
  </theme><br />
  <theme name="Blue" description="A blue theme" order="1"><br />
    <scene name="PreShow" order ="1"><br />
      <description>For before the show</description><br />
      <FreeStyleCue>b12</FreeStyleCue><br />
    </scene><br />
    <scene name="Scene1" order ="1"><br />
      <description>During Show</description><br />
      <FreeStyleCue>b122</FreeStyleCue><br />
    </scene><br />
  </theme><br />
</themes><br />


Here is the WPF XAML file

<Window x:Class="WpfApplication1.Window1"<br />
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"<br />
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"<br />
Title="Window1" Height="400" Width="800"><br />
    <Window.Resources><br />
<br />
        <XmlDataProvider x:Key="AllThemes" XPath="themes" Source="testdata.xml" /><br />
        <br />
        <br />
        <DataTemplate x:Key="dtThemes"><br />
           <br />
                <StackPanel FlowDirection="LeftToRight" Orientation="Vertical"><br />
<br />
                    <TextBlock Text="{Binding XPath=@name}" FontSize="15" /><br />
                    <TextBlock Text="{Binding XPath=@description}" /><br />
<br />
                </StackPanel><br />
           <br />
        </DataTemplate><br />
        <br />
        <br />
        <DataTemplate x:Key="dtScenes"><br />
            <StackPanel FlowDirection="LeftToRight" Orientation="Vertical"><br />
<br />
                <TextBlock Text="{Binding XPath=@name}" FontSize="15" /><br />
                <TextBlock Text="{Binding XPath=description}" /><br />
                <TextBlock Text="{Binding XPath=FreeStyleCue}" /><br />
                <br />
            </StackPanel><br />
        </DataTemplate><br />
<br />
<br />
<br />
    </Window.Resources><br />
<br />
<br />
<br />
    <Grid Name="gMain"><br />
        <Grid.ColumnDefinitions><br />
            <ColumnDefinition Width="123" /><br />
            <ColumnDefinition Width="8"/><br />
            <ColumnDefinition Width="*" /><br />
        </Grid.ColumnDefinitions><br />
        <br />
        <Menu Grid.Column="0" Grid.ColumnSpan="3"></Menu><br />
<br />
        <ListBox Name="listboxTheme" <br />
             ItemsSource="{Binding Source={StaticResource AllThemes}, XPath=theme}"<br />
             ItemTemplate="{StaticResource dtThemes}" HorizontalAlignment="Left" Width="123"><br />
        </ListBox><br />
<br />
        <GridSplitter Grid.Column="1"></GridSplitter><br />
<br />
        <StackPanel Grid.ColumnSpan="2" Margin="6,0,6,0" Grid.Column="1"><br />
            <ListBox Name="listboxScenes" <br />
                 ItemsSource="{Binding ElementName=listboxTheme, Path=SelectedItem, UpdateSourceTrigger=PropertyChanged}"                      <br />
                 ItemTemplate="{StaticResource dtScenes}" Height="650" SelectionChanged="listboxScenes_SelectionChanged"><br />
         <br />
            </ListBox><br />
        </StackPanel><br />
<br />
    </Grid><br />
</Window><br />


and the code that is asking for the data

<br />
 private void listboxScenes_SelectionChanged(object sender, SelectionChangedEventArgs e)<br />
        {<br />
            <br />
            <br />
            SelectQueueInFS(SelectionID); //this is where i am stuck!!! <br />
        }<br />
<br />

AnswerRe: Getting data from a Listbox controlled by WPF and XML Pin
vivasaayi22-Sep-09 19:37
vivasaayi22-Sep-09 19:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.