I use DevExpress tab control.
At the moment, when a user does something that takes some time, such as generating something etc, I have a window come up with text "Saving ..." that essentially disables the MainWindow while the operation is in progress.
This obviously doesn't let them continue on doing something else in the meantime.
I'd like that they could simply click on another tab and do something else.
An example done in paint :) :
User presses 'Do Something' button.
Tab1 is now disabled until 'Something' is done.
Tab2 however, is not.
Ideally it hovers over the usercontrol rather than pushing stuff out of the way/making them invisible.
EDIT: The text needs to be editable. I.e. If I'm looping through products for example, ideally I write 'Processing Product 0/100'
Related
I have a WPF RichTextBox in my application that sits in Grid. It gets updated every second or two as it displays logs (though sometimes there are no logs for up to a minute depending on the load).
The grid is not always visible, as it sits in its own tab. If the user is on another tab, the logger is not visible.
My problem is that I want the RichTextBox to scroll to the end every time a new paragraph is added. It seemed simple as there is a 'ScrollToEnd' method on the RichTextBox control and so I call that method every time text is added to the control.
The problem is that that method only works if the control is visible, if the user is on another tab, the RichTextBox will not scroll to the end and it looks weird when you click on the tab with the logger and after a couple of seconds or longer it scrolls to the bottom when it should already be at the bottom.
Is there a way around this annoying "feature" of the control? I would like to ALWAYS have the RichTextBox be at the bottom unless the user is manually taking control of the scroll bar.
Thanks!
By default, the TabControl actually doesn't change its contents visibility, it removes them from the view completely when you change tabs and then "re-attachs" them when you navigate back to the previous tab.
That's why the Visibility change doesn't get fired. Instead, you should handle the Loaded event, which should get fired right before the view is re-rendered.
Is there a reason you cannot simply call ScrollToEnd in response to the text box becoming visible? That seems like the simplest approach. Did you try it and run into an issue?
Edit: If you are using a TabControl, each TabItem has an IsSelected property you can bind to from the ItemContainerStyle. You could probably scroll your text box in response to the tab becoming selected.
As a separate note: if you are planning to make a custom control for this, here are some things to consider.
I wrote an auto-scrolling version of a FlowDocumentScrollViewer. (I never needed a RichTextBox specifically, but they display similar content.) I can tell you that there are a lot of things to account for, such as knowing when and when not to auto-scroll based on what the user is currently doing.
For example:
If the user takes over the scrolling themselves via the scrollbar or mousewheel, you don't want the control to fight with them.
If they start selecting text, you don't want to scroll it away from them mid selection.
If they scroll to the bottom, you probably want it to start auto-scrolling again.
Also, determining what the user is doing to begin with can sometimes be a complex process on its own.
I have a WPF Winform application. The form has a header on the top and a user control below. Once i am done entering values in the user control, i want to dismiss this user control and add another user control in that area. I will have 4 user controls in a sequence and I may have to move back to the previous user control or move forward.
Which is the better approach to achieve this in MVVM? To hide and view the user controls or dispose the user control.
Hide. Its simpler.
Also your description sounds remarkably like a wizard, so you might want to look at using a NavigationFrame as this would then allow you to "navigate" to the next set of controls once once set is complete.
P.S. Navigation frames can very easily be styled to completely remove the navigation bar UI, see http://winchrome.codeplex.com/ for some examples
Something stops controls from getting focus with TabKey. The form has a 2 paged XtraTabs, a few group boxes and mostly txtBoxes.
I have set the tab order with the taborder tool. I also tryied it manually.
Something doesnt work.
When I first hit tab, does not even go to the next control (from the tabpage header). Even if I click on a txtbox and press tab, nothing happens.
Any idea on what's wrong with this?
I have a stackpanel holding a group of buttons in my WPF program. I set it up so that the user can drag and drop the buttons to re-order them. I would also like the user to be able to drag a button away somewhere to remove it from the stackpanel. This could mean that the user is dragging the button to a completely different window (like Windows Explorer or Google Chrome or the Desktop).
Is this possible? Can my code be notified when the user releases (drops) the button while the mouse is over another program?
It looks like I can check the value that is returned from DragDrop.DoDragDrop(...). I call it like this:
var result = DragDrop.DoDragDrop(this, this, DragDropEffects.Move);
It looks like if result == DragDropEffects.None, then the user dropped the button off the window.
I am working a WPF application, where I have maintained a Menu Bar with Input Gestures i.e keyboard Shortcuts.
For Save As menu item, I have kept Ctrl+A as per User's requirement. It works fine as far as the focus is on the main window.
Now my problem is, suppose use has navigated in some Listbox in window, and if he presses Ctrl+A, then Select All functionality takes places for the list box and Save As dialog box does not get called (as i have done the command binding for this input gesture)
Any idea how can I avoid this? and yes, I can not change my input gesture. It has to be Ctrl+A. :)
Thanks
I think you could change the command bindings on the list box object to remove the binding for the command. Look at the ListBox.CommandBindings list.
You could also turn off Focusable on the ListBox so that it never receives keyboard commands.
You could also check out the eventing model. You could probably catch the keydown as the preview events "bubble up" from the root of the logical tree and then they are passed down from the end element down. They can be marked as handled on the way up or the way back down.