I've been stuck on this for a while now and simply don't know how to proceed. I need to create a slideshow using full screen views (UserControls) as slides. By this I mean that I want to transition between full screen views by means of a sliding animation.
The basic idea is to position one view off screen and to the side of the currently displayed view and then to simply slide them both accross. This works well with small images and objects with a PRESET size.
The problem that I have found is obtaining the actual size of each view at runtime. I need this value to feed to the DoubleAnimation that is responsible for moving the views. How can I find out the 'ActualSize' of each UserControl/view before they are displayed?
If you have any suggestions, I'd be glad to hear them. Many thanks in advance.
UPDATE >>>
While the third party transition code worked well for most situations, it turns out that the main problem that I was having was due to the WPF WebBrowser control.
Apparently, you cannot create a Visual for a VisualBrush from it because it is basically a wrapper for the WinForms control.
Personally, I would go for a project like transitionals to handle the actual transition.
Then you could consider rendering your usercontrol to some Viewboxed Brush and display that full screen. Mark rendle did a project called Code projector which he uses to render Visual Studio's code window to an external screen. That technique could be useful for what you are trying.
Related
I have an app which has navigation bar at the bottom. I'd like to keep that part of the page static - it would be 'base' for all other pages. I could add the exact same part of the code to every xaml page, however, I feel like initializing navigation bar on each page is waste of resources and time.
To make it more clear, below is an image of Facebook app (iPhone), pretty much same UI on Windows 10. Red bordered part of the UI never changes no matter what page you move to. For those using Facebook app you know that when you slide left/right only content in the middle (without red border) changes and slide animation is applied only to that part of the page.
That is basically what I'd like to achieve. Static part of the code that will initialize only once, stay visible on all pages, and no animations or page transitions would apply to it while switching between pages. I've been reading documentation and have not found any helpful information on how to achieve that.
You can easily implement this by creating a page with the shared controls and a ContentControl object, which will be responsible of showing the actual page content.
The ContentControl represents a control with a single piece of content of any type; which means you can put, for example; a UserControl inside of it, even a Page.
That being said, keep in mind that by doing so; you will lose the Frame functionality and will need to handle many things on your own, such as the navigation stack and back button functionality.
I'll leave you this question on SO which can be of help in your case.
I'm making C# application design with images, but when I launch it, I see loading images (~1sec), so how to make simple loader, when images (background, logo, etc..) fully loads, to show my app? I know it's possible but I don't know how to. Thanks so much!
This sounds like standard behaviour. The controls get painted one by one in z-order and if one is slow the rest may appear to flicker.
You could try double buffering the whole form as shown here:
How to fix the flickering in User controls
Alternatively you could suspend the layout while everything is drawn and resume it afterwards:
How do I suspend painting for a control and its children?
i have create a few WPF applications in visual studio, and now i would like to create a final application to run all of the created apps in the final application. i would like to know how i can create a layout that displays the apps that are running inside the final app as buttons that can be clicked and cause the app to expand and allow the user to work on that app and then when finished return back to the final app and see the other apps to choose from. I imagine it would look like a Google chrome blank page that allows you see your familiar webpages and click on them to load them up. Any help or advice on what i should focus on to implement this would be much appreciated.
Thank you for taking the time to read over this.
Consider using a VisualBrush this takes other WPF UI (your "apps") and uses their UI as a brush for another UI element.
Raj Kumar has a simple article called Visual Brush in WPF for details.
The bit you probably want is at the bottom where he shows you rendering a controls content in another control. The magic being binding the controls visual to the element name whos UI it should render.
I am working on a Win8 app destined for the Windows Store. Hurdles I am trying to overcome is how to deal with the different ways an app can be displayed.
Currently, my main pages is a LayoutAwarePage so it has logic to handle different visual states. However, my question is more how to make my page render differently depending on its state.
I thought, initially, that you basically created a layout for each state that the application supports. But it seems like the VisualStateManager portion of the XAML is just an area where you make piecemeal modifications to the design (hide an element, change an alignment).
I am working with a grid that has many columns and rows to organize my controls and it looks great in fullscreen. However, this doesn't work at all in the snapped state, as most of my controls become hidden off screen. I could certainly add a ScrollViewer control, but this is basically a hack and a usability nightmare for a user.
Thanks for any insight!
It might be that your app doesn't lend itself to snapped view. You are allowed to simply display a message / image that states this. Alternatively, consider just showing the columns that are most important.
The standard MS way seems to be to replace horizontal oriented controls with vertical ones - maybe a listview or something would look better. You'll probably find your code easier to read if you have one control for snapped and another for full screen.
Not exactly related to your question, but Blend works very well with XAML to allow you to manipulate the grid or show the relevant control.
Here is a very good guide from Jerry Nixon.
http://blog.jerrynixon.com/2012/12/walkthrough-implementing-snapview-in.html
I have to create an animated flow chart GUI which displays different states. Further on demand the flow chart elements are re-positioned and re-sized if the focus shifts to certain elements.
All of this is no problem, with drawing shapes, animations, etc. provided by WPF this is an easy, though by hand and alot of manually is done.
The problem I am facing is, that there will be > 40 of these flow charts.
Is there a template mechanism or generic approach to generalize this task?
Creating a set of user controls is the right way to deal with this problem.
The advantage is, animation and design can be encapsulated into the user control files. This way they don't polute the main application code.
There is a project called Graph# http://graphsharp.codeplex.com/ an there must be similar projects on codeplex.