Click here to Skip to main content
15,896,153 members
Home / Discussions / WPF
   

WPF

 
General[Message Deleted] Pin
fjparisIII2-Jun-09 7:52
fjparisIII2-Jun-09 7:52 
GeneralRe: Problem executing BitmapDecoder.Save() in worker thread Pin
Mark Salsbery2-Jun-09 8:07
Mark Salsbery2-Jun-09 8:07 
General[Message Deleted] Pin
fjparisIII2-Jun-09 8:22
fjparisIII2-Jun-09 8:22 
GeneralRe: Problem executing BitmapDecoder.Save() in worker thread Pin
Mark Salsbery2-Jun-09 8:34
Mark Salsbery2-Jun-09 8:34 
General[Message Deleted] Pin
fjparisIII2-Jun-09 9:25
fjparisIII2-Jun-09 9:25 
QuestionRe: Problem executing BitmapDecoder.Save() in worker thread Pin
Mark Salsbery2-Jun-09 11:29
Mark Salsbery2-Jun-09 11:29 
GeneralRe: Problem executing BitmapDecoder.Save() in worker thread Pin
fjparisIII7-Jun-09 7:11
fjparisIII7-Jun-09 7:11 
QuestionWPF TreeViewItem Header Binding Pin
Etienne_12330-May-09 3:34
Etienne_12330-May-09 3:34 
Hi
I recently got it working to bind my XML document to my treeview by doing the following in the code behind file:

XDocument doc = XDocument.Load("path\\dsCurrent.xml");

_treeView.DataContext = doc;

and the following in the XAML:

<Window.Resources><br />
        <HierarchicalDataTemplate ItemsSource="{Binding Path=Elements}" x:Key="TVTemplate"><br />
            <TreeViewItem Header="{Binding Path=Name}"/><br />
            <!--<TreeViewItem Header="{Binding Path=Attribute[Title].Value}"/>--><br />
        </HierarchicalDataTemplate><br />
    </Window.Resources><br />
    <StackPanel><br />
        <TreeView x:Name="_treeView" ItemsSource="{Binding Path=Root.Elements}" ItemTemplate="{StaticResource TVTemplate}"/><br />
    </StackPanel>


Now my XML file looks like this:

- <Shippers><br />
  <ShipperID>1</ShipperID> <br />
  <CompanyName>Speedy Express</CompanyName> <br />
  <Phone>(503) 555-9831</Phone> <br />
- <Orders><br />
  <OrderID>10249</OrderID> <br />
  <CustomerID>TOMSP</CustomerID> <br />
  <EmployeeID>6</EmployeeID> <br />
  <OrderDate>1994-08-05T00:00:00+02:00</OrderDate> <br />
  <RequiredDate>1994-09-16T00:00:00+02:00</RequiredDate> <br />
  <ShippedDate>1994-08-10T00:00:00+02:00</ShippedDate> <br />
  <ShipVia>1</ShipVia> <br />
  <Freight>11.61</Freight> <br />
  <ShipName>Toms Spezialitäten</ShipName> <br />
  <ShipAddress>Luisenstr. 48</ShipAddress> <br />
  <ShipCity>Münster</ShipCity> <br />
  <ShipPostalCode>44087</ShipPostalCode> <br />
  <ShipCountry>Germany</ShipCountry> <br />
- <_x005B_Order_x0020_Details_x005D_><br />
  <OrderID>10249</OrderID> <br />
  <ProductID>14</ProductID> <br />
  <UnitPrice>18.6</UnitPrice> <br />
  <Quantity>9</Quantity> <br />
  <Discount>0</Discount> <br />
  </_x005B_Order_x0020_Details_x005D_>


When I start the app, my treeview gets created correctly, except it does not put the actual ShipperID value in as the name of the node, it shows "SupplierID". This is the same for all the nodes. How can I bind the Header of the treeview items so that it shows the values? I tried binding the header to Value but it then shows a whole bunch of information. How can I select specifically which value to set as the header for the treeview items?
AnswerRe: WPF TreeViewItem Header Binding Pin
Mark Salsbery31-May-09 9:17
Mark Salsbery31-May-09 9:17 
GeneralRe: WPF TreeViewItem Header Binding Pin
Etienne_12331-May-09 19:50
Etienne_12331-May-09 19:50 
GeneralRe: WPF TreeViewItem Header Binding Pin
Mark Salsbery31-May-09 20:36
Mark Salsbery31-May-09 20:36 
QuestionWPF and XML question Pin
Etienne_12330-May-09 1:59
Etienne_12330-May-09 1:59 
AnswerRe: WPF and XML question Pin
Pete O'Hanlon30-May-09 10:37
mvePete O'Hanlon30-May-09 10:37 
QuestionNumber updown control in WPF Pin
Nekkantidivya30-May-09 0:48
Nekkantidivya30-May-09 0:48 
AnswerRe: Number updown control in WPF Pin
ABitSmart30-May-09 1:41
ABitSmart30-May-09 1:41 
AnswerRe: Number updown control in WPF Pin
fjparisIII30-May-09 9:01
fjparisIII30-May-09 9:01 
QuestionWebbrowser control in Silver light Pin
Nekkantidivya29-May-09 19:43
Nekkantidivya29-May-09 19:43 
AnswerRe: Webbrowser control in Silver light Pin
Mark Salsbery31-May-09 9:20
Mark Salsbery31-May-09 9:20 
QuestionWPF and XML help Pin
Etienne_12329-May-09 3:56
Etienne_12329-May-09 3:56 
AnswerRe: WPF and XML help Pin
Mark Salsbery29-May-09 7:33
Mark Salsbery29-May-09 7:33 
AnswerRe: WPF and XML help Pin
Mark Salsbery29-May-09 8:35
Mark Salsbery29-May-09 8:35 
QuestionLink to Google Pin
mark_w_29-May-09 1:38
mark_w_29-May-09 1:38 
AnswerRe: Link to Google Pin
Pete O'Hanlon29-May-09 1:53
mvePete O'Hanlon29-May-09 1:53 
GeneralRe: Link to Google Pin
mark_w_29-May-09 2:12
mark_w_29-May-09 2:12 
GeneralRe: Link to Google Pin
Pete O'Hanlon29-May-09 2:28
mvePete O'Hanlon29-May-09 2:28 

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.