I was wondering if it was possible to to a page transition on itself. I wanted the sort of book style flip transition but without actually changing the page it's on (I am updating the page with new information)
I have done searches but I don't think I'm thinking of the right words to search for as I can't find any examples for what I want to do - they're all transitioning to other pages.
Christian Schormann demonstrates in his Mix 2010 talk, CL02 how to animate turning of the current page.
I recommend downloading the high def version so you can have a close look at the steps.
Have you tried using the Non-Linear Navigation Service?
Alternatively just update the model the page is bound to and add an animation to simualte the opening of another page.
Well, what I'm going to write isn't a good practice, but I think it solves.. =P.
You can redirect to a "UtilPage", and inside that UtilPage, you redirect back inside the initialize method or you create a DispatcherTimer to redirect in X mileseconds.
Again, this isn't a good practice, but consering that the framework doesn't help in this case... =p
Take a screen shot of your page with WriteableBitmap (like use the UIElement contructor one), put that in <Image> control and add it to the grid/canvas. Then update your information. Then animate your <Image> any way you like, like a PlaneProjection. Once the storyboard is done, do a LayoutRoot.Children.Remove(YourImage).
Related
I am trying to implement multipage functionality with quill. I want to fix the height of each page, and when user reaches the end of page, instead of editor height to grow or scrollbar to appear, I want cursor to go to next page(editor), similar behaviour as observed in Google Docs or Microsoft word document.
I have already added 2 editors in the view, but not having any idea on how to switch to new page as cursor reaches the end of first page.
i come straight from google trying to figure out something similar with quill and as far as i know and as far as i came while researching this specific topic:
to me it seems as if its not possible with multiple editors since as soon as the user wants to select paragraphs/elements over a multi page span you'd have to figure out how to
make the selection actually possible (try to select content over a span of two div elements which both are "contenteditable"-enabled, which was one of my first tries kinda).
spread the selection on multiple editors (you'd have to keep track of how much the user selected and when and how far the selection is within which editor which is kinda tricky)
execute an action over multiple editors which will be especially hard since there is no thing as "shared toolbar" yet (as far as i know)
so i really hope (🙏) the time helped you to find an sharable 🤲 solution to this but as far as i built up my knowledge about quill so far (which is a bit over a few weeks old now).
what i will try in the near future is to add a new module to show a page break and style all other elements accordingly to simulate the look of a page.
I have an application that is made using WPF, i have multiple pages and a form that contains a frame, and i load the pages on a frame, and each page has back and next buttons.
what i want to do is to animate the navigation of the pages on the frame in a way when i press Next, the current page slides to the left and the following page slides also to the left and replacing the the current page, and when i press back the current page slides to the right and the previous page slides to the right replacing the current page.
how to do that?
I may be proven wrong here but I don't believe WPF exposes a way to implement this easily. There are methods for overriding existing transition animations in UWP.
For WPF you can handle this one of two ways...
Start the animation of the page sliding out. When the animation is
complete let it fire an event that will then call frame to change
pages.
Have the page offset by default and perform the animation to slide it
in to it's original spot.
or....
Capture the Navigating event of the frame, monitor NavigationMode, call the animations, make the navigation wait or mark e.Handled == true and recall it after with a flag that says it can continue.
Do the same for transitioning in.
Here's the problem; you won't have both pages on the screen at the same time and you'll have to write some fancy transitioning code to make all this work correctly. I would go as far as introducing custom controls with interfaces or DependencyProperties that have the transitioning functions embedded etc.
That said; I have had this problem in the past and to be fair I just gave up on the Frame control and pages and did it all manually. In the end it felt faster, easier to maintain, and I was able to achieve any effect I wanted.
So if you want my honest answer just don't use Frame and do it all manually... (This is speaking for WPF only. UWP has other features and more reasons to use the built in navigation than WPF does.)
Well, I believe the simplest solution would be to drop using Frames and implement your own navigation mechanism using something along the lines of the TransitioningContentControl (so you don't have to implement the transitions from scratch).
Basically, you'd have an list of your controls, an TransitionContentControl and two buttons (back and forward). So all you'd have to do is handle the clicks on the buttons and set the Transition accordingly (eg. when back button is pressed set it to Left and load the previous page).
I'm using AngularJS 1 with angular-material and ui-router.
Does anyone know what the best practice is for providing a UI for some "new foobar" type thing? In other words, let’s say I have a ui.route putting me at /app/#/foobars/ which shows a list of all the foobars. At the bottom right is a FAB with a big plus sign, which will bring up a new UI something to allow the user to specify how they want their foobar. What is the best practices for this "UI something" that comes up, using Angular?
Should I use an angular-material dialog? (That’s my first inclination, but it seems old-fashioned.)
Do I create a route to /app/#/new-foobar/ and just bring up another UI? (This seems heavy-handed; I don’t want to change the URI, plus I probably want to get back to where I came from after creating the foobar.)
I think that ui-router allows nested states; is this something I would use? But I don't want the new view/component to be embedded in the current view --- I would expect a card or something to somehow "overlay" whatever view is showing.
I wouldn't use nested states for this, as they are intended for things such a master/detail navigation.
The answer to your question is "it depends", as many situations in programming there're always some tradeoffs you must consider. Depending if you're targeting a desktop or a mobile app you'll have more or less space to put these options on the screen. If there're a lot of configuration options you should define a completly different state on wich you layout them and apply this configuration when you come back to the list. If there are not too much of them or you want to keep them visible at the same time as the list, you can go with a SideNav panel that can be locked open depending on the resolution. An alternative I've used sometimes is using a subheader to show some controls, as you can make it "stick" below the header or let it go if you scroll the list. As I told you before is a matter of choices and tradeoffs, and some sense of usability and simplicity towards the final user. There's no silver bullet nor best practice, just follow your intuition. Good luck!
I have several Wpf pages in my project, these pages have different forms and ui control indide theme. The image below shows the mainWindow and there are two button.
I want to show a specific page when I click on + or Edit button using the Frame control which is highlighted.
apparenatly this woks:
Page1 me = new Page1();
mainFrame.Content = me;
But it has an IE navigation sound and a toolbar appears after going to page2.
any better way to show diffrent pages and not using a frame?
You may want to convert the Page into a UserControl. You can then put that control inside some other container, such as a Grid. You'll have to manually swap out the pages in the container when navigating, but it looks like you're doing that anyway.
The purpose of the Frame control is to allow navigation. If you don't want navigation, then don't use Frame. You can turn off the navigation toolbar, but that won't actually disable navigation - there are mouse buttons and keyboard shortcuts for navigating back.
If you just want to host a UI element without navigation, use something simpler, like a Border element - put the content in its Child property. You can change the Child as many times as you like at runtime.
I was able to set the frame control's NavigationUIVisibility to Hidden. This solved the problem for me. I am using Visual Studio 2010 though so it might not be applicable to older VS versions.
Ian Griffiths, what you suggest increases the workload on the developer substantially. And you are stepping outside of the underlying paradigm of XAML.
In my case I'm developing a game application and have chosen WPF as the UI platform as much as possible. For me that means a intro screen, character select, etc. The purpose of Pages is to encapsulate the navigational need of such an application.
I suspect your downvote is due to your statement "If you don't want navigation...". Upon re-reading the original posters question I see he does want navigation, he just wants it on his own terms. I would have voted you down too. YotaXP's solution neglects the issues with using a User Control, particularly if it may contain other User Controls. It looks like Chris Calvert came up with an actual solution to the poster's issue within the parameters of the problem.
I would be curios if I could override the navigation hotkeys and such within the existing paragimn but that's properly in its own thread.
I am currently loading the default file, page.xaml, but in that page, I am loading the content from another xaml file. With each "page" change, I just load the content from a different xaml file, and on and on.
Example: this.Content = new StartPage();
I'm running into some syntax issues, however, because of the way I am changing my content, and was wondering if there is a definitive answer on how to accomplish this?
For example, when trying to capture user's keystrokes, I would normally do:
this.Keydown += new KeyEventHandler(this_KeyDown);
but that event handler doesn't even fire in my situation. So, I'm looking for a new approach to my content-switching approach before revisiting the keystroke problem.
Have you looked at using Silverlight 3. It has a new Page Navigation functionality.Silverlight 3 Navigation
As far as content switching goes, I've always done what you propose in the question. Normally I create a MainPage.xaml which has has the frame of the application (usually a Grid for me). One of the cells in the Grid is considered the content area of the app. When the user takes an action that I would consider to be navigation, I create a new instance of a Page, which for me is a file like MyUserControl.xaml, and then add it to the appropriate content cell in the Grid. MainPage stays around for the life of the application and assists with navigation.
If you want something fancier, and want to take advantage of browser based back/forward buttons, you could look into the SL3 navigation like Correl suggested.
A Big problem with what your're doing is that journalization doesnt take place automatically when you swap out framework elements by creating them and plugging them in the codebehind. This means that you lose the back and forward functionality of the browser. You can manually journalize stuff when you swap out pages, but this is simply a hack to get your navigation approach working.
Take a look at Prism at www.compositewpf.codeplex.com/, specifically the MVVM method of GUI design, it'll save you alot of time later on. And remember, you dont need to go hardcore when you look at MVVM, u could always cut out alot of "dynamic" functionality if you're a one man band
Also swap to silverlight 3 and use the navigation application. If you cant, take a look at helix 0.3, it'll provide a more asp oriented approach to navigation. the link provides a really really good starting point, its a three part article, i suggest you read all three and download the sample application and understand it.
A book could have been written on your question, this has to suffice for now.