Issue with frame resizing!!!  
Author Message
Ruben Leal





PostPosted: Windows Presentation Foundation (WPF), Issue with frame resizing!!! Top

Good morning,

I'm trying to navigate throw some custom pages in my wpf application. I was checked that "AppModel/FragmentNavigationSample" in wpf samples works perfectly opening a page in a frame embedded in the main window of the application.

I copy the main window and the page to a new project created with "microsoft expressions" but, when I open the frame, the main window is resized to the content size. I think that the only difference is in the project file.

Can anyone tell me what to do to resolve this little problem

Regards,

Ruben Leal



Visual Studio 200844  
 
 
Guillaume R.





PostPosted: Windows Presentation Foundation (WPF), Issue with frame resizing!!! Top

Hi Ruben,
Look for the Window property SizeToContent. It should not be set or have a value of Manual. I d'ont have the code to look for but the problem seems to be that SizeToContent has a value of WidthAndHeight which automatically resize the window's size to it's content size.

Guillaume


 
 
Ruben Leal





PostPosted: Windows Presentation Foundation (WPF), Issue with frame resizing!!! Top

Hi Guillaume,

I checked a lot of time all the window properties, and of course, also SizeToContent.

This is the code of the main window:

<Window
x:Class="FragmentNavigationSample.MainWindow"
xmlns="
http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="
http://schemas.microsoft.com/winfx/2006/xaml"
Title="Fragment Navigation Sample"
Height="600"
Width="500"
>
<DockPanel>

<!--Address bar-->
<DockPanel DockPanel.Dock="Top">
<Label DockPanel.Dock="Left">Address:</Label>
<Button DockPanel.Dock="Right" Name="goButton" Click="goButton_Click">Go</Button>
<TextBox Name="addressTextBox">DocumentPage.xaml#Fragment5</TextBox>
</DockPanel>

<Frame Name="browserFrame" FragmentNavigation="browserFrame_FragmentNavigation" />

</DockPanel>
</Window>

and the page tha I open...

<Page
xmlns="
http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="
http://schemas.microsoft.com/winfx/2006/xaml"
Title="DocumentPage"
>
<ScrollViewer>
<StackPanel>
<TextBlock Name="Fragment1" TextWrapping="Wrap">
<Bold>Paragraph 1</Bold>
<LineBreak></LineBreak>
Ea vel dignissim te aliquam facilisis euismod et velit aliquam aliquip consequat dolor aliquip consequat sit feugait duis et. Duis velit praesent iriure at dolor esse in in feugait hendrerit praesent ex tation quis duis minim eros iusto. Consequat luptatum feugiat eros facilisi at tation vel ad in. Amet commodo nostrud ex feugiat feugait esse minim, diam laoreet lobortis praesent volutpat lobortis ut, nulla, consequat velit. Nisl hendrerit in sed autem aliquip facilisi, veniam et enim consequat et in, praesent, in. Duis velit nulla facilisi autem augue hendrerit lobortis ea feugait. Consequat accumsan te nulla enim, facilisis eu. Feugait nibh lobortis. Nostrud veniam nulla accumsan lobortis tation odio facilisis exerci. Diam dolore nibh dignissim ut eum iriure consectetuer, commodo suscipit dolore dolor, vero facilisi praesent vero et. Wisi iriure ut in dolore dolore ea, blandit eum exerci te. Minim suscipit ad delenit aliquam eros dolore consequat autem, esse, exerci, velit. Ea commodo ad, duis luptatum luptatum wisi praesent dolore, at, vel esse consequat. Dignissim quis nonummy ut ex wisi, quis ad minim vel iusto in delenit, adipiscing et molestie. Vulputate ipsum vel dolore vulputate nisl consequat eu ex iusto. Aliquam at minim commodo laoreet sit tincidunt nisl illum nostrud lorem iusto praesent. Volutpat qui aliquam ullamcorper euismod eu. Delenit hendrerit ex dolor. Ut adipiscing, consequat nisl feugait ad, et ut. Te et iriure qui in wisi in eu feugait consequat luptatum dolor ullamcorper nulla, dolore nisl veniam. Eum erat ut feugiat illum lorem, diam, tation, esse ad te eros. Et esse, dignissim at esse illum eu nisl, diam, aliquip iriure et quis, facilisis. Duis magna iusto et ut, euismod eros. Eum molestie dolor. Ea, ullamcorper consequat te, commodo, praesent nostrud luptatum feugait laoreet dolore, dolor ut consequat et te. Autem vel molestie tation, nisl ad consequat minim tation. Nulla nostrud, eu qui esse dolore tation adipiscing duis sit minim, in nulla luptatum eu eros. Eros facilisis diam wisi sit, in autem commodo quis ex. Dolore feugait ullamcorper ad qui augue illum. Odio autem vel aliquip, facilisis ex esse consequat in qui tation eros. Eum velit illum laoreet consequat, ipsum ut. In duis te vel facilisi exerci tation, blandit enim te vero tation hendrerit accumsan eu hendrerit esse consequat tation consectetuer. Nulla duis vero enim dolore exerci ut. Tincidunt facilisis magna diam nulla dolor, amet autem commodo accumsan delenit augue ut odio vero, in augue nibh. Ad autem nibh aliquip facilisis augue velit consequat in veniam odio volutpat aliquip ut quis iriure.
</TextBlock>

</StackPanel>
</ScrollViewer>
</Page>

This files works fine in the official sample of microsoft, but when I try to create a new project with this files, the mainWindow resizes.

Please, download the official samples of wpf, you can find this sample inside.

Regards,

Ruben Leal


 
 
Guillaume R.





PostPosted: Windows Presentation Foundation (WPF), Issue with frame resizing!!! Top

Hi Ruben,
I don't have a PC with the all the dev tools for .Net 3 installed right know, i'll check this evening the sample code.

Guillaume


 
 
Ruben Leal





PostPosted: Windows Presentation Foundation (WPF), Issue with frame resizing!!! Top

Thanks Guillaume, I'm two days trying to resolve this little issue, and I'm a little dejected.

Regards,

Ruben Leal


 
 
Ruben Leal





PostPosted: Windows Presentation Foundation (WPF), Issue with frame resizing!!! Top

Now works.

I installed new version of expression, named "Microsoft expression blend" and I tryed again to create an empty project.

Now with the new project, my window dont resize to content. I dont know exactly what was happening, but I think that the problem is in the project file.

Regards,

Ruben Leal


 
 
Guillaume R.





PostPosted: Windows Presentation Foundation (WPF), Issue with frame resizing!!! Top

Glad it works, less work for me tonight :p