|
|
Is replying to this post with a link advertising?
What do you mean by 'multiple series on the Z axis'? Is that stacked bars?
|
|
|
|
|
Not sure...Im asking for it specificlly...So its not like your spamming..
|
|
|
|
|
The site which I am trying to direct you do is currently down ... I'll check in on it tomorrow.
|
|
|
|
|
Ok, it is back up. Check out http://www.sharpplot.com/[^]. This is a chart library for .Net, which means it should work for Silverlight, and it definitely does the type of chart you linked (it calls it a Tower chart).
It is not free but you said that was ok in the original question.
(Disclaimer: I am somewhat associated with this library, so it is not an unbiased piece of advice.)
|
|
|
|
|
I have a model in the WCF with properties, this is based on a view of PersonDB. This is then generated into the reference of the SL client and all works well.
I have implemented an EditablePerson in the VM that is a copy of the PersonDB and is created in the SelectedPerson change event. This works perfectly well as the shallow copy and reverse is done in the VMs base class.
I am looking at implementing IEditableObject on the PersonDB class from the WFC. The interface does not cross the reference barrier. I can create a partial class in the client Models.PersonDB with the Interface implemented but how do I convert WCF.PersonDB to Models.PersonDB.
All responses from the WCF return a List, do I need to foreach every List<> and copy it into a List<models.???db> or is there a better way. Refactoring will be a PITA
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
If you have a look at this article, you'll find a handy Memento[^] implementation that helps to encapsulate IEditableObject behaviour so that a lot of the hard work is removed.
|
|
|
|
|
I had actually seen and browsed that article and decided my own implementation had merit for it's simplicity. Mind you I don't handle dialogs just the editable functionality.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi all,
I started to work on with WPF few days back, and at the beginning I choose SAMS 24 hours book. It is almost finish now I'm looking to start another which is discussing about more advance stuff. So what you all recommended?
Thanks
I appreciate your help all the time...
CodingLover
|
|
|
|
|
While some like wordy books (I've got tons of old ones), these days I prefer the nitty-gritty...
So when I started WPF I read (and studied the sample code in) the entire WPF SDK Documentation[^].
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
You do realise you just admitted, in public, that you read a manual?
-ve man-points!
|
|
|
|
|
|
Nobody will read this reply now it's an old thread, so I think I am safe in admitting that I followed the link in your original message, and am now ploughing through the documentation
In my youth I was usually the only oine whe ever read the documentation, and it was amazing all the tricks and tips I knew that astounded others - and back in those days we never said RTFM
|
|
|
|
|
I like to move with ebooks. So I can keep open the page on one screen and the IDE is on another. So I can tryout the samples and some R&D I want to do. I hate printed materials.
I'm referring the documentation in case of any, but wonder how could read and workout the complete. Its a loon journey I guess.
Anyway, thanks for the reply.
I appreciate your help all the time...
CodingLover
|
|
|
|
|
It might be worthwhile to start building a sample application or two.
You can check out videos and tutorials on mdsn as well.
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
|
|
|
|
|
Yeah, with the SAMS book I'm doing that. Only the samples discussing on the book. So I thought to finish it off first of all.
I appreciate your help all the time...
CodingLover
|
|
|
|
|
That is a good approach.
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
|
|
|
|
|
By the way, I found Wrox Professional 2007 edition (ebook). It's related with VS 2005. So I wonder it's worth to work out.
What you think?
I appreciate your help all the time...
CodingLover
|
|
|
|
|
Newbie to WPF/C# here (my last windows programming experience is ages ago - think VB 2.0-6.0). Been out of the programming business for most of a decade, but decided to throw together an app for my current line of work (a practice management tool for my accounting office). Been reading all I can about WPF, C#, etc. The MVVM model seems applicable, but I'm having a hard time applying it.
So here's a simplified version of my question: I have two sets of items to keep track of (more in reality, but I'm trying to keep this general) - Users (for access level management and auditing) and Clients (the clients of the accounting firm, for whom I want to store a bunch of data).
All of the data is going to be stored in a SQL Server database, and accessed through the ADO.Net Entity Data Model. After working with the Entity designer, I get two classes: User and Client. These two classes are, presumably, the "Model" in the MVVM framework.
For both of these, I need to have very similar screens: For users, I need an "All Users" screen - probably a datagrid - which shows a summary list of all current Users, and a "Selected User" screen which shows a full detail view of one User, allowing it to be edited, or allowing a new User to be created.
Similarly, for Clients, I need a "All Clients" and a "Selected Client" screen.
My initial thought is that I need 4 views (All Clients, All Users, Selected Client, Selected User), and 2 view models (UserVM and ClientVM). So my first question is: Am I setting this up right? Or should there be 2 more VMs (UserListVM and ClientListVM)? Or vice-versa, 2 views (list and detail) and 4 VMs?
Following this tutorial: WPF: MVVM (Model View View-Model) Simplified I have attempted to do so, but run into a problem right away - that tutorial (and several others) expect the model class to implement the INotifyPropertyChanged interface. However, since my model class is created by the Entity Designer, it doesn't (as far as I can tell) implement it. How do I deal with this? I suppose I can just use a timed "refresh" event that manually re-reads from the DB, but that seems inelegant.
Next, using the setup from that tutorial, how do I initialize the view? I've built a UserView control (and placed it into my main window) and a UserVM class, all of which bind together with XAML, but when I run it, the control is (understandably) blank. At what point should a User be provided? I'm thinking an overloaded constructor of the UserVM class (using no parameters for a "add user" action, and a single "User" type parameter for an "edit user" function), is there a better way?
Finally, how do I trigger a write back into the DB once a change has been made (when the user clicks the save button)?
I know these are kind of basic, but I'm having a lot of trouble finding just the right level of answers to these questions (most articles/books seem to be either too abstract/high-level or too low-level/"here's how you set a textbox.text property"...)
Thanks,
Juliean.
|
|
|
|
|
jgalak wrote: The MVVM model seems applicable, but I'm having a hard time applying it.
Yes, WPF and MVVM go hand and glove.
jgalak wrote: My initial thought is that I need 4 views (All Clients, All Users, Selected
Client, Selected User), and 2 view models (UserVM and ClientVM). So my first question is: Am I setting this up right? Or should there be 2 more VMs (UserListVM and ClientListVM)? Or vice-versa, 2 views (list and detail) and 4 VMs?
Depends really. My first thought is that you'd need 4 ViewModels and 4 Views, use a "suck it and see" approach.
jgalak wrote: Following this tutorial: WPF:
MVVM (Model View View-Model) Simplified I have attempted to do so, but run into a problem right away - that tutorial (and several others) expect the model
class to implement the INotifyPropertyChanged interface. However, since my model class is created by the Entity Designer, it doesn't (as far as I can tell)
implement it.
The article seems closer to Datamodel View ViewModel, which is a good alternative [really as specialised form of] MVVM you can get an idea from Dan Creiver's blog[^]. You can implement the interface on the Enity Data Model: the classes are all partial (Video here[^]) That said there are some objections, some might argue that INotifyPropertyChanged is really a UI construct and is not really "model" stuff. To avoid this you can take a look at a pure MVVM (see Josh Smith's Articl[^]). Note that the disadvantage of this is that changes to the model must come through the viewmodel to be updated on the view, but this is not a problem for you anyway. In either case, the INotitfyPropertyChanged , if implemented correctly in either the model or view model does away with the timer you mentioned.
jgalak wrote: Next, using the setup from that tutorial, how do I initialize the view? I've built a UserView control (and placed it into my main window) and a UserVM class, all of which bind together with XAML, but when I run it, the control is (understandably) blank. At what point should a User be provided? I'm thinking an overloaded constructor of the UserVM class (using no parameters for a "add user" action, and a single "User" type parameter for an "edit user" function), is there a better way?
Yes: Make the user controls strongly typed data templates and type them to the ViewModel s. In the Main window set the DataContext to a new instance of the viewmodel you want to show. The viewmodel should handle the instantiation of the model, you can put the database stuff in the viewmodel, or you could consider a repository pattern (easily googled).
jgalak wrote: Finally, how do I trigger a write back into the DB once a change has been made
(when the user clicks the save button)?
You raise a command and the ViewModel handles it, again either it commits the changes, or you do it via the repository pattern I mentioned earlier.
jgalak wrote: I know these are kind of basic
Actually, these are all good questions! Given that you've been out of the loop so long, you've picked up the key techs and points impressively well!
|
|
|
|
|
jgalak wrote: My initial thought is that I need 4 views (All Clients, All Users, Selected Client, Selected User), and 2 view models (UserVM and ClientVM). So my first question is: Am I setting this up right? Or should there be 2 more VMs (UserListVM and ClientListVM)? Or vice-versa, 2 views (list and detail) and 4 VMs?
A ViewModel is the model of a View - so you need 4 ViewModels - you CAN have more than one View for a ViewModel if each View is a diffrent visual interpretation of the logic in the ViewModel - but generally I like to think of the viewModel as being the specification of the View's functionality - so, yes, 4 VMs
jgalak wrote: However, since my model class is created by the Entity Designer, it doesn't (as far as I can tell) implement it. How do I deal with this? I suppose I can just use a timed "refresh" event that manually re-reads from the DB, but that seems inelegant.
properties within the ViewModel should implement INotifyPropertyChanged. some simplified tutorials implement it in the Model but (IMHO) this is entirely the wrong place as far as MVVM goes.
So your Model has a CustomerName property (a plain, old fashioned property). Your ViewModel may also have a CustomerName property, but this one implements INotifyPropertyChanged. The Getter on this VM property can just grab the string straight from the Model's property. And, indeed, the setter can also set the Model's property directly. so the Vm is just presenting the data in a bindable way to the View
jgalak wrote: Next, using the setup from that tutorial, how do I initialize the view? I've built a UserView control (and placed it into my main window) and a UserVM class, all of which bind together with XAML, but when I run it, the control is (understandably) blank. At what point should a User be provided? I'm thinking an overloaded constructor of the UserVM class (using no parameters for a "add user" action, and a single "User" type parameter for an "edit user" function), is there a better way?
I would think that you would first present a list of Users from which the user can select - or click a button to add a new one. so the userListViewmodel would be the thing to first populate
jgalak wrote: Finally, how do I trigger a write back into the DB once a change has been made (when the user clicks the save button)?
usually your Vm would implement a command, bound tot he button, and would take the data in itself (or in the Model, if you've been updating as the properties in the Vm change) and so your Vm handles the save
If you look at my article (link in the sig) I take you through a WPF MVVM application to maintain customers. It may not be the answer to everything, but it should show you at least one way of looking at it - and a working example is there for D/L to be played with
|
|
|
|
|
I have a misunderstanding about RepeatBehaviour. I'm experimenting and I have this XAML embedded in a Canvas inside a System.Windows.Window. I expected the colors to transition from Blue to Orange and back again, followed by Green to Purple and back again, and then for the process to repeat until the Storyboard duration ran out. However, it only performs one cycle and then stops - on green.
What am I doing wrong...
<Button Name="butPlay"
Click="butPlay_Click"
Width="96" Canvas.Left="136" Canvas.Top="191" Content="Play" Height="40" >
<Button.Triggers>
<EventTrigger RoutedEvent="Button.Click">
<BeginStoryboard >
<Storyboard Duration="1: 0: 0"
RepeatBehavior="5">
<ColorAnimation Storyboard.TargetProperty="Color"
Storyboard.TargetName="rctPlayBrush"
From="Blue" To="Orange"
Duration="0: 0: 1"
AutoReverse="True" />
<ColorAnimation Storyboard.TargetProperty="Color"
Storyboard.TargetName="rctPlayBrush"
From="Green" To="Purple"
Duration="0: 0: 1"
AutoReverse="True"
BeginTime="0: 0: 2"/>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Button.Triggers>
</Button>
Whilst I realise the colour scheme leaves a little to be desired, can you help me the technical rather than esthetic aspect?
ps. How does one stop colon-zero ( )being displayed as a smiley? (hence the spaces after the colons in the code)
Paulustrious
Email: codeproject who-is-at paulcotter.com
modified on Saturday, May 28, 2011 5:49 PM
|
|
|
|
|
What did you mean by the "RepeatBehavior="5""? Repeat 5 times? If so it should be RepeatBehavior="5x". Or did you mean 5 hours?
Anyway, the Storyboard timeline is 5 hours, but the total animation time for the storyboard is only 4 seconds, so it appears to stop after one storyboard iteration because it's spreading 4 second long animations over the a 5 hour timeline. Make sense?
So my suggestion is get rid of the "Duration" on the storyboard (the default value of "Automatic" for Duration should be what you want here) and adjust RepeatBehavior the way you want it - either an iteration count, a timespan, or "Forever".
Paul R Cotter wrote: ps. How does one stop colon-zero ( )being displayed as a smiley? (hence the spaces after the colons in the code)
Evil smilies...they cannot be stopped...
Mark Salsbery
Microsoft MVP - Visual C++
modified on Saturday, May 28, 2011 6:50 PM
|
|
|
|
|
I want to create a silverlight application with the ability to radically change the look and feel with themes. So could I just place contents controls on every single page and then just load the actually page from resource files at runtime. Is there anything wrong in doing this?
|
|
|
|
|
|