0

I need to make my mainwindow resizeable.. but it's pointless to resize it if the contents inside don't scale with it.. i googled and didnt' find much.. i did find this though:

and it doesn't work.. i have tried this:

<Window.RenderTransform>
    <ScaleTransform ScaleX="0.8" ScaleY="0.8" />
</Window.RenderTransform>

and tried this website here

http://inchoatethoughts.com/scaling-your-user-interface-in-a-wpf-application

but even trying from a blank project, it didn't work for some reason =T

EDIT: i think what makes it tricky is that i have two sets of grids. the first grid for a mock title bar, and a second grid for the rest of the content

user1189352
  • 3,628
  • 12
  • 50
  • 90
  • You can try this solution. I think is fit for your problem too http://stackoverflow.com/questions/7355999/way-to-make-wpf-dockpanel-auto-resize-based-on-its-childrens-size – Krekkon Oct 18 '13 at 18:30
  • hm k i'll look into this – user1189352 Oct 18 '13 at 18:41
  • Probbable duplicate: http://stackoverflow.com/questions/5988876/flowlayout-itemscontrol-in-wpf – philologon Oct 18 '13 at 18:45
  • WPF is resolution independent by default, unless you do everything wrong by using the Visual Studio designer instead of writing your XAML by hand as we all do. Post the relevant XAML and a screenshot of what you have versus what you need. – Federico Berasategui Oct 18 '13 at 20:14
  • found an answer that works here: http://stackoverflow.com/questions/3193339/tips-on-developing-resolution-independent-application/5000120#5000120 – user1189352 Oct 18 '13 at 21:00

1 Answers1

0

I would use a ViewBox.

<Window>
    <Viewbox>
        ... your Content
    </Viewbox>
</Window>

See Stretch Property Enumeration for several options to scale.

LPL
  • 16,827
  • 6
  • 51
  • 95