|
Thanks for the reply. I am new to this MVVM design pattern so i am not getting exactly where to put what. and how to call the commands and all. Also where to set datacontext of what window. Kindly suggest? Thanks
|
|
|
|
|
You would call this method immediately after the call to InitializeComponent(); in the code behind. In order to bind to a command, you simply need to use Binding as in Command="{Binding MyCommand}" where MyCommand is the name of a command that implements ICommand in the VM (note that RelayCommand implements ICommand).
"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 | Onyx
|
|
|
|
|
I'm writing a SL3 app that uses the Silverlight Data Visualization Toolkit. A new version of the toolkit was released in April that added stacked series, but only added it for the SL4 version of the toolkit. I've tried a couple of different ways to reengineer the stacked series to workmin SL3:
0) Copy the entire set of Data Visualization folders from the SL4 version to the SL3 version. This resulted in a compiler error involving SL4 (the Fallback property in a class I don't remember - maybe IEnumerable, but I'm not sure). I abandoned this one when I started getting SL4-specific errors
1) Copy JUST the files I need from the SL4 version to the SL3 version. This actually compiled clean, but it throws a null reference exception that I'm finding it difficult to track down. I think I want to try to stick with this approach, because it looks like I'm closer to success with it.
I can transfer all of the files to whoever would like to look at it if we can figure out a transfer mechanism (maybe creating an unfinished article and provided the code as the article download.)
EDIT ======================
Here's a more complete descrioption of the problem:
http://forums.silverlight.net/forums/p/187997/431306.aspx#431306[^]
I've got to have this fingered out by noon today (3.5 hours from now), or work on it after hours and on weekends.
.45 ACP - because shooting twice is just silly----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
modified on Tuesday, June 22, 2010 9:29 AM
|
|
|
|
|
I had tried fixing a bug in the Accordion control sometime ago and was absolutely unable to do so.
I finally gave up and posted it on the toolkit website. It was fixed by them in the next release.
double value = IsStacked100 ? (ValueHelper.ToDouble(dataPoint.ActualDependentValue) * (100 / sum)) : ValueHelper.ToDouble(dataPoint.ActualDependentValue);
What is the exact error in the line posted on the SL forum as above?
|
|
|
|
|
It's a null reference exception. The DataPoint is null. I don't know why.
I have to admit that I've kind of given up on that particular approach (I feel so.... French), and am about to embark on an alternative, but I still have questions about why stuff that I think *should* work but doesn't appear to.
I wanted to create a new type of line series that
a) Accepts just one data value for the Y axis
b) Extends the line from the left axis line all the way to the opposite edge of the chart
In the Toolkit solution, I started out by copying the LineSeries.CS and LineSeries.XAML files to LineTrendSeries.CS and LineTrendSeries.XAML respectively, and renamed all of the internal LineSeries references to LineTrendSeries . With these minor changes, you would think that instantiating the series on a chart would result in a standard LineSeries appearance (because I haven't actually changed anything in the class with respect to what it displays), but nothing except the associated legend item shows up on the chart area. I have no idea why, and requests for help in the "official Silverlight forum" go unanswered for days at a time.
EDIT ========================
The LineTrendSeries object has a Points collection in it that is null. For some reason, the UpdateShapeFromPoints method isn't being called. By all rights, it SHOULD be called because at this point, the object is IDENTICAL to a LineSeries object in terms of content. It's almost like the chart doesn't recognize that the series exists in its series collection.
EDIT ========================
I found that if I put a regular LineSeries object on the same chart AFTER the LineTrendSeries object, the LineSeries.UpdateShapeFromPoints method is called *twice*.
EDIT ========================
On the off chance it had something to do with the LineDataPoint object, I created a version of that class for my trend line series, and it didn't change anything.
.45 ACP - because shooting twice is just silly----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
modified on Wednesday, June 23, 2010 10:50 AM
|
|
|
|
|
John Simmons / outlaw programmer wrote: I have to admit that I've kind of given up on that particular approach (I feel so.... French), and am about to embark on an alternative, but I still have questions about why stuff that I think *should* work but doesn't appear to.
Looks hard to track down!
In case you require a stacked bar chart there are a few others available on the internet (these were coded prior to SL4).
Would they fit into your requirements?
|
|
|
|
|
Yeah, this whole thing has been a pain the ass.
I posted the code (SL4Test.zip) in my Uploads section.
The zip file includes the test project I'm playing with, as well as the files I changed in the (November 2009 version of the) Silverlight toolkit code. I didn't include binaries because were just flat out too many and mad the zip too big to upload here.
If you want to look at it, you're going to have to download that version (35261)[^] of the toolkit, copy my files to the source folders, and rebuild it. Currently the references to the toolkit DLLs in the SL4Test project are pointing to a folder in the SL4Test folder hierarchy, but that's easy to change to reference the toolkit Binaries folder instead.
From what Chris said, other users can get to my Uploads section, but if you have a problem, let me know.
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
modified on Wednesday, June 23, 2010 5:49 PM
|
|
|
|
|
John Simmons / outlaw programmer wrote: , other users can get to my Uploads section, but if you have a problem, let me know.
Just to let you know, I cannot - I don't think I even have an uploads section of my own - must be a rights / rep issue.
|
|
|
|
|
Okay, I'll have to think of something else...
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
I posted a similar question in the MSDN Silverlight forum, and someone responded that they did "the same thing I did", and it worked fine for them.
I hate it when that happens.
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
John Simmons / outlaw programmer wrote: I hate it when that happens.
I hate when say that but cannot actually share their code.
|
|
|
|
|
He tried to share the code, but I can't download it from work (network restrictions), so I have to wait until I get home to see what he did different from me.
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
I fingered out my problem, and will be posting an article about it this weekend.
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
John Simmons / outlaw programmer wrote: fingered out my problem, and will be posting an article about it this weekend.
That is cool.
|
|
|
|
|
Hi, I'm beeginer in WPF...I have a big problem for me
I don't know how to label be biger when text box get focus?
Want to resolve this problem with trigger...
Anybody?
modified on Tuesday, June 22, 2010 10:44 AM
|
|
|
|
|
Use GotFocus event and change the Font in your event handler.
|
|
|
|
|
Ok, thank you... I want to resolve this with trigger, but can so
|
|
|
|
|
You can solve this using Trigger only if the Label and TextBox are part of a ControlTemplate or DataTemplate.
Try Binding the Element's IsFocused property with Converter. The converter should check for the True/False and return the FontStyle.
|
|
|
|
|
While you can do this with triggers, in this case you will have a lot of effort because you are working against two disconnected elements.
"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 | Onyx
|
|
|
|
|
Hi all,
I'm learning combine wcf and nhibernate in silverlight, i follow instruction of this link http://www.squarewidget.com/post/2010/02/NHibernate-101-Silverlight-4-with-NHibernate-2n.aspx for creating sample
But i have an error about [Instrument is not mapping], i changed the hbm.xml file and run again. The error message is not changed. It seems the Instrument.hbm.xml is not read. Could you please help me to solve this problem? Or if you have any source code relate to silverlight, wcf and nhibernate, please give me.
Any suggestion will be welcomed
Regards,
Tuan Lam
|
|
|
|
|
How can we draw a line/line_segment with animation (kind of sketch). What I need is something like Telerik line type chart. If three points are there - 10,10 20,20 30,10 - drawing a line between them is pretty simple. But, how to show that line is being drawn? And yes, I want a dynamic solution. Because, these point values are generated on run-time. Which approach should I take?
|
|
|
|
|
I have a WPF chart which is in a Visual Studio 2010 project.
I have installed the WPF toolkit and am using the Chart from it.
For my first test I'm displaying 2 LineSeries graphs. Each has the same x and y axis value ranges and such.
I want to have an axis definition that will display the graphs with the 0 axis in the center of the chart.
I tried using Chart.Axis and that just put the axes on the top and right without any affect to the graphs themselves.
I tried using the LineSeries.DependantValueAxis and IndependantValueAxis but with several LineSeries charts i'm not quite sure about that either.
I'd appreciate any input on best practise for defining the axes when using multiple lineseries graphs ina single chart.
Thanks
|
|
|
|
|
Everyone,
I have a simple grid that binds two a table, and that table fk's out to two other tables. The table being user, the foreign keys relating to usertype and store. For some odd reason, the usertype binding won't populate, while the store binding will. I've ensured that the relationships exist in sql, and in my edmx. I've include the [Include] attribute on both properties in the user partial classes to ensure they're loaded. I've tried specifically binding them columns myself, and having it autobind the columns through autogenerate columns with the same result. It's not a case of bad foreign keys, as I can query for any particular record on the edit user dialog and it brings back the usertype perfectly for each record. Any idea's?
Thanks,
Ryan
|
|
|
|
|
In my project i need to create a graph which works same as an oscilloscope .
which will be the best graph control that i can use here ....
thanks in advance
|
|
|
|
|
"best" is always a subjective value.
Get the WPF toolkit for Visual Studio and use the Chart. Change the internal to a LineSeries. You need to keep your x axis values fixed while changing the y value in the array you use to populate the ItemsSource of the LineSeries. So keep deleting item[0] and add the new point to the end of your List.
|
|
|
|