Currently I have used Process.Start(documentUrl) in the WPF application
to open document.It opens document in a new window.I have one user
control.That User Control is displayed in one of the Dockpanel of the
main window.So when I select some document I want to open that
document in that User control.Is it possible?
I have also used WebBrowser inside the User Control but since it is
not a WPF control.It is displayed in the top layer.Due to which all
the PopUp are displayed behind that User control.So WebBrowser is of
no use to me.
Kindly suggest any alternative.
Hi you should have googled your issue first before asking here.
However here are few links for you. It seems you are looking for Flow Document control.
http://msdn.microsoft.com/en-us/library/ms748388%28v=vs.110%29.aspx
http://www.codeproject.com/Articles/37368/WPF-Flow-Document-For-Beginners
Related
I have a listview which displays a list of Users (binds to UserListViewModel) - the user can add/edit/delete entries. What I would like to do is have the add button open a new window where the user can enter the new details and save. When the save is successful, I want the window to close and the listview to be refreshed to show the new addition.
What is the best approach for doing this using the MVVM pattern? I've read about using events, modal dialogs, etc, and the accepted answer to this question had a description of what i'm aiming for, but I can't seem to find an example of how this is implemented.
Can someone provide an example?
Update: I ended up finding (read: stumbling across) this article which suits my purposes.
I would go with interactions. This way you will be able to start interaction, pass data to it and then after it's done/closed - get some data back to update your VM.
Download MVVM in a box and they have example of testable MVVM-ish interactions:
http://karlshifflett.wordpress.com/2010/11/07/in-the-box-ndash-mvvm-training/
I am trying to create two user controls in Silverlight using the Windows Phone SDK 7.1. I would like to be able to drag from one control and drop into the other control (or at least receive the event that the drop has occurred).
I am able to give the appearance that the drag is moving the item by using a TranslateTransform. However, I would be interested in knowing whether this can be done by actually moving the element instead of transforming it. Can this be done?
Second, and probably more importantly, how do I get the second control to see the drop event? I've done lots of reading, and no luck with this so far.
FWIW, I am currently using a Grid in each control, but I would be open to changing to a Canvas or other control type.
I am not much aware of windows phone, but we can drag an object from one controller to another controller.(What i did in iOS)
Steps to be followed:
Both controllers should be in same window.
On ManipulationStarted(touches begin) drag the object or item from one controller, Move on another controller
On ManipulationEnded(touches ended) check the dragged object is within the second controller. if Yes, add the object to second controller.
I hope my answer helped you. If it's not useful sorry for that.
I have a Scroll Viewer and inside that a text block with multiple pages contents.
How can I print everything within the Scroll Viewer.I'm Using WPF MVVM pattern.
Is text block is the right control for this?Or shall I go for any other WPF controls.?
Thanks in advance..
DocumentViewer ir a better control for paginated printing
I don't know what is exactly the problem,But something related to Printer.
From Control Panel->Printers & Fax
1.Right Click the Printer and take Printer preferences
2.Change the Source property to 'Manual Feed'& Apply.(Initially it was'AutoSelect')
3.Still got some error.
4.Again me changed the Source property back to 'Auto Select'& Apply.
5.Changed the Quick set Property to 'Defaults'& Apply
5.Now its Working Fine
I have idea to implement my wpf windows like TabPages in tab control. It is possible to do that dynamically in c# code.
In Example i have Menu in main window. Some Menu items calls search type windows. Is it possible to do such a thing in C# code (SomeMenuItem_Click): this code adds new tab in tabControl of main window.
If there are no search windows called -there is no tab's shown, if there are many search windows called - there are many tab's.
So how do I code this?
And whats the technique with the windows? I suppose that my search type windows must be implemented like some UserControls. I think its no a good idea to implement that like simple wpf windows. I have tried to do that by using Marlon grech "Blend like UIs using DOCKY", find at:
http://marlongrech.wordpress.com/2008/01/29/create-blend-like-uis-using-docky/
But I failed, dont find the way how to add controlls in code dynamically, not in xaml.
I would appreciate code examples to illustrate how to achieve this.
Is it possible to do such a thing in C# code (SomeMenuItem_Click): this code adds new tab in tabControl of main window.
Yes. The basic pattern is:
TabItem newItem = new TabItem();
tabControl.Items.Add(newItem);
You'll obviously need to set the relevant properties of your tab item (such as the Header and Style) but that should get you started.
You'll then need to create any controls you want to show and add them to the tab item itself (or more correctly - a container within the tab item).
I want to create a parent window and host a couple of childWindows inside it, and show them according to user events:
in other words:
on parentWindow.load() event, i load the main Childwindow.. and according to the user's choices i unload/close , and then load a different childwindow.
-all of that happening "inside" the parent window" -
giving the user the feeling of a paging application instead of a "forms/window" application.
is that doable ? and r there any better practices to have create a similar effect ?
I am not sure what you are going for exactly, but it seems like one of two options will help you:
TabControl/HeaderedContentControl: your main window could contain a large HeaderedContentControl (such as TabControl) and each of your "child windows" can be individual tabs. With a little coding, the user will be able to close certain tabs, make new tabs, etc. Josh Smith's MVVM demo application is an excellent example of the right way to do this.
Page-based navigation: using NavigationWindow and and Pages you can create a browser-style application that could have various child windows, each displayed one at a time, and with support for navigation history, hyperlinking, etc.