Changed width/height when changing size of screen - windows-phone

I want to change width & height(scale) all grid,images,text automatically...when changing size a screens.
Higher screens then text or images are smaller...change in my app for different Screen Resolution and Screen size.

The SharedSizeGroup attribute when defining ColumnDefinition could be of some help here assuming you're using Grids. An MSDN article about it could be found here: http://msdn.microsoft.com/en-us/library/ms751905.aspx.
Alternatively, you could create some sort of cascading bindings using the likes of this: <TextBox Height="{Binding ElementName=SomeOtherControl, Path=ActualHeight}" />

Related

how can i default navigationviwe display mode in uwp?

I try to change it and I use navigation view display mode tag but it doesn't work?
<NavigationView
Canvas.ZIndex="0"
x:Name="NavigationViewControl"
Grid.Column="1"
AlwaysShowHeader="True"
Header=" "
HeaderTemplate="{StaticResource NavigationViewHeaderTemplate}"
IsTabStop="False"
ItemInvoked="OnNavigationViewItemInvoked"
DispalyMode="Minimal">
The NavigationView has three display mode options: Minimal, Compact and Expanded. By default, the system automatically selects the optimal display mode based on the amount of screen space available to the control. But you can override this setting by using configuring its OpenPaneLength, CompactModeThresholdWidth and ExpandedModeThresholdWidth properties.
For example, if you want the NavigationView to be Minimal mode, you can try to set the properties:
<NavigationView CompactModeThresholdWidth="1920" ExpandedModeThresholdWidth="1920">
More details, you can look into the NavigationView display modes and Overriding the default adaptive behavior topic.

RichEditBox text wrapping UWP

I am trying to get a RichEditBox to take over the entire width of the app window and to be responsive to window resizing, so far the code I have is the following:
<RichEditBox HorizontalAlignment="Stretch"
TextWrapping="WrapWholeWords"
Height="250"
Name="Intro"/>
What I am getting from the code above is this:
Any ideas on how can I get this to work? Why is it that I tell the text to wrap and it doesn't follow?
UPDATE
I also tried this:
<RichEditBox HorizontalAlignment="Stretch"
Height="250"
Name="Intro"/>
But the result is:
The problem that I am having is that it seems that HorizontalAlignment="Stretch" does not really do anything. The only way I am able to set a decent width is by hard-coding it, for example: Width="600". But if I do this my UI will not respond correctly to resizing. I also tried HorizontalContentAlingment="Stretch" but the result is exactly the same.
How can I get my RichEditBox take up all the available Width and Wrap at the same time?
If you look at the documentation of RichEditBox.TextWrapping, you'll notice that WrapWholeWords is invalid. You have to use
<RichEditBox TextWrapping="Wrap"/>
-or-
<RichEditBox TextWrapping="NoWrap"/>
Since Wrap is the default value, you can drop the property.
<RichEditBox HorizontalAlignment="Stretch"
Height="250"
Name="Intro"/>
Edit: in reply to the updated question:
A control only takes the width of it's parent control. Some container controls (e.g. Grid) automatically take the full width available, while others (e.g. StackPanel) only take the required size of it's children. Using HorizontalAlignment="Stretch" in combination with a StackPanel as a parent control, will only use the MinWidth property instead of the full available width on your screen. Sometimes you can't directly see this issue, e.g. when your control is inside an itemtemplate of a ListView. Use the Live Visual Tree in Visual Studio to find the parent containers and locate the issue.
So in short: make sure your RichEditBox is inside a Grid (or similar control) instead of a StackPanel.

Increase width of App bar button in WP8.1

While using the Appbar button in the CommandBar of a Page, content of the Appbar button is fixed it seems. So that the width is not increase based on the Content.
Is there any work around to make visible the whole content or like wrapped content?
Thanks in advance.
<CommandBar BorderBrush="White"
BorderThickness="1"
IsSticky="True">
<CommandBar.PrimaryCommands>
<AppBarButton Icon="Accept" Label="return to yard" />
</CommandBar.PrimaryCommands>
</CommandBar>
It's funny but it depends on your phone's language. I have discovered it in my own app, where one of AppBar buttons has long label. When the language is set to Polish, then the label wraps and has two lines. But in English it has the same problem like you... One line and clipped (first button in screenshots below).
Polish:
English:
The answer to your question is: there is no way to change the size of AppBar buttons or labels. You have to come up with some shorter label...

How to make CheckBox bigger on Windows 8

How to make CheckBox bigger on Windows 8 ?
I already know about LayoutTransform, but looks like there is not this property on Windows 8:
<CheckBox>
<CheckBox.LayoutTransform>
<ScaleTransform ScaleX="2" ScaleY="2" />
</CheckBox.LayoutTransform>
</CheckBox>
Several ways:
You can increase the overall size by applying a render transform. This will double the height and width during rendering. It may not lay out as you want.
<CheckBox RenderTransformOrigin="0.5,0.5" >
<CheckBox.RenderTransform>
<CompositeTransform ScaleX="2" ScaleY="2"/>
</CheckBox.RenderTransform>
</CheckBox>
You can use a ViewBox, which will lay out in the same spot but won't give full control over the size
<Viewbox Height="100">
<CheckBox>
</CheckBox>
</Viewbox>
Or you can edit the template. This is the most code, but most will be generated for you if you select a checkbox in the designer, right click, and choose "Edit template...". It will provide the most control and you can completely swap out the Checkbox's elements. MSDN's Quickstart: Control templates demonstrates changing a Checkbox's template. Depending on the exact look you'll want you'll probably need to increase the sizes of all of the sub-elements (NormalRectangle, CheckGlyph, IndeterminateGlyph, FocusVisualWhite, and FocusVisualBlack).

How to adjust xaml page for every resolution and screensize?

I am developing a windows 8.1 store app.By default windows store apps generate pages which are having 10.6" screen size and 1366*768 resolution.I want my every xaml page to fit on all screen sizes and resolutions.I solved this problem by using a Viewbox but only one page is not behaving as expected.I am doing this:<Viewbox>
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
</Grid>
The grid is not taking the whole width of the page but Viewbox is taking.Please help.
By default the ViewBox will Stretch Uniform to maintain the aspect ratio of its contents. You can set its Stretch property to Fill if you want it to distort to fill the whole page.
You don't include the contents of the Grid in your code snippet, so it's not clear what all you have in there to know how it would stretch. Since it's stretching to fill vertically but not horizontally I expect your contents are taller than they are wide.
As Chris W notes in his comment, ViewBox is probably not what you want here. In general you're better off using flexible layout controls such as the Grid. If you remove the ViewBox the Grid (assuming it's in the root of the page) will expand to the full Window size. Using relative row and column sizes (as you do) rather than hardcoding sizes the layout should adjust to the page size.
For extreme differences such as portrait vs. landscape vs. skinny you may want to use Visual States to provide different layouts for the same content. MSDN's Quickstart: Designing apps for different window sizes goes into detail on how to do this.