I'm using NavigationView in a UWP project that contains a Frame to load pages.
When the windows is small enough the NavigationView Pane is automatically closed only showing the Icons of the MenuItems, if the Menu is specifically opened (clicking the top button) the menu overlaps the pages inside the frame (this happens after a given threshold, when the Window becomes smaller)
I was trying to maintain this behavior all the time (instead of only when the window is resized to small values), even if the window is maximized or is resized to large values.
isPaneOpen appears to be a read only property that does not work at Run time.
The overlap (rather than pushing the frame to the right) I don't know how to get this NavigationView display all the time...
Any help how to do this?
Thank you.
As your description, it seems you want to maintain the NavigationView always in the Compact mode, you can implement this effect by overriding the widths at which the navigation view changes display modes using the CompactModeThresholdWidth and ExpandedModeThresholdWidth properties.
You can try to configure your NavigationView as the following code,
<NavigationView CompactModeThresholdWidth="280" ExpandedModeThresholdWidth="2000"/>
You can set any CompactModeThresholdWidth property value smaller than the minimum default UWP app window width and the ExpandedModeThresholdWidth property value larger than the maximum window width.
More details, please see the NavigationView display modes topic.
Related
I have a Winform I want to resize. Not after launching; I want to resize it in the designer by dragging the edges.
I am aware that I can change the size manually in the form properties. This is not what I want to do. I want to quickly size the default size of the form with my mouse.
The problem appears to be that I cannot grab the edges of the form for some reason. I repeat, this is NOT DURING RUNTIME. It is not that I have disabled/enabled Autosize/Resizing.
It's almost like the edge grabs are a single pixel wide and I just can't hit it. I don't know. I've looked for accessibility settings. The last thing I want to do is reinstall MSVS. It's just maddening.
I've attached a photo. The little boxes on the bottom, right, and bottom-right corner are my targets.
you can try to click the form title before resizing. I think you may have a panel (or any container control) which is full docked in the form, that's why when you click the form body, you selected the panel instead of the form.
Another issue that I encountered was the windows font size was set to 120% (or more), so go to windows display setting and set the font size to 100%.
I`m exploring the navigationview control for uwp projects. I noticed that when I resize the window to a smaller size the menu changes to compact mode and, if the the window is small enough it overlays over the right page window rather than pushing it to the side.
I want to change the navigationview control to have this behavior by default without having to resize the window to a smaller size. The goal is to have the page window with the most space available possible.
I tried some properties but none worked, any pointers how to change this default behavior(Overlay and always in compact mode)?
you should use the latest NavigationView by winui library, and in this control you have a property PaneDisplayMode, explore values of this property and you can know what exactly you want. In your scenario you want the left pane to completely disappear and overlay then you can try LeftMinimal but if you want it in compact mode which shows only Icons then you can use LeftCompact
You can try to confugure the CompactModeThresholdWidth and ExpandedModeThresholdWidth properties of NavigationView. These properties will get or set the minimum window width at which the NavigationView enters Compact or Expanded display mode.
<NavigationView CompactModeThresholdWidth="280" ExpandedModeThresholdWidth="2800"/>
You can set the width value base on your requirement. For example, if you want the NavigationView alway in Compact Mode, you can use above code with any CompactModeThresholdWidth property value smaller than the minimum default UWP app window width and the ExpandedModeThresholdWidth property value larger than the maximum window width.
Unfortunately I can't provide screenshots for comparison now, since I'm unable to use Aero here at work, but I'm having the following problem:
I'm creating a small WPF application. My main window is not resizable, and the sizes and positions of everything inside are fixed. Everything works fine here using some pre-defined theme (it's "Windows Classic" most likely). Once I run the exe at home though - with Aero enabled - the border size is way bigger, but the actual total window size stays the same it seems to me. So the borders go "into" my window, shrinking the actual usable space and thus some of my controls are overlapped by the borders and it looks asymmetrical.
What can I do about this, if anything? Is there some option to make the borders be attached "outside" my used window space?
Edit: Here is an uploaded image of the Aero version. I hope the problem can be seen. (It's at the bottom)
In my opinion a static size is a bad way in wpf.
There are different solutions:
1. make your window a bit heigher or
2. reduce the margin between your used content elements or
2. use a dynamic size of your content. A grid with rowdefinitions set to "X*" where x is the height in propotion to total height of your content.
But im not sure ... you use a style in your app or is the style directly set into element? If you use a xaml stysle file, is it possible the style overrides your set position or margin properties?
I needed a modal dialog for my app but it appeared there is nothing like that in XAML Metro app. Someone suggested a popup.
I tried and it appeared that underlying UI still responsive.. so a Popup is not modal.
I thought OK may be its purpose is to be a popup in the center of the screen regardless the other layout and it appeared - not. Popup is bound to a layout as everything else. if it is in a grid it will be placed in row 0 and column 0 not in the center..
So may be I missing something. please help to understand. I cant find any use for it different from what can be achieved by using Grid.
what is the purpose of Popup? how it different from any other content controls?
Differences:
You don't have to put it as a child of another control. Though in such scenarios you might get problems traversing the visual tree and focusing on a TextBox won't shift its contents so the virtual keyboard might cover its contents or its adorner contents might lose alignment to adorned controls not on the Popup.
Its content tree is rendered on top of any other content and (I believe) doesn't get clipped by parent control's Clip regions.
You usually need to set its Width and Height manually when first showing or when parent layout (or size) changes, especially in one of the most common scenarios when you set its Width and Height to the Width and Height of the parent (or the window).
That said - modal dialogs are bad UI and should be avoided. You can simply navigate to another page if you would otherwise want to display a dialog or use other approaches. There's (almost) nothing more annoying than displaying a modal dialog over UI that looks otherwise enabled but doesn't respond to input.
I needed a modal dialog for my app but it appeared there is nothing like that in XAML Metro app. Someone suggested a popup.
Since Windows 8.1, there is actually something similar to a modal dialog that you may want to look into:
It's called Flyouts.
Apparently a modal popup with custom content is missing in Windows 8.1. One possible workaround:
use a Popup control (per se not modal)
make the background semi-transparent
stretch it across the entire screen
place the actual popup content inside that container and leave some space around it
Now, the parent page is visible but dimmed, and it cannot be accessed as the Popup is covering it.
In my Winforms application I have a toolbar that contains many items (buttons with icon 32px, labels and comboboxes).
I decided to set the Toolstrip.LayoutStyle property from the default HorizontalStackWithOverflow to Flow in order to allow the toolbar split automatically on more rows when user have a very low resolution monitor or he/she resize the window.
The problem is that all labels and comboboxes are aligned to the top of Toolstrip when I change the LayoutStyle.
Does exist a property or any other workaround that allow me to center them vertically?
I think I see what you mean, the label isn't as tall as, say, a button. And it gets aligned improperly with LayoutStyle = Flow. Ugh. You can work around it by changing the Padding property of the label. To do this properly, you should however do this in the form's OnLoad() method override, the label will be taller when you run on a machine with a higher video DPI setting.