|
So what ideas have you got, what have you tried and what didn't work?
Do you want the control in xaml?
Are you using a viewmodel?
I can think of a number of ways to do it via a viewmodel.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
ya. i want the control in xaml.
i am not using any viewmodel.
|
|
|
|
|
Try DataGrid.ScrollIntoView(item, column);
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.
My latest tip/trick
Visit the Hindi forum here.
|
|
|
|
|
It is for up to particular column or row. i don't want to particular column or row. i want to continuously move whole data in data grid from bottom to top like marquee in html. i.e if data is coming to end then it again move from beginning.
|
|
|
|
|
Hi,
I know it's not completely related to this section, but I'm developing a silverlight application that is going to get user advertises in image and video format.
I'm ambigious about saving the content in db as binary or saving the files and in server hard and just putting the pathes in DB.
It shoud has a lot of advertises.
Which approach I shoud select?
Best wishes
|
|
|
|
|
I'm just finalising my application, lots of photos and forms to be up/down loaded and I'm still ambiguous. I opted for the file path but just ran across an issues where they may want files with the same name, debated moving to the database but decided to prefix the file with the ID from the database instead.
I struggled getting the DB operations to be consistently reliable.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Mycroft Holmes wrote: I'm just finalising my application, lots of photos and forms to be up/down loaded and I'm still ambiguous. I opted for the file path but just ran across an issues where they may want files with the same name, debated moving to the database but decided to prefix the file with the ID from the database instead.
The normal method for doing this is to give each file a unique name (say generated as a GUID), and store the unique name against the original name in the database.
|
|
|
|
|
I hadn't thought of the guid, I hadn't thought much about it at all which is not good. Prefixing with the record id will at least leave me with a readable file name.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Don't worry about it - you've created a perfectly valid way of making the file name unique. The Guid approach is just one such approach.
|
|
|
|
|
Using a GUID for a filename also makes it impossible to identify a file if yuo have to manually wade throuh a directory to find something.
5CAABC01-8A13-4708-AB1F-35A5349C99EC.jpg
05062E0E-9DAD-4aa0-832B-40DB1B8F0F73.jpg
Of those two file names, which one is picture of your dog, and which is the picture of some sweet young thing at the beach that your wife doesn't know you snapped a picture of?
.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
|
|
|
|
|
That's what the database is for.
|
|
|
|
|
Pete O'Hanlon wrote: That's what the database is for.
You are starting to sound like SAP/SAS
Thats what the data dictionary is for.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Pete may have a point here, my wife has absolutely no idea how a database works.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I was talking about the files being on disk. If they're actually in the database, you should be safe.
.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
|
|
|
|
|
Never mind. Got it
Everything makes sense in someone's mind
|
|
|
|
|
Thats got to be the fastest response I have ever seen. Normally there is a few minutes delay while you think about it.
OR did you edit the original question!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Kevin Marois wrote: Never mind. Got it
Ok.
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.
My latest tip/trick
Visit the Hindi forum here.
|
|
|
|
|
Hi!
I have added a hyperlink in silverlight.
But when i click on the link it displays a blue rectangular border for the size of the hyperlink control.
The link opens a popup window, so this doesn't look so good on the webpage.
<HyperlinkButton x:Name="History"
Content="History"
Margin="0"
FontFamily="Arial"
FontSize="10.667"
Click="HistoryHyperlinkButton_Click"
Foreground="Black"
FontWeight="Bold" Background="{x:Null}" Cursor="Hand"
BorderThickness="0"
/>
Is there a way to disable this or have i missed somethink?
|
|
|
|
|
One way is to set the IsTabStop="False" on the button.
The other way, more correct but tedious, is to style the hyperlink button to modify the focussed state of the state manager.
For this you will need to either use Expression Blend or pick up the style from msdn and then modify and use it.
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.
My latest tip/trick
Visit the Hindi forum here.
|
|
|
|
|
Thank you!
IsTabStop got the result i wanted
|
|
|
|
|
I see a large body of work on handling dialogs amidst the MVVM WPF application, but I am having a tough time finding a good example of a standard Folder browser dialog. I want to browse for a folder and then get a list of files from the selected directory.
Can someone point me in the right direction?
Cheers, --EA
|
|
|
|
|
I would use an IOC container like a simple ServiceLocator and implement a simple dialog service. Some of the MVVM frameworks already have this. Both a ServiceLocator and a DialogService are pretty trivial to implement.
|
|
|
|
|
Seems like a lot of pomp and circumstance to me to get a string value from the client. I have looked at the MVVM Light Toolkit and a couple of the other examples out there and just thought it seemed like an awful lot of code for a simple request. I guess that is why they pay us the "big bucks" though.
Thank you for your insight,
Cheers, --EA
|
|
|
|
|
MVVM *IS* pomp & circumstance. Most things you can do "the old way" in 1/10th the code and 1/10th the time that it'll take you in MVVM. You don't need to use it. You can write a WPF app just fine "the old way".
Since you mentioned a FolderBrowserDialog, I'll use that as an example of why MVVM is "teh awes0me!" .
The Old Way: Lets say you have a dialog with a button on it. The button launches the FolderBrowserDialog. You've just rendered the entire window and all the code involved "untestable". If you try to run a unit test and happen to run down the path that pops up the FolderBrowserDialog, no one will be there to select a file and thus your unit tests will fail.
Normally, your "infrastructure" code will be unit testable and your GUI code will not be.
MVVM splits that up. So now your infrastructure code is unit testable AND about "most" of your GUI code is as well.
The ServiceLocator helps solve part of that problem.
Lets say your code is littered with:
FileDialog fd = new FileDialog();
fd.Browse();
... fd.SelectedFile;
you can't unit test that... but with a service locator, you can... now instead of having that code everywhere, you'd do:
IDialogService svc = ViewModelBase.ServiceLocator.GetService<IDialogService>();
svc.ShowFileDialog();
How will that help?
Well, under normal circumstances, you would have a REAL IDialogService and ShowFileDialog() would call FileDialog fd = new FileDialog();, etc...
but when you are doing unit tests, you would register a dummy IDialogService, in this version, ShowFileDialog() would simply be hardcoded to return "c:\\dummy.txt".
You haven't changed any application code at all and now you can unit test.
Makes sense?
Thats just a basic example, but thats the general concept behind the service locator pattern.
If you don't care about unit testing and you are working on the code by yourself, I'd skip MVVM. If you are required to do unit tests, MVVM and ServiceLocator will work well.
In general, MVVM will produce cleaner WPF code (once you get your pomp & circumstance code in place ).
|
|
|
|
|
I don't particularly care about unit testing and I am working on this project by myself, but not being a formally trained programmer and picking up everything from the internet, I am hesitant to take the easy way and end up in a bad habit situation. Some day there could be a second gunman on the grassy knoll, so to speak, and I don't want to be the one left holding the smoking gun.
With that said, this answer definitely provided me with the greatest insight and I appreciate the candor. Prior to working with this WPF MVVM project I have worked only on C# Windows Forms Apps, so I don't understand the concept of a service locator or how to implement the service model. I have been googling it for the past two days and there is hardly a large body of work on this subject. It seems to me that WPF and MVVM are an underdeveloped concept still, which is good. Always nice to be on the "cutting" edge.
Could you give me a couple google buzz words that might point me in the right direction?
Cheers, --EA
|
|
|
|