I want to set the position of the window on the right side on the screen similar to WPF. Is there a way in UWP to do this?
Asked
Active
Viewed 2,385 times
2 Answers
5
AFAIK it's not possible in UWP (at least not yet), you can change window size or make it fullscreen by accessing ApplicationView class, but there are no such methods/properties like in WPF.
There was also similar question on MSDN.

Romasz
- 29,662
- 13
- 79
- 154
-6
Yes there is a way :) Go to your xaml for example Windows1.xaml
then put this there. Example code
<Window
x:Class="Poultry_Management_System.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Login"
Width="450"
WindowStartupLocation="CenterScreen"
WindowStyle="None"
ResizeMode="NoResize"
Topmost="True"
KeyDown="keyDown_form"
Height="200">
As you can see my StartupLocation there is in the Center.

Rkp Conson Visda
- 15
- 4
-
Thanks for answering! What if I want to set the Window location programmatically? – RandomUser Feb 07 '17 at 06:06
-
Well then you should read about event base actions thoroughly. There are many example about that – Rkp Conson Visda Feb 07 '17 at 06:08
-
Are you sure this is for *UWP*? – Romasz Feb 07 '17 at 06:20
-
By the way, your solution is also for WPF, UWP uses
and – RandomUser Feb 07 '17 at 06:22:) -
@RandomUser Where in *
* or * – Romasz Feb 07 '17 at 06:43* in *UWP* is *WindowStartupLocation*? -
@Romasz, I coudn't find the property anywhere, I think it's a
only property. – RandomUser Feb 07 '17 at 06:48 -
This doesn't work in UWP. It's for WPF. UWP does have a class `Window`, but it cannot be declared in XAML and doesn't have such properties as `Topmost` or `WindowStartupLocation`, or `ResizeMode` – Artemious Aug 08 '17 at 06:38