I am currently creating a sidebar-like WPF application in C#. When a user starts the application, I would like the window to automatically position it\'s self to the side of the
You can do this without referencing win forms assemblies by using SystemParameters. In the code behind for your window XAML:
MainWindow() {
InitializeComponents();
this.Loaded += new RoutedEventHandler(
delegate(object sender, RoutedEventArgs args) {
Width = 300;
Left = SystemParameters.VirtualScreenLeft;
Height = SystemParameters.VirtualScreenHeight;
}
}
SystemParameters documentation