|
Mike Hankey wrote: Value TaskMgrResourceDictionary.xaml cannot be assigned to property 'Source'. The resource dictionary XAML file has errors and cannot be loaded.
Since it works inline, your problem seems to be in the resources, as
indicated by the errors. That's probably a good place to look for errors
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark,
I had this problem using a DataGrid control and turned out that I could remove the code that styled the headers and it worked for a while then quit again a short time later. I'm thinking it has something to do with UserControls but not quite sure. The reason I posted this question was to see if anyone else had had this problem using UserControls in their app. I've heard that there are problems using them and was wanting to see if this was one of them.
Thanks,
Mike
"It doesn't matter how big a ranch ya' own, or how many cows ya' brand, the size of your funeral is still gonna depend on the weather." -Harry Truman.
Semper Fi
http://www.hq4thmarinescomm.com[ ^]
My Site
|
|
|
|
|
I use UserControls extensively and I've never had any problems with them. The only thing I can think of is that you might have a problem with the way they have been registered when you have merged your ResourceDictionaries.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys
|
|
|
|
|
Operator error, surely not.
This is my app.xaml file.
<Application x:Class="WpfTaskManager.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="TaskMgrResourceDictionary.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>
Appreciate the input. You've convinced me that I am the cause of the problem so will get with the program and find it. Didn't want to pull my hair out over this one, (as I get older and my hair thinner I have to be careful of the problems involving hair pulling. , if it wasn't something that I had done.
Thanks,
Mike
"It doesn't matter how big a ranch ya' own, or how many cows ya' brand, the size of your funeral is still gonna depend on the weather." -Harry Truman.
Semper Fi
http://www.hq4thmarinescomm.com[ ^]
My Site
|
|
|
|
|
Mike,
Ditto Pete's reply - If UserControls had a major malfunction I'd be in a
world of pain and tears
I still suspect the culprit is in the bowels of your TaskMgrResourceDictionary.xaml.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thanks guys,
You are probably right, its got to be somewhere in there and will remove code until I find it.
I'm just getting my sleaves rolled up with WPF and am bound to make many stupid mistakes. Hope y'all will bear with me. I can get most of them without help but sometimes I just plain get frustrated and need a shove, or a shift kick in the kester.
Thanks again,
Mike
"It doesn't matter how big a ranch ya' own, or how many cows ya' brand, the size of your funeral is still gonna depend on the weather." -Harry Truman.
Semper Fi
http://www.hq4thmarinescomm.com[ ^]
My Site
|
|
|
|
|
Mike - I've got to recommend Blend as an invaluable help here. It allows you to save resources, which you set through the interface, removing chances for errors.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys
|
|
|
|
|
Pete O'Hanlon wrote: I've got to recommend Blend as an invaluable help here
Pete,
You are probably right but there are/were two things that held me back from purchasing;
1) I'm just to damn cheap to buy it, can't justify the $500
2) I looked at like this. It's like driving a car, if you learn to drive a stick you can drive anything on the road, if you learn automatic your limited. Don't know if this makes any sense or not?
I've got a trial version of blend but really haven't taken the time that I should with it. Boss at work gave us an assignment to do an Outlook demo and I thought it was pretty cool, had some quirks but it was probably just me.
I'll give blend another try.
Thanks,
Mike
"It doesn't matter how big a ranch ya' own, or how many cows ya' brand, the size of your funeral is still gonna depend on the weather." -Harry Truman.
Semper Fi
http://www.hq4thmarinescomm.com[ ^]
My Site
|
|
|
|
|
Mike Hankey wrote: if you learn to drive a stick you can drive anything on the road, if you learn automatic your limited. Don't know if this makes any sense or not?
I'm from the UK. That's pretty much the only way to learn over here. If you learn automatic over here, you're not qualified to drive stick.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys
|
|
|
|
|
Use DynamicResource because the resource is defined in an external file and will not be resolved until runtime.
|
|
|
|
|
|
Cool! Thanks for the update!
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
No problem fella. I haven't installed it myself yet as I have too many deadlines at the mo to risk any problems. Have you gone for it yet?
Cheers,
|
|
|
|
|
Jammer wrote: Have you gone for it yet?
Applied hotfix late last night, working with XAML today...we'll see...
it may take a while to realize it's crashing less, since I never had a
reproduceable case.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Gotcha. Pre SP1 I was seeing at least a couple of crashes a day with with XAML so it's interesting to see this appear now.
|
|
|
|
|
Can anyone help me in letting me know how to bind a dataset to a listbox in a WPF XBAP application.
The dataset contains a table with two columns.
-----Have A Nice Day-----
|
|
|
|
|
You bind the DataContext of the ListBox to the DataSet and set the ItemsSouce binding with Path as the tablename
OR you directly bind the table to the ItemsSource property.
|
|
|
|
|
Hi,
Can you please provide me the code to set the ItemSource binding to the path as suggested by you.
-----Have A Nice Day-----
|
|
|
|
|
1. Setting the DataSet to the DataContext and binding the ItemsSource using binding Path.
e.g.,
In code setting the DataContext,
yourListBox.DataContext= yourDataSet;
in XAML setting ItemsSource binding,
<listbox name="yourListBox" itemssource="{Binding Path=YourTableName}">2. Setting the DataTable directly to the ListBox's ItemsSource,
yourListBox.ItemsSource = yourDataSet.Tables["YourTableName"];
|
|
|
|
|
You bind the DataContext of the ListBox to the DataSet and set the ItemsSouce binding with Path as the tablename
OR you directly bind the table to the ItemsSource property.
dharmesh
|
|
|
|
|
Databinding - if you read 100 examples you will find 100 ways to do that databinding - pick one at random and give it a try - repeat until something works.
That's what I do then I scrap the app anyway because WPF is always too slow and I am not a designer so everything looks rubbish.
|
|
|
|
|
I am new in WPF application, now i am studying WPF binding
Concept, i want to full detail of DataContext. and How can handle this
Please Give Any article path or explain yourself
Donot mistake me for this silly question
Thankyou
|
|
|
|
|
|
anishkannan wrote: I am new in WPF application
Seems like you're new to newsgroup posting as well.
You'll probably get much better results using a more specific
subject line than "Any body helpme".
We could all use that as the subject line for our posted questions
but it makes it hard for the people who want to help to pick out the topics
that match their expertise.
Just a suggestion...
Cheers,
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I'm very new to WPF so please forgive me if I've missed something obvious.
I've built a "lookless" control that inherits ComboBox. It has three dependancy properties (CountryCode, Label, and ListByName), and a ReadOnly property of DistrictList.
Whenever CountryCode changes, the Label is changed, and the DistrictList is rebuilt. (eg. Country changes from CAN to USA, Label will change from Province to State, and the list contents will change from provinces to states). When the ListByName property changes, the items in the list will flip from names, to two character codes, or back again (eg. Ontario to ON, or ON to Ontario).
In my Generic.xaml file, the ControlTemplate uses a dockpanel that contains a label and a combobox. I've bound the label Content property to the control Label property, and I've bound the combobox ItemSource to the control DistrictList property.
So far so good... I can flip between CAN and USA, and the control flips between provinces and states.
However, I also want to support a country of "Other", and when that country is chosen, the DistrictList that gets built is empty. So after building the list, I check its Count property. If it is 0, I set IsEditable to True, else I set it to False. That way, when there are no items in the list, the user can type something in, but when there are items in the list, the user can't type something in and must select something.
Changing the ComboBox's editable state is the part I can't seem to get working.
I have subs that fire when the CountryCode and ListByName depedancy properties change. Inside those subs they call a private method called LoadDistrictList. That is the method that fills the private member variable for the DistrictList property, and that sets IsEditable to true or false.
I've obviously missed something, but I'm at a loss as to what it is I've done wrong.
|
|
|
|