Page preferences dialog in WPF - wpf

I'm fiddling with adding the ability to output from a program I'm working on to both PDF and XPS. Initially both were just done via printers (pdf printer/xps writer) but I'd like to do it a little more directly.
The issue I've run into is that there doesn't seem to be a page preferences dialog for WPF. Is there one and I just can't find it, or does something like this have to be custom built in WPF?
I can display the print dialog and then just not actually call PrintDialog.Print, but that's not really any better than just having the user print using a PDF printer. I can retrieve all the page settings from the print dialog, but the user would actually be setting those settings for whichever printer was currently selected.
I just need a dialog with all the standard printer preference options, like page size, margins, copies, etc. Not difficult to create, but I'm surprised I can't find one...

My answer to this question should help you. What are the chances... I just answered it, and I stumble across your question :)
Hope this helps you!!

Related

wpf app: help files with search and index

We are adding help files to our WPF application in Visual Studio 2010. We have not been able to find so far a method that we have been able to use.
We have some HTML help files, currently they are just in a directory, not added to the WPF project.
We don't have index or search.
I have seen that maybe we can do something with cmh, but this seems quite old and outdated now.
Ideally we would like all this in WPF, but if its not possible we need another solution.
We would like to be able to hit F1, have our main help page displayed (we have this now, it opens in our browser) and additionally add Index and Search to our main help page.
Can anyone point us in the right direction please?
Maybe you should take a look at the Process.Start Method page on MSDN. In particular, the Process.Start Method (String) page has a code example showing how to open web pages from a WPF application.
To do this inside a WPF application, look at the WebBrowser Class page at MSDN. This also provides a code example of loading a web page into your application.
EDIT >>> After re-reading your post, I realise that I missed the bit about searching and indexing. Surely, you can just search through the web pages yourself? Just open each page and use something like
if (webPageContent.Contains(searchTerm)) return webPageContent;

Windows 8 like modal dialog using WPF

I am working on a WPF-MVVM (.Net 4.0) application that has a Metro look (it just has a look, it is not a metro application.)
I need to show a windows 8 like message box that blocks the operations for the user before he rids that message box by clicking yes/no/cancel (or any button.).
I came across this otherwise great article and momentarily thought that I have found the solution. But this has its own drawback.It just stops the user from interacting with the controls behind by mouse clicks. The user can however use the tab key to get back to the buttons behind and click them (pressing enter).
A number of things are coming to my mind:
should I go for custom adorners and play with hitTestable property?
Or should I place a control and play with its visible property.
Before going for any approach I thought of putting forward my question to the wonderful community here if someone has done a similar thing in past and provide me some pointer/reference/approach.
Can someone suggest what is the way to achieve this? Please note I will be happy to use prism or any other open source if that solves the purpose but the window will have to be custom made.
Please excuse me if you find this too stupid a question. Please pardon my ignorance. Thanks for reading this.
I recently came across a similar problem, I resolved it using a DialogPresenter as explained there:
http://www.codeproject.com/Articles/36516/WPF-Modal-Dialog
I had to do a few tweaks there and there but overall it's working fine and I now have a nice way to display dialog boxes!
There is a better way of doing it
var dialog = new MessageDialog("Select Social network is already authorised!");
dialog.ShowAsync();

Is there any way of getting a XAML Editor, either build or download?

In my current project (presentation, slide software) I need to be able to make some simple XAML, text images, movies and stuff like that.
If it were HTML I would go with fckeditor or another free editor, but what to do in XAML?
Anyone know if its possible to make one yourself (like executecommand to a IE)? or download one from anywhre on the net?
Cheers
Take a look at this question: Designing WPF Windows for Free?
The leading answer recommends Kaxaml, XAMLpad and several more options.

How can I make a Windows Explorer file preview screen in WPF?

I'm working on an application that will have attachments, and I would like to create a type of display like in windows Explorer, where you choose a "Details" view, and also show the preview pane.
I would like to be able to show a thumbnail view of the attached file currently selected, based on the file extension.
Does anyone know where I can start to look for examples on how to pull this off?
I know Outlook 2007 can also do something similar using preview handlers. I think that’s going to be the direction I want to go in, but I'm not sure where to start.
Many thanks.
All Hail the Glory of the Hypnotoad!
While you could do it in WPF, you should not do it.
Seriously: don't do it! - you would break many apps (including one of mine).
To do this without .NET, see here for a nice guide.
I think you can start here
http://blogs.microsoft.co.il/blogs/eyal/archive/2007/07/29/Hosting-vista_2F00_office-2007-previewers-in-winform-application.aspx
(the code is partially black on black, at least for me, but you can disable the styles or just copy it)

Is a drag-over checkbox list useful?

A while ago I created a drag-over check box list which allows you to check many check boxes in a single gesture. Do you think it is viable and usable on the web where people might not know how to use it. The default behaviour still works for the individual check boxes.
1 - The idea
The idea is nice and can probably be used in professional applications where you have direct contact with users and can explain them how things work, but not necessarily on public websites where users don't want to RTFM and are just looking for familiar behaviours. Unless it was just a sample exercise or a control meant to be included it in a control pack, it violates the YAGNI principle ;)
2 - The implementation
You certainly noticed that the implementation is buggy (at least on IE7 and FF3.1B2). Sometimes, a gesture above all checkboxes will select all of them but one or two. Moving the mouse over the div's above or below the list will stop the drag (I know it's a "feature", but it's not very user friendly). I Checked the source code and to be honnest, while it looks pretty neat, I just didn't want to deal with it because it is plain javascript. Don't you know that...
3 - Possible improvements
...you can write less and do more with a javascript library, typically jQuery. I would completely rewrite this control as a jQuery plugin. It will provide you with a lot of tools to make your code much easier to write, maintain and extend. Just try it, you'll love it. This is from a technical point of view. From a user point of view, try to make you control as familiar as possible, like what Angela suggested, windows explorer : a nice selection rectangle, the ability to use shit + click, or something like that. Finally, remember that for many windows checklistbox users, "selected" and "checked" are two different things.
The demo definitely needs a few enhancements to make it even a little bit useful (although I am not sure if it would be enough):
Allow the dragging to start somewhere that is not a check box.
Allow selection by dragging over the labels as well.
This problem seems similar to the action of selecting multiple files in a file explorer like Windows Explorer. Maybe it can work like the action of selecting multiple files by dragging a rectangle shape around the items to be selected (select one corner, drag to the other corner)? This has the advantage of being similar to an interface element that people may already be familiar with.
For some reason I can't open your link (it says my ip address was blocked). But I think what you're looking for is what I already did in jquery, I uploaded a plugin which I basically ported from crossbrowser.com's dragcheck functionality, it was to be found at http://plugins.jquery.com/project/dragCheck but currently the jquery plugin site is being revamped and my plugin has disappeared. I'm trying to see if they're going to put it back up or if I have to create a new project again...
Anyways until we get that worked out you can see a demo here: http://jsbin.com/ibihi

Resources