2

So I changed my Window to UserControl :

<UserControl x:Class="SessionRater.MainWindow " xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:SessionRater" mc:Ignorable="d" d:DesignHeight="500" d:DesignWidth="525"> <Grid> <Label x:Name="projectTitle" Content="Session Rater" HorizontalAlignment="Center" Margin="217,24,192,0" VerticalAlignment="Top" Width="108"/> <StackPanel x:Name="panelBttn" HorizontalAlignment="Left" Height="220" Margin="19,124,0,0" VerticalAlignment="Top" Width="117" > <Button x:Name="bttnCreateSession" Content="Create new Session" HorizontalAlignment="Left" VerticalAlignment="Top" Width="116" Height="49" Click="bttnCreateSession_Click" /> <Separator Opacity="0" Height="25"/> <Button x:Name="bttnRateSession" Content="Rate Session" HorizontalAlignment="Left" VerticalAlignment="Top" Width="116" Height="49" Click="bttnRateSession_Click"/> <Separator Opacity="0" Height="25"/> <Button x:Name="bttnCloseSession" Content="Close Session" HorizontalAlignment="Left" VerticalAlignment="Top" Width="116" Height="49" Click="bttnCloseSession_Click"/> </StackPanel> <ListView x:Name="listSessions" HorizontalAlignment="Left" Height="204" Margin="217,124,0,0" VerticalAlignment="Top" Width="262"> <ListView.View> <GridView> <GridViewColumn Header="Name" Width="220" DisplayMemberBinding="{Binding Name}"/> <GridViewColumn Header="Rating" DisplayMemberBinding="{Binding Rating}"/> </GridView> </ListView.View> </ListView> <TextBlock x:Name="tbListInfo" HorizontalAlignment="Left" Margin="230,96,0,0" TextWrapping="Wrap" Text=" Overview (Average Rating of each Session)" VerticalAlignment="Top" Width="262"/> </Grid> 

And now when I always execute my programm I have two arrows appearing on the screen? Why?

enter image description here

4
  • Try to use the live view (top black bar) and look for yourself :). My theory is that your Usercontrol gets displayed by a frame (as those have these arrows). Commented Sep 23, 2017 at 19:30
  • @CShark I changed the UserControl again to Window. Now the Arrows dissapeared but the my setted size (500*525) won't work. The program open the program in the size you can see in the picture Commented Sep 23, 2017 at 19:38
  • Thats because it says "d:DesignWidth". Its for the visual studio designer only. If you want to change the real size of your window/control/whatever you need to use "Width"/"Height" instead. Commented Sep 23, 2017 at 20:32
  • I had similar problem when i changed some Usercontrols. It turned out that my app.xaml was not starting the mainWindow, but directly the first Usercontrol. It seems that Usercontrols can be directly invoked in pages Commented May 6, 2020 at 13:20

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.