|
If I have an xml document of books, like:
<Books>
<Book>
<Title>WPF For The Hard-of-Learning</Title>
<Category>N</Category>
</Book>
</Books>
and an xml document of book categories:
<Categories>
<Category>
<ID>F</ID>
<Name>Fiction</Name>
</Category>
<Category>
<ID>N</ID>
<Name>Non-Fiction</Name>
</Category>
</Categories>
is there a way to bind the element value from the second document that is associated with an element in the first document?
To clarify using the above xml document examples, I'd like to display the book title and its category name (Non-Fiction), not its Category code (N).
In a code-behind file I'd like to load into XmlDocument objects the xml from a file that holds the Books xml and from a file that holds the Categories xml. In the code-behind I would assign the xml documents as the Document property of a couple XmlDataProviders defined in the XAML.
|
|
|
|
|
In your code behind, should be ViewModel, create a class, a Model, with the Book properties and add an additional property for the Category. Insert the records from the Book xml and update the item with the Category details.
This is the normal process of creating a model to match the UI requirements. Your UI will often not match the database structure, that is why there are such concepts as DAL, Mode, View, ViewModel.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi all ,
I need to create add in project in silver-light mvvm project , i'm complete new to create add in projects please help me .i checked in online and i found one project from this site .but it is working for only visual studio . I need to work for my project . please help me ...
Thank you .
|
|
|
|
|
Victor
Visual Studio is and IDE, Integrated Development Environment, your project and the article you found are BOTH built on VS, the article is just another project built by a developer. How you can call yourself a "Senior" developer in your profile baffles me!
Do some research into MEF[^]. However I would suggest you need to do some more basic reading before tackling MEF!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Mycroft Holmes wrote: How you can call yourself a "Senior" developer Means you can use Copy & Paste.
|
|
|
|
|
I think even that may be beyond him from the OP.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hello Mycroft Holmes ,
Thank you for your response , yes i was downloaded the sample project and try to understanding how that is implemented (this is not use for me but it will give some idea how to start,so that i downloaded.) Frankly i don't know how to create a add in project. I thought some one will give idea how start while posting this question but, i got different answer. please have any idea help me still if you think this is useless question just ignore this .
Thanks again.
|
|
|
|
|
Why have you sent this to me? I am (obviously) not Mycroft Holmes.
|
|
|
|
|
What do you mean by Add in Silverlight Project? This isn't a combination I've come across before - perhaps you could explain what effect you're expecting.
|
|
|
|
|
Hello together,
I´m struggeling with connection of two table in a datagrid.
What is the situation. I have one table (tbl_customer)which stores details about a customer, also the categoryID for the customer_category. A second table has the detailled information about the customer category.
So the categoryID in tbl_Customer is the foreign key and links to the second table tbl_Category. oidCategory (PK), txtLabel (string)).
Setting the ItemsSource of the datagrid to tbl_Customer I get all the details of the tbl_Customer (and the categoryID as int). Now I would like to have the txtLabel from the tbl_Category presented in the datagrid as well.
I know how to bind the foreign datas with a ComboBox, but not with as a textbox.
I hope I could explain my problem in a more or less understandable way.Has someone an idea where I can find a tutorial or which tags to use searching for more information.
Thanks for help in advance!
BR Thomas
|
|
|
|
|
So build a Model that meets your requirements in the viewmodel and load it up from the 2 tables, not everything you need is going to come from a nice little black box!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi,
I have to implement voice instruction to user in my WPF application.
Example: Please Enter Your Name.
Please suggest me any approach.
|
|
|
|
|
|
Hi,
I want to build my WPF project for Class Library Type/Windows Application Type. Its working for Windows application but not working for WPF application, kindly help me.
|
|
|
|
|
Eh? What? Do you mean that you want your application executable to reside inside a DLL and you want another piece of code kick off your application?
|
|
|
|
|
I have single project, When i set Project output type to class library it should generate DLL and when i set Project output type to Windows Application then it should generate exe.
|
|
|
|
|
Yes. That works for WPF as well. What exactly are you seeing?
|
|
|
|
|
Thanks for your reply.
I see this errors for WPF Application:
Error 1 Library project file cannot specify ApplicationDefinition element.
Error 2 The project file contains a property value that is not valid.
|
|
|
|
|
Remove the App.xaml and App.xaml.cs files. They are, effectively, the entry point for a WPF executable and they are not needed in a class library. The build type of App.xaml is ApplicationDefinition.
|
|
|
|
|
Oh thanks Pete O'Hanlon, its working fine.
One thing i want to put here: if I don't remove the App.xaml and App.xaml.cs file, and Change Build Action from ApplicationDefinition to Page then also it works.
Thanks
|
|
|
|
|
It does, but the App.xaml makes no sense inside the class library.
|
|
|
|
|
Yes you are correct, it doesn't make sense in class library. But my requirement is sometime I need DLL and sometime EXE, so I am not removing App.xaml file.
|
|
|
|
|
That's just really weird, and not a requirement, it sounds like a solution to another requirement.
The 'normal' way would be move the common bits to a class library, then you have an exe that references that library.
You don't switch an exe to dll just by changing the project setup or visa versa.
|
|
|
|
|
It's not weird, if I want reference the DLL in multiple exe other than the exe which is generated from by changing project output type Windows Application.
|
|
|
|
|
If you want to reference the dll from multiple exe's(or other dll's) then that's exactly what a class library is for.
Why do you think you now need to change that same class library to an exe? what is the exe going to do?
|
|
|
|