XmlDataProvider .... is gone completely in my Xaml file. Why? How many different ways to deal with xml data source through WPF

I followed a procedure described in a book.
1. insert "Inventory.xml" file to a project "WpfXmlDataBinding" .
2. add the XML data source through the data panel of "blend for 2013", named it "InventoryXmlDataStore" and store it in the current document.
3. dragged and droppped the nodes from the Data panel onto the artboard.
Then I checked my Xaml file against the one provided by the book
Xaml file by the book:
<Window.Resources>
<!-- This part is missing in my xaml file --><XmlDataProvider x:Key="InventoryDataSource"
Source="\Inventory.xml"
d:IsDataSource="True"/>
<!-- This part is missing in my xaml file -->
<DataTemplate x:Key="ProductTemplate">
<StackPanel>
<TextBlock Text="{Binding XPath=@ProductID}"/>
<TextBlock Text="{Binding XPath=Cost}"/>
<TextBlock Text="{Binding XPath=Description}"/>
<CheckBox IsChecked="{Binding XPath=HotItem}"/>
<TextBlock Text="{Binding XPath=Name}"/>
</StackPanel>
</DataTemplate>
</Window.Resources>
<Grid>
<ListBox HorizontalAlignment="Left"
ItemTemplate="{DynamicResource ProductTemplate}"
ItemsSource="{Binding XPath=/Inventory/Product}"
Margin="89,65,0,77" Width="200"/>
</Grid>
my Xaml file:
<Window x:Class="WpfXmlDataBinding.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="922" Width="874">
<Window.Resources>
<DataTemplate x:Key="ProductTemplate">
<StackPanel>
<TextBlock Text="{Binding XPath=@ProductID}"/>
<TextBlock Text="{Binding XPath=Cost}"/>
<TextBlock Text="{Binding XPath=Description}"/>
<CheckBox IsChecked="{Binding XPath=HotItem}"/>
<TextBlock Text="{Binding XPath=Name}"/>
</StackPanel>
</DataTemplate>
</Window.Resources>
<Grid DataContext="{Binding Source={StaticResource InventoryXmlDataStore}}">
<ListBox HorizontalAlignment="Left" Height="370"
ItemTemplate="{DynamicResource ProductTemplate}"
ItemsSource="{Binding XPath=/Inventory/Product}"
Margin="65,55,0,0" VerticalAlignment="Top" Width="270"/>     
    </Grid>
</Window>
All looks quite the same except the <XmlDataProvider ....> part under <Window.Resources>, which is gone completely in my Xaml file.
1, Why?
2, How many different ways to deal with xml data source through WPF?
Thanks, guys.
(ps My "WpfXmlDataBinding" runs without problem through.)

Never do yourself down Richard.
Leave that to other people.
It's quite common for smart developers to think they're not as good as they are.
I coach a fair bit and it's a surprisingly common feeling.
And to repeat.
Never use anything ends .. provider.  They're for trivial demo apps.  Transform xml into objects and use them.  Write it back as xml.  Preferably, use a database.
You want to read a little mvvm theory first.
http://en.wikipedia.org/wiki/Model_View_ViewModel
Whatever you do, don't read Josh Smiths explanation.  I used to recommend it but it confuses the heck out newbies. Leave that until later.
Laurent Bugnion did a great presentation at mix10.  Unfortunately that doesn't seem to be working on the MS site, but I have a copy.  Download and watch:
http://1drv.ms/1IYxl3z
I'm writing an article at the moment which is aimed at beginners.
http://social.technet.microsoft.com/wiki/contents/articles/30564.wpf-uneventful-mvvm.aspx
The sample is just a collection of techniques really.
I have a sample which involves no real data but is intended to illustrate some aspects of how viewmodels "do stuff" and how you use datatemplates to generate UI.
I can't remember if I recommended it previously to you:
https://gallery.technet.microsoft.com/WPF-Dialler-simulator-d782db17
And I have working samples which are aimed at illustrating line of business architecture.  This is an incomplete step by step series but I  think more than enough to chew on once you've done the previous stuff.
http://social.technet.microsoft.com/wiki/contents/articles/28209.wpf-entity-framework-mvvm-walk-through-1.aspx
The write up for step2 is work in progress.
https://gallery.technet.microsoft.com/WPF-Entity-Framework-MVVM-78cdc204
Hope that helps.
Recent Technet articles: Property List Editing;
Dynamic XAML

Similar Messages

  • I used time machine to restore on a formatted MAC. Now the HDD space has reduced by 100GB but I cannot see any of the files. How do I find and delete those 100GB data from the HDD?

    I used time machine to restore on a formatted MAC. Now the HDD space has reduced by 100GB but I cannot see any of the files. How do I find and delete those 100GB data from the HDD?

    dglenn9000 wrote:
    I created a new user account just to see if it was my user Library or if there was something wrong with my system. And the new user account is doing most of the same things so I will need to do a full restore anyway.
    Not necessarily. I'd suggest downloading and installing the "combo" update. That's a combination (thus the clever name) of all the updates to Leopard since it was first released, so installing it should fix anything that's gone wrong since then, such as with one of the normal "point" updates. Info and download available at: http://support.apple.com/downloads/MacOS_X_10_5_8_ComboUpdate Be sure to do a +Repair Permissions+ via Disk Utility (in your Applications/Utilities folder) afterwards.

  • HT1386 How many different computers can I sync my iPod with?  My laptop crashed and was completely wiped clean and this was the machine that my iPod synced with so I don't know if it will be counted as a "new" computer.

    How many different computers can I sync my iPod with?  My laptop crashed and was completely wiped clean and this was the machine that my iPod synced with so I don't know if it will be counted as a "new" computer when I sync my iPod.

    You can sync with onee at a time. Syncing to another will erase the current content.
    Copy everything from your backup copy of your old computer to your new one.

  • HT1386 The laptop I originally synch'd my iphone 4s with is broken and cannot retrieve any files. How can I sync the phone with a new laptop without losing all my downloaded music and apps already installed on my iphone?

    The laptop I originally synch'd my iphone 4s with is broken and cannot retrieve any files. How can I sync the phone with a new laptop without losing all my downloaded music and apps already installed on my iphone?

    If the answer to the above question is "yes", FIRST, set up a backup of your new computer before you do anything else so the next time your computer breaks you will not be in the same situation. Backup solutions are numerous and inexpensive, and there is absolutely no excuse in the Third Millennium not to have one.
    Then see this tip: https://discussions.apple.com/docs/DOC-3141

  • How can I change the language with the .dat (.bak) file?

    How can I change the language with the .dat (.bak) file? Is it legal?
    How does it work?
    Thanks for answering

    https://discussions.apple.com/message/17364930#17364930

  • I am receiving excel files, which I need to convert with my macbook pro...I did this with export, but the file I got didnt show graphs as it should...can you help...do I need to buy excel for Apple computer, or is there any easier way of dealing with it..

    I am receiving excel files, which I need to convert with my macbook pro...I did this with export, but the file I got didnt show graphs as it should...can you help...do I need to buy excel for Apple computer, or is there any easier way of dealing with it..does App  "Numbers" help here?

    Numbers should be able to read Excel files without any problems.    If Numbers does not read the graphics properly then you can try Excel Online. https://office.live.com/start/Excel.aspx

  • If I buy the Small Business Complete CC for $49.99/mo how many computers can I install

    If I buy the Small Business Complete CC for $49.99/mo how many computers can I install & run this on? 

    You can install it on any number of computers but can activate & use it twice only(on the same or different computer)
    Please refer to: http://www.adobe.com/legal/licenses-terms.html
    Regards
    Rajshree

  • Filling PDF Form with XML data file

    Hello everybody.
    I need help.
    I created a form with LiveCycle Designer. I filled it and generated a XML data files. Now, I would like to fill the same blank PDF form with this XML data file.
    I know that I can do it with Adobe 8.0 but I must do it in an C# / .NET application that I have to create.
    (Forms I'm creating are not for me, I create the forms. Client uses them form but he don't have Adobe Acrobat 8.0, so he can't realise the automatic PDF filling with Adobe Acrobat 8.0)
    So I am looking for help with ".NET" "COM" or other library to help me to do it. If someone has other idea just give it.
    Thanks for your reply
    Jean Pierre (sorry for my bad English)

    Hello Mike
    Thank's for your reply. I used XPAAJ and it works very well but my company his develloping software with C# langage.
    I tried to convert XPPAJ to C#, I did it with the Java Langage Conversion Assistant but "Adobe Library" included in jar files cannot be translated to C#/.NET library. So, I can't use it.
    I found some C#/.NET API on the NET but they are very expensive and my company don't want to pay. They want me to create my own solution with library given by Adobe when you buy Adobe 8. So I am looking for this library.
    Is there an Adobe LiveCycle Designer SDK to help me.
    Thank you in advance for your reply
    Jean Pierre (student developing with LiveCycle Designer)

  • PDF file size grows each time form is saved (with no data changes). Why?

    I have an SAP Adobe form (PDF) and we are seeing a difference in the Save behavior between when it is viewed in Adobe Reader vs. the adobe plug-in(?) for Internet Explorer.
    When the form is viewed in Internet Explorer, every time the user saves the form the file size grows (even with no data changes in the form - i.e., open the form, hit save).  This is not true if the form is opened in Adobe Reader.
    The form in question has multiple pages but the only fields directly bound to the SAP source are a handful of identifiers (e.g., order number) and a dynamic table.  It appears from our testing that the more entries in the table when the form is created, the greater the size increase each time the file is saved.  The table length is not changed after the form is first generated.
    Is there a known difference in the behavior of Adobe Reader vs. the browser plug-in which would account for this difference?  Our users have Adobe Reader X installed on their machines.

    If this is an XFA form, as opposed to an Acroform, you should ask in the LiveCycle Desiger forum or a more relevant LiveCycle forum.

  • Handling large xml data source files

    Post Author: LeCoqDeMort
    CA Forum: Crystal Reports
    Hello. I have developed a crystal report that uses an xml data file as a data source (supported by an xml schema file). I have successfully run the report for small sample xml data files, but I now have a realistic data file that is around 4Mb in size.When I run the report within the Crystal Reports designer (ver. 11.0.0.1994), i get a "failure to retrieve data from database" error.  Is there some sort of configurable limit on data file/cache size that I can adjust - if indeed that is the problem? Thanks LeCoq 

    Post Author: LeCoqDeMort
    CA Forum: Crystal Reports
    Hello. I have developed a crystal report that uses an xml data file as a data source (supported by an xml schema file). I have successfully run the report for small sample xml data files, but I now have a realistic data file that is around 4Mb in size.When I run the report within the Crystal Reports designer (ver. 11.0.0.1994), i get a "failure to retrieve data from database" error.  Is there some sort of configurable limit on data file/cache size that I can adjust - if indeed that is the problem? Thanks LeCoq 

  • Can I make basic adjustments to RAW files in PS the same way I do with jpgs using levels+clone tool?

    I have basic knowledge of photoshop and normally just work with Jpegs. I need to edit some RAW files can I open them in Photoshop and work on them the same way as jpegs. I would only need to do some basic levels adjustments and use the clone tool. Is photoshop the best application to use for editing raw files?

    Starting with RAW affords you more toning flexibility with white-balance and white/black points, and more sharpening and noise-reduction flexibility, than starting with JPGs where the camera has taken care of such things and the adjustments are baked in and cannot be changed.
    The camera-raw plug-in for Photoshop is very good for working with individual raw files.  If you are switching your photography from JPG to RAW then Lightroom has the same adjustments as the PS CR plug-in but is more efficient when working with many files compared to Bridge and Photoshop.
    Personally, because I shoot only RAW photos, now, I switched from using PS/CR to LR quite a few years ago, and rarely go to PS anymore.  Since you are used to PS, your old habits will probably still be with you, so you may find yourself doing a minimal amount of editing in CR.
    Because you’re are dealing with RAW sensor data, you will want to pay attention to the WB and black/white points as well as sharpening and noise-reduction before opening the RAW files in PS for your normal PS adjustments.

  • Create XLS file with XML data

    Hello,
    Is there Java libraries to create Excel files from XML data, like FOP that creating PDF files ?
    Another question : where can I find the javadoc of FOP's classes, particularly org.apache.fop.apps.Driver class ? Because I can't find it on http://xml.apache.org
    Thanks

    Use http://jakarta.apache.org/poi/

  • What is the best file type to use when dealing with text data?

    Hello,
    I am trying to read off text information from a file stored on the phone. I am currently using a txt file to store the data; however the input streaming process is very slow. Is there another way, or file type I can use which is much quicker?
    Regards,
    vj

    do buffering in stead of reading char by char.

  • Lost files. How to reset to an earlier time or date.

    Dont have time machine and really need to set the mac to an earlier time of the day/date/the last time it was turned on. Lost very important files:(

    Maybe a long shot, but you could download the demo of a data rescue utility such as data Rescue III and see if it can see the missing files. If so, and they have not yet been overwritten, you may be able to retrieve them.
    Good luck!

  • What's the best way to deal with Canon pf24 files?

    I'm working on a project shot mainly with Canon DSLR footage (1080p, 24fps.) But now I would like to add some footage from a Canon Camcorder recording in AVCHD format. It would seem to make the most sence to shoot at 24fps, or as Canon calls it pf24. The question is, is premiere or media encoder able to interpret the canon footage and do the proper 3-2 pulldown? Or should I record in 30fps (or pf30) and convert the footage to 24 fps in media encoder before adding it to my project? Keep in mind that I can't just shoot everything in 30p because the bulk of the project is already shot at 24p. Also, I am using CS6. Does anyone have experience with this? Thoughts?

    Ed you are soo right!   PP does not automatically fix the problem by dropping the footage into a 24p AVCHD sequence.  If you have CS6 PP and AE you can use easily fix this ugly problem.
    Excuse me why I step up on my soapbox - Adobe Premiere Pro development team -- please fix this @$%& problem asap!!!!  The PP Interpret footage function is a joke without it!
    The best solution I could come up with after investing a ton of time into this is to use AfterEffects inside PP as a filter.  Therefore you will not have to duplicate or re-render all your PF24 footage to create true 24p clips.  You work with the same source clips throughout the entire process.  Here's what you do - 1st create a 24p AVCHD sequence in PP and drop your PF24 clips into it. Now you can select individual clips or the entire sequence of clips and "right click" and select "Replace with AfterEffect Composition".  This will export the selected clip(s) into AE.  Now you can use the world-famous AE Interpret footage function to remove the pulldown issues.  Inside AE right-click the clip - select Interpret footage - select the fielding (in my case it was Upper Field First) - then finally the "magic bullet" - select "Guess 3:2 Pulldown" button.  Now when you jump back into PP you will be working with beautiful "TRUE" 24p footage.
    All the best!

Maybe you are looking for

  • What fan is used and is it possible to upgrade it

    i've been wonering if i could upgrade my fan for my hp 250 g1 to increase the performance and i use it as a gaming laptop because it was fairly cheap, it peaked my mind because if i could do that then could i also increase my cpu plus this laptop/not

  • How to only allow internet access.

    I've got an ASA with two "outside" interfaces and twelve "inside" interfaces. I'd like to separate the Access Lists between outside access and inside access. By default I'd like the inside interfaces access to the internet and nothing else and then b

  • With ios6 the app store closes everytime i try and search for an app

    ok so everytime i try and search for an app on the app store through my itouch it closes out... it has only done it since i updated to ios6

  • Misunderstanding of "textual form"...

    (3) Class PatientRecord Implement the PatientRecord class(DONE). Declare all the required instance variables together with their set and get methods(DONE). Also implement a method that provides a summary of the whole record in textual form(What does

  • SQL Server Profiler (2008)

    How do I start up 'SQL Profiler'? Can it be used to get information from an application query using SQL Server 2008 such as table Name, column etc. In short can you display the SQL that was run to develop a screen from an external application. Apllic