I have 3 pages in my application.
First page: 5 Buttons, each navigates to different page (currently, only the first button works).
Second page: Back Button and ListView, the ListViewItems are UserControlItems with Button, Image and TextBlock. When you click on the Button (of the UserControlItem) it Navigates to the third page, which is Media Player Page with alot of controls.
Third page: Media Player page with alot of controls such as MediaElement, Slider, Buttons and more
When I navigate from Third Page to Second Page using the Back Button, sometimes the screen stays black (the color of the theme) and sometimes it loads too much time. In addition, the ListView has visible vertical scrollbar (always) which is not shown unless you move your mouse on the ListView.
How to fix these problems?
EDIT 1:
link to my project - put some .wmv/.mp3/.mp4 files in the Videos Library folder.
EDIT 2:
I investigated the black page issue abit more and I found that the MediaElement is the cause.
The MediaElement stores the stream and it slows the computer.
In order to resolve to problem, when you click on the GoBack Button, it first set the source of the MediaElement to null, and only when the MediaElementState == Closed, I go back - seems to solve my problem (since I applied the solution I didnt experience more black screens).
About the scrollbar - I think I'll be able to solve it if I simulate MouseOver over the ListView - no idea how to do it
Ok Ill List out the issue one by one.
List View Scroll Bar : Since we are developing for a potential touch surface so scrollbars are not meant to be visible every time.
Blank Page : When you press the back button then Big page Ie third page gets stored in the forward navigation property of the history element. Additionally all the resources that were being used in the third page is disposed. So the time taken to go to second page becomes huge.
Please try havig a fourth page which will have less controls. And see if any Black background issue is occuring or not. It will give a better and clear picture.
--- Update Code for permanent visibility of scroll bar---
Please download the code for listview styling from
Listview styles
add your code to the project
and replace all FadeOutAnimation By FadeInAnimation.
This was the quickest I could do for a solution. For a Better one you can always play with the styles.
Ohh one more thing please add
Style="{StaticResource ListViewStyle1}"
To your list view. please try and let me know.
Related
Here is my UI structure in the Hierarchy:
And here is how it looks:
So basically, when I click the first button, its color changes on click as expected. However when I click the second or the third one, the first one also displays the click animation, instead of the one I clicked.
Here are some things I noticed:
The buttons do register a click as expected.
When animating the button further than the default (by using custom timeline animations) the behavior is slightly different between the first and the second + third ones.
Things to note:
I am using a horizontal layout group on the panel with the following settings:
Each button has a TMP image inside with the same size as the button itself.
I theorize that the HLG is the problem here, but I've tried many settings and the result stayed static.
If you need any additional information, please ask.
Turns out the problem was that the target graphic on the buttons were all set to the first one. That's why they still registered the click properly even though the visuals were messed up.
My issue with the keyboard covering my Entry is very specific. I have found two fixes to this issue.
Wrap the whole page in a scrollview, iOS by default will resize when the page is a scrollview.
This would work but the page is made for messaging and has a StackLayout with two children, a scrollview with all of the previous messages being displayed, and a Stacklayout with an entry field and an Image of an arrow. When the StackLayout put into a scrollview the entry field stays at the bottom of the page which is not ideal.
Here is an example of the first fix:
https://www.screencast.com/t/mEf0VikS
I also found a render:
https://github.com/adamped/SoftInput/blob/master/SoftInput/SoftInput.iOS/Render/KeyboardRender.cs this render would work but for reasons I do not know it would resize the page correctly, but will always send the user to the top of the page. Here is an example of the second fix:
https://www.screencast.com/t/KzrZw92B20X
I would like to avoid using Nuget packages but if that is the only other way to fix this issue I would be ok with it.
In my case, I'm using grid and stacks, wrap my root layout in a ScrollView and set the orientation to neither. And it works without any Nuget and code-behind.
I have a view and within the view, there are two user control, each with a button on it. When the page loads, the first user control will load. when i click on the button in the first user control, I would like to slide the first user control left, making it invisible and display the second user control. when i click on the button in the second user control, I would like to slide the second user control right, making it invisible and displaying the first user control again. can anyone help on how to achieve this?
If I get correctly, you want something like Carousel in wpf. In case that's it, here's the link. It allows you to slide several items left-right to switch between them.
Another way to go would be using default animations in WPF, meaning DoubleAnimation applied to Margin property that increases margin from 0 to 500 (to move it off the screen) and back to 0 (to return it) or something like that. Head's up for double animation and moving controls is here and official documentation here.
Rather than hard-code an animation designed for your specific scenario, you could do something a little more generic and adapt the TransitionControl that uses pixel shaders. Set the content property and you can specify which shader effect you want it to apply as the transition.
I am currently having issues with rendering different screens in 1 window (only 1 screen displayed in the window at a time).
The solution i want to achieve in my WPF application:
1 Window (all screens must be within the same screen)
3 different screens
when something is selected on the 3th screen (button), the first screen shows up again
The first and the second screen were loading up successfully but i was unable to open the 3th screen. Since then i have been trying several things but was unable to come up with a solution.
The application structure looks like the the following:
Main Screen (With a button) --> When clicked on the button 2ndscreen replace the 1st screen. The 2nd screen holds yet another button, when clicked shows the 3th and final screen.
I cannot seem to be able to open this 3th page.
What i have tried so far without any success
navigation window (redirection with the navigationService always yields a null exception)
frame (when i open the second frame the content of the first frame is still there, a refresh or content clear did not work to render only the second screen).
Best regards.
I've got a problem with a scrollbar.
I've got 2 updatepanels. 1 that holds a gallery and other updatepanel that holds 2 buttons when button is clicked the pictures in the gallery change.
I've got a problem in my big gallery(holds more pictures) that when clicked on the button the scroll bar is reset to the top of the page and when you scroll down it takes forever so that page gets stuck when it tries to load the picture or repaint them (not sure).
I tried to look for a way to start the scroll bar in the position of the gallery so the user won't be needing to scroll down after loading the picture with the subject he wants to see, but after about a few hours looking for solution I gave up.
I'm using jQuery and ASP.net
If you're only targeting IE add MaintainScrollPositionOnPostback in your page declaration (or config file)
<%# Page MaintainScrollPositionOnPostback="true" %>
Otherwise you'll need to use script to target an element on the page - e.g:
http://blogs.x2line.com/al/articles/156.aspx