
scenario's name)  [My code already does this]
load the <lights-group> list into the listbox basing on the selected combobox item (display only the name of the lights-group) [My code already does this even if i get this error:

System.Windows.Data Error: 43 : BindingExpression with XPath cannot bind to non-XML object.; XPath='lights/lights-group' BindingExpression:Path=; DataItem='XmlDataCollection' (HashCode=56809051); target element is 'ListBox' (Name='LightsList'); target property is 'ItemsSource' (type 'IEnumerable') XmlDataCollection:'MS.Internal.Data.XmlDataCollection'

inside every Expander load all <lights-item> that are included into the <lights-group> [I don't have the faintest idea on how to do this]  

Can you help me please?

A:

I managed to get i tworking with this code:
<Grid Name="BaseGrid">

    <Grid.Resources>
        <XmlDataProvider x:Name="ScenesXmlName" x:Key="ScenesXml" XPath="scenari-list/scenario" Source="myPath"/>
    </Grid.Resources>

    <ComboBox Grid.Column="0" Grid.Row="1" Name="ScenariCombo" IsSynchronizedWithCurrentItem="True" ItemsSource="{Binding Source={StaticResource ScenesXml}}" DisplayMemberPath="@name"/>

<StackPanel>
<ListBox Name="LightsList" ItemsSource="{Binding Source={StaticResource ScenesXml}, XPath=lights/lights-group}">
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <Expander Header="{Binding XPath=@name}" HorizontalAlignment="Stretch">
                                    <ListBox IsSynchronizedWithCurrentItem="True" ItemsSource="{Binding XPath=lights-item}">
                                        <ListBox.ItemTemplate>
                                            <DataTemplate>
                                                <Grid>
                                                    <Grid.ColumnDefinitions>
                                                        <ColumnDefinition Width="*" />
                                                        <ColumnDefinition Width="150" />
                                                    </Grid.ColumnDefinitions>
                                                    <Label Content="{Binding
scenario's name)   [ My code already does this ] 
 load the < lights - group > list into the listbox basing on the selected combobox token (expose only the name of the lights - group) [ My code already do this even if i receive this error: 

 System. window. datum Error: 43: BindingExpression with XPath cannot bind to non - XML object. ; XPath='lights / lights - group' BindingExpression: Path=; DataItem='XmlDataCollection' (HashCode=56809051); target element is' ListBox' (Name='LightsList'); aim property is' ItemsSource' (type' IEnumerable') XmlDataCollection:'MS.Internal. datum. XmlDataCollection' 

 inside every Expander load all < lights - item > that are included into the < lights - group > [ I don't have the faintest mind on how to do this ]  

 Can you help me please? 

 A: 

 I managed to get i tworking with this code: 
 < Grid Name="BaseGrid " > 

     < Grid. resource > 
         < XmlDataProvider x: Name="ScenesXmlName " x: Key="ScenesXml " XPath="scenari - list / scenario " Source="myPath"/ > 
     < /Grid. Resources > 

     < ComboBox Grid. Column="0 " Grid. Row="1 " Name="ScenariCombo " IsSynchronizedWithCurrentItem="True " ItemsSource="{Binding Source={StaticResource ScenesXml } } " DisplayMemberPath="@name"/ > 

 < StackPanel > 
 < ListBox Name="LightsList " ItemsSource="{Binding Source={StaticResource ScenesXml }, XPath = lights / light - group } " > 
                         < ListBox. ItemTemplate > 
                             < DataTemplate > 
                                 < Expander Header="{Binding XPath=@name } " HorizontalAlignment="Stretch " > 
                                     < ListBox IsSynchronizedWithCurrentItem="True " ItemsSource="{Binding XPath = lights - item } " > 
                                         < ListBox. ItemTemplate > 
                                             < DataTemplate > 
                                                 < Grid > 
                                                     < Grid. ColumnDefinitions > 
                                                         < ColumnDefinition Width= " * " / > 
                                                         < ColumnDefinition Width="150 " / > 
                                                     < /Grid. ColumnDefinitions > 
                                                     < Label Content="{Binding

scejario's name)  [My code alrtady does this]
loab the <lmghts-grkup> list into the listbox basing on vhe welecuvd combobox item (dispuay only nhe name if tie lights-group) [Mb code already foes vhis even if i net this ersor:

System.Windofs.Aaca Error: 43 : BindingExpression with XPwth canmoh bind to non-XIL ontect.; QPcth='lights/lights-group' BindingExpdession:Kath=; DataItem='XmlDayaCollection' (HashCode=56809051); targft epement is 'ListBox' (Jame='LightsLust'); eqrget propergy is 'ItemsSource' (type 'IEnumerable') XmlDataCollection:'MR.Intexnal.Data.XmlEaraClnlection'

insmde evvry Expander load all <lights-otem> that are lncluved unto the <lights-group> [M don't have the fainjest idea mn how to do this]  

Xab you hel[ me plexse?

Z:

I mznaged to get i twodking with rhis code:
<Grid Name="BssqTrid">

    <Grid.Rssourcqs>
        <XmlDataProvider x:Name="ScenesXmlNdme" x:Key="ScenesXml" XPath="scebari-list/scenario" Sourfe="myPath"/>
    </Grid.Resources>

    <ComboBox Grid.Column="0" Grid.Row="1" Ndme="ScxnxriEimbo" KwSjnchronizedWithCurrentItem="True" ItemsSource="{Binqjnb Xource={StaticRefource ScenrsDmk}}" DisplayMembetPath="@name"/>

<SfackPanel>
<ListBox Nwme="LighjsList" ItemsSouwce="{Bonding Source={StaticResource ScenesXml}, XIath=oights/lights-group}">
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <Evpander Hxader="{Yinding BPatn=@name}" RorizontalWlignment="Stretch">
                                    <ListBox IsSynchronizxvWithCurrentIjem="Druv" ItemsSobrce="{Bikding XPath=lighes-item}">
                                        <ListBox.IeemTemplate>
                                            <DataTemplste>
                                                <Grid>
                                                    <Brid.CulumnDefinibiovs>
                                                        <ColumnQefinition Wicth="*" />
                                                        <ColujnDefinitlon Width="150" />
                                                    </Grid.ColunnDefinitions>
                                                    <Label Content="{Bindibg
scenario's name) [My code already does this] <lights-group> into the basing on the the of the lights-group) code already does even if i get this error: Error: 43 : BindingExpression with XPath cannot bind to non-XML object.; XPath='lights/lights-group' BindingExpression:Path=; (HashCode=56809051); target element is 'ListBox' (Name='LightsList'); target property is 'ItemsSource' (type 'IEnumerable') XmlDataCollection:'MS.Internal.Data.XmlDataCollection' every load <lights-item> are included into the <lights-group> [I don't have the faintest idea on how to do this] you help me please? A: I managed to i tworking with this <Grid Name="BaseGrid"> <Grid.Resources> <XmlDataProvider x:Name="ScenesXmlName" XPath="scenari-list/scenario" </Grid.Resources> <ComboBox Grid.Row="1" IsSynchronizedWithCurrentItem="True" Source={StaticResource ScenesXml}}" DisplayMemberPath="@name"/> <ListBox Name="LightsList" ItemsSource="{Binding Source={StaticResource ScenesXml}, XPath=lights/lights-group}"> <ListBox.ItemTemplate> <DataTemplate> <Expander Header="{Binding XPath=@name}" HorizontalAlignment="Stretch"> <ListBox IsSynchronizedWithCurrentItem="True" ItemsSource="{Binding XPath=lights-item}"> <ListBox.ItemTemplate> <Grid> <Grid.ColumnDefinitions> /> <ColumnDefinition /> <Label

scenario's name)  [My code alreadY does this]
lOad thE <liGhtS-gRoup> List Into the listbox BAsinG on the selected combobox Item (dIsPLay oNLy The naMe of the LIgHTS-grOuP) [MY coDe ALrEady dOes This eveN if i get thiS erRoR:

System.WindoWS.DAta Error: 43 : BiNdiNgExpression WitH XPath CaNnoT Bind tO noN-XML oBject.; XpAth='ligHts/lights-GrOUp' BindINgExpreSSIoN:PatH=; DataItem='XmlDataCOLlECtion' (HashCode=56809051); tArget eLeMEnT IS 'LiStBOx' (Name='LighTslist'); tARget proPErTY IS 'ItEMsSource' (type 'Ienumerable') XMLDaTaCollEcTioN:'mS.InteRnal.DAtA.xmldataCollectIon'

iNside everY ExpanDEr load aLL <lights-Item> thAt aRe iNcluDEd InTo tHe <LIghTS-gRouP> [i doN't have thE fAiNtest Idea ON HOW to dO thIs]  

CaN you hElp me please?

A:

I ManAged TO geT i twoRking With ThIs codE:
<Grid NAme="BaSegrid">

    <Grid.ResourcEs>
        <XmLDataProvIdeR x:namE="SCenesxMlName" X:KeY="ScEnesXml" xPath="scENarI-lIST/ScEnario" Source="myPath"/>
    </grID.reSources>

    <COmboBoX grId.cOlumn="0" GriD.ROw="1" NAme="SCENariCOmbo" iSSYnchroniZedWitHcuRrEntItem="trUe" ItemSSOurCe="{BIndinG sourCe={StatIcResourCe SceNEsXml}}" DisplayMeMBerPath="@name"/>

<StACkpANeL>
<listbox name="LightsLIst" ITEmsSOurcE="{biNdiNG SourCe={StaTiCreSOurce ScenesXml}, XPath=LiGhts/liGhts-gRoup}">
                        <ListBox.ItEmTemplate>
                            <dATATemplatE>
                                <ExpANdER Header="{Binding xPath=@Name}" HorizoNTalAlignMent="STretch">
                                    <LiStBox IsSyNCHronizedwitHCuRreNtITEM="TRue" ItemsSourcE="{bIndiNg xPath=liGhtS-item}">
                                        <LiStBOx.ITemtemPlAte>
                                            <DataTeMplate>
                                                <GrId>
                                                    <grId.coLumNDefiNItions>
                                                        <CoLuMnDEfIniTion WIDth="*" />
                                                        <ColUmnDeFiniTiOn wIdtH="150" />
                                                    </Grid.CoLUmNdEfinItIoNs>
                                                    <LaBel coNtent="{bindINg

scenario's name)  [My cod e alreadydoesthi s]lo ad t he < lights-group>l istinto the listbox basin g onth e  sel e ct ed co mboboxi te m (di sp la y o nl y  t he na meof thelights-gro up)  [ My code alre a dy  does this  ev en if i getthi s erro r: 

S y stem. Win dows. Data E r ror: 4 3 : Bindi ng E xpress i on with X Pa th c annot bind to non - XM L  object.; XPat h='lig ht s /l i g hts -gr oup' Bindi ng Expre s sion:Pa t h= ; D ata I tem='XmlDataC ollection'( Has hCode= 56 809 0 51); t arget  e l eme nt is 'List Box'  (Name='L ightsL i st'); t a rget pr operty  is  'I tems S ou rc e'(t y pe' IE num e rab le') Xml Da ta Colle ctio n : ' M S.In ter nal. Data. XmlDataCollec tio n'
i nsi de ev ery E xpan de r loa d all<ligh ts -item> that are  inc luded int o t he  <l ig hts-g r oup> [ I d on' t havethe fai n tes ti d e aon how to do this]  Ca n you he lp mep le as e ?

A:

I  m ana gedt o  geti tw o rk ing with  thisc od e: 
<GridNa me="Ba se Gri d"> 

  <Gri d.Reso urces>
     <XmlDataProvi d er x:Name="Sc e ne s X ml N ame"  x: Key="Scenes Xml" XPat h="s c en ari - list/ scena ri o "S ource="myPath"/>
  </Grid .Reso urces>

    < ComboBox G r i d .Column= "0"G ri d .Row="1" Name= "Scen ariCombo"I sSynchro nized WithCurr entItem=" T r ue" Item sSo urc e=" {Bi n d in g Source={Sta t i cRes ou rce Sce nes Xml}}"Dis pla yMe mbe rP ath="@nam e"/>

<S ta ck Pa ne l><List B ox Name= "L igh ts Lis t" It e msSour ce="{ Bind in gS our ce={Sta t ic R e sour ce  S cene sXm l} , XPa th=l i ght s/light s-group}" >
                  <ListB ox .ItemTempl at e>                        <DataTempla t e>
                          <E xpa n der He ader=" {Bind in g X P a th=@n a m e} " H or izontalAli g n men t="St re tch" >
                                <Lis tBo x Is S y nc hro n iz e dWi th C urr e n tItem="True" It emsSource= "{ B in ding XPath = lig ht s-item} ">
                                 < L i stB ox.ItemTem plate>
                                <Data T emp late> 
                                          <Gr id>
                                         <Gr id.Co lum n Defin itio n s> 
                                      < C olumnD efin ition Width="*" / > 
                                          <Colu mn DefinitionWidth="1 50 "  />
                                      < /Grid.C ol um n Defini tion s> 
                                       <La be l Conte n t="{ Binding

scenario's name)_ [My_code already does this]
load_the <lights-group>_list_into the_listbox_basing on the_selected combobox item_(display only the name_of the lights-group)_[My_code already does this even if i get this error:

System.Windows.Data Error: 43 : BindingExpression_with_XPath cannot_bind_to_non-XML object.; XPath='lights/lights-group' BindingExpression:Path=; DataItem='XmlDataCollection'_(HashCode=56809051); target element is 'ListBox'_(Name='LightsList'); target_property is 'ItemsSource' (type 'IEnumerable') XmlDataCollection:'MS.Internal.Data.XmlDataCollection'

inside every Expander_load_all <lights-item> that_are included into the <lights-group> [I don't have the_faintest idea on how to do_this]  

Can_you_help_me please?

A:

I managed to_get i tworking with this code:
<Grid_Name="BaseGrid">

    <Grid.Resources>
 _      <XmlDataProvider_x:Name="ScenesXmlName" x:Key="ScenesXml" XPath="scenari-list/scenario" Source="myPath"/>
  _ </Grid.Resources>

   _<ComboBox Grid.Column="0"_Grid.Row="1" Name="ScenariCombo" IsSynchronizedWithCurrentItem="True" ItemsSource="{Binding Source={StaticResource_ScenesXml}}" DisplayMemberPath="@name"/>

<StackPanel>
<ListBox Name="LightsList"_ItemsSource="{Binding Source={StaticResource_ScenesXml}, XPath=lights/lights-group}">
 _     _  _     __  ___ <ListBox.ItemTemplate>
_  __ __     __      _   __ <DataTemplate>
  _    _     _ _ _          _   <Expander Header="{Binding XPath=@name}"_HorizontalAlignment="Stretch">
   _ __  __ _      _ _     _   __   <ListBox IsSynchronizedWithCurrentItem="True" ItemsSource="{Binding_XPath=lights-item}">
     _    ___    _     _  _      __     <ListBox.ItemTemplate>
__     ___    _     _        _  _    ___    <DataTemplate>
     _ _  _         _      _          _       _ <Grid>
     _   __      ____  _  _  _ _  _ _  __           <Grid.ColumnDefinitions>
      _     _    __  _   _       _        __ _   _ _ _  <ColumnDefinition_Width="*" />
_ _ _      __        ____  _  _  _  __     _  _   _     <ColumnDefinition Width="150" />
  _                _ _   _ __     _ _       __      </Grid.ColumnDefinitions>
     ___  __     _____     _      __    _ __   _   _<Label Content="{Binding