|
Thanks for your input Pete,
Pete O'Hanlon wrote: horizontalalignment="Stretch">;Style="{StaticResource CustomBorderStyle}"
I'm a terrible typer...I was going back and adding the < and > 's and produced the typo.
I get these error periodically when working with UserControls, which is where the style is used and I get 3 errors.
Could not create instance of ProjectView (my user control)
Value TaskMgrResourceDictionary.xaml cannot be assigned to property 'Source'. The resource dictionary XAML file has errors and cannot be loaded.
The application XAML file failed to load. Fix errors in the application XAML before opening the XAML files.
Like you if I strip this code out and and use it in line it works great. Its in several locations also, and all are user controls? Except for the MainWindow not showing because of the errors in the user controls.
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: 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++
|
|
|
|