juancampa / Gearset

XNA/Monogame development toolset. New maintainer: https://github.com/PumpkinPaul/Gearset
MIT License
10 stars 8 forks source link

MonoGame support #4

Closed juancampa closed 9 years ago

juancampa commented 9 years ago

Hey @PumpkinPaul, have you successfully ran Gearset on top of MonoGame? I have a (local) commit which adds MonoGame supports but I haven't tested it in months. This would be my main focus for now.

Vodacek commented 9 years ago

That will be awesome to have MonoGame support! I am planning to test it. Will be supported both windows versions? (DirectX and OpenGL)  


Od: Juan Campa notifications@github.com Komu: "juancampa/Gearset" Gearset@noreply.github.com Datum: 23.04.2015 20:43 Předmět: [Gearset] MonoGame support (#4)

Hey @PumpkinPaul https://github.com/PumpkinPaul, have you successfully ran Gearset on top of MonoGame? I have (not pushed) commit which adds MonoGame supports but I haven't tested it in months. This would be my main focus for now. — Reply to this email directly or view it on GitHub https://github.com/juancampa/Gearset/issues/4.

juancampa commented 9 years ago

I don't see why not support both versions, so yes!

Vodacek commented 9 years ago

Great, I will look forward to it!  


Od: Juan Campa notifications@github.com Komu: "juancampa/Gearset" Gearset@noreply.github.com Datum: 23.04.2015 21:44 Předmět: Re: [Gearset] MonoGame support (#4)

I don't see why not support both versions, so yes! — Reply to this email directly or view it on GitHub https://github.com/juancampa/Gearset/issues/4#issuecomment-95696329.

PumpkinPaul commented 9 years ago

No, I've not tested using MonoGame yet - I tend to do all my Windows code in XNA and then only switch to MonoGame when porting to Mac / Linux.

I'd imagine the XNA side of things to be quite straightforward - I'm naively assuming just project creation here?

It's the #ifdef WINDOWS / WPF side of things I guess would need some work to incorporate the other platforms? Unless they were treated like an XBOX project without the external window support - so you get plots and debug boxes, etc but not the external editor windows.

PumpkinPaul commented 9 years ago

I pinged an email off to Xamarin regarding their cross platfrom GUI solution Xamarin.Forms - here's the reply...

Hi Paul,

Thanks for your enquiry regarding open source project licensing for Xamarin.

We absolutely do provide free licenses for open source projects. All we ask is that you apply at this link, and give us a little more information about your plans.

http://resources.xamarin.com/open-source-contributor.html

Could be something worth looking into?

PumpkinPaul commented 9 years ago

I'm about to port one of my games to Mac / Monogame from XNA. Any progress on this? Or do you want me to start looking at it?

juancampa commented 9 years ago

I haven't started working on this. If you want to work on it please do.

PumpkinPaul commented 9 years ago

Yup, I'll take a look.

PumpkinPaul commented 9 years ago

(My local) #Gearset is running in #MonoGame Windows DirectX :-) Small null reference bug in the Windows GL project regarding the OpenTK window handle that I will investigate tomorrow :-)

The big job is porting to OS X (bye bye WPF?)

juancampa commented 9 years ago

Do you know of a cross-platform framework that naturally supports MVVM? It would le greate to reuse the current viewmodels. Otherwise the migration will be rather painful

PumpkinPaul commented 9 years ago

I'm looking into this at the moment - I'm thinking rather painful is right :-) There's a few open source libraries that I'm going to try. Inspector is my main worry - the other forms could probably just be recreated simply enough.

I've hacked round the OpenGL issue using a dummy hidden form - not super ideal but gets it up and running. So it's working in a couple of MonoGame project types - I've created some sample games too testing out usage.

PumpkinPaul commented 9 years ago

Here's the first framework I'm looking at... http://emptykeys.com/

juancampa commented 9 years ago

whoa that's a sweet project.

PumpkinPaul commented 9 years ago

It looks like you can create multiple game windows in MonoGame (at least in DX currently) https://github.com/mono/MonoGame/pull/1465 Coupled with one of the MonoGame XAML style frameworks, it might be a solution

EmptyKeys commented 9 years ago

I was thinking about porting some part of Gearset for my use (UI debug feature). On the end I decided to use more direct approach. Anyway if you need any help with my UI lib, don't be shy to ask me. :)

juancampa commented 9 years ago

That's great to hear @EmptyKeys...

@PumpkinPaul it only seems to support multiple windows on Windows though

PumpkinPaul commented 9 years ago

Yeah, that's correct Juan. That PR is from 2013 too so it doesn't look like anyone is in a great hurry to port it to OpenGL.

I'm wondering what sort of user experience we'd get from having no external windows. Render all UI on the main game window, like PLOTS / PROFILER. That would allow us to use the same approach for all the platforms but could possibly get horrendously busy unless we got smart with tabs / panels / views or whatever.

I want to get a minimal solution on Windows without references to XAML which I can then port to OS X. Once I've done that I can really begin to think how to progress with the UI changes.

PumpkinPaul commented 9 years ago

Hi @EmptyKeys - you certainly have what looks like a nice UI framework there. I struggled initially to get it running as none of my machines had the correct profiles on but a spare VS2015 VM at work proved successful. I'm currently using it to mock up one of the easier Gearset windows to see how much pain is involved (my current problem is the generator not being able to find a resource in my new ui even though the same image works on basciUI - but I'll attack that again tomorrow with a clearer head)

I've a slight concern about introducing a dependency on a closed source framework however.

PumpkinPaul commented 9 years ago

I've had some success today recreating the Profiler.xaml in EasyKeys.

Gearset EmptyKeys

I've got some styling done and the data binding works. I now need to hookup some UI events so I can respond to clicks and such. Luckily the UI_Generator is open source as I had to hack it a little to get some of the resources working the same as Gearset...

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    <BitmapImage x:Key="icon_close" UriSource="Common/icon_close.png" />
    <!-- The Color type required a hack -->
    <Color x:Key="highlightColor">#8ac631</Color>

This required a 'null' IGeneratorValue for System.Windows.Media.Color to stop the "#error This type is not supported" message.

Current status: slightly optimistic :-)

EmptyKeys commented 9 years ago

Cool. I added support for Color type in resource dictionary (sources on github).

Looking at Gearset XAML sources I can see some unsupported stuff tho. TreeView for example ... I'm working on first version, so hopefully next release.

Yes, library is closed, but as you found out UI Generator is open source. That gives you way to create your own UI controls, but if you find something really important, you can always post on my backlog thread - http://emptykeys.com/Community/aft/12

PumpkinPaul commented 9 years ago

Logging stubbed in now too...

Gearset Logging

PumpkinPaul commented 9 years ago

@EmptyKeys is it possible to override the default control styles in XAML (without specifying a key)?

e.g. [Style BasedOn="{StaticResource {x:Type Button}}" TargetType="Button"] [Setter Property="Background" Value="DarkMagenta"/] [/Style]

Setting an x:Key works but if I don't set a key I get the following SharpDX exception... HRESULT: [0x80070057], Module: [General], ApiCode: [E_INVALIDARG/Invalid Arguments], Message: The parameter is incorrect.

I didn't want to have to set the Style property of every button.

Stack Trace... at SharpDX.Result.CheckError() at SharpDX.Direct3D11.Device.CreateTexture2D(Texture2DDescription& descRef, DataBox[] initialDataRef, Texture2D texture2DOut) at SharpDX.Direct3D11.Texture2D..ctor(Device device, Texture2DDescription description) at Microsoft.Xna.Framework.Graphics.Texture2D.CreateTexture() at Microsoft.Xna.Framework.Graphics.Texture.GetTexture() at Microsoft.Xna.Framework.Graphics.Texture2D.PlatformConstruct(Int32 width, Int32 height, Boolean mipmap, SurfaceFormat format, SurfaceType type, Boolean shared) at Microsoft.Xna.Framework.Graphics.Texture2D..ctor(GraphicsDevice graphicsDevice, Int32 width, Int32 height, Boolean mipmap, SurfaceFormat format, SurfaceType type, Boolean shared, Int32 arraySize) at Microsoft.Xna.Framework.Graphics.Texture2D..ctor(GraphicsDevice graphicsDevice, Int32 width, Int32 height, Boolean mipmap, SurfaceFormat format) at EmptyKeys.UserInterface.Renderers.MonoGameRenderer.CreateTexture(Int32 width, Int32 height, Boolean mipmap, Boolean dynamic) at EmptyKeys.UserInterface.Media.SolidColorBrush.CreateTexture(Size 0071E/, Thickness 0071F/, Boolean 00720/) at EmptyKeys.UserInterface.Media.Brush.CreateVisual(Brush 004E8/, Size 004E9/, Thickness 004EA/, Boolean 004EB_/) at EmptyKeys.UserInterface.Controls.Border./_Ĉ() at EmptyKeys.UserInterface.Controls.Border.OnDraw(Renderer spriterenderer, Double elapsedGameTime, Single opacity) at EmptyKeys.UserInterface.UIElement.Draw(Renderer spriterenderer, Double elapsedGameTime, Single opacity) at EmptyKeys.UserInterface.Controls.Panel.OnDraw(Renderer spriterenderer, Double elapsedGameTime, Single opacity) at EmptyKeys.UserInterface.UIElement.Draw(Renderer spriterenderer, Double elapsedGameTime, Single opacity) at EmptyKeys.UserInterface.Controls.Panel.OnDraw(Renderer spriterenderer, Double elapsedGameTime, Single opacity) at EmptyKeys.UserInterface.UIElement.Draw(Renderer spriterenderer, Double elapsedGameTime, Single opacity) at EmptyKeys.UserInterface.Controls.ContentPresenter.OnDraw(Renderer spriterenderer, Double elapsedGameTime, Single opacity) at EmptyKeys.UserInterface.UIElement.Draw(Renderer spriterenderer, Double elapsedGameTime, Single opacity) at EmptyKeys.UserInterface.Controls.Border.OnDraw(Renderer spriterenderer, Double elapsedGameTime, Single opacity) at EmptyKeys.UserInterface.UIElement.Draw(Renderer spriterenderer, Double elapsedGameTime, Single opacity) at EmptyKeys.UserInterface.Controls.Panel.OnDraw(Renderer spriterenderer, Double elapsedGameTime, Single opacity) at EmptyKeys.UserInterface.UIElement.Draw(Renderer spriterenderer, Double elapsedGameTime, Single opacity) at EmptyKeys.UserInterface.Controls.ItemsControl.OnDraw(Renderer spriterenderer, Double elapsedGameTime, Single opacity) at EmptyKeys.UserInterface.UIElement.Draw(Renderer spriterenderer, Double elapsedGameTime, Single opacity) at EmptyKeys.UserInterface.Controls.Panel.OnDraw(Renderer spriterenderer, Double elapsedGameTime, Single opacity) at EmptyKeys.UserInterface.UIElement.Draw(Renderer spriterenderer, Double elapsedGameTime, Single opacity) at EmptyKeys.UserInterface.Controls.Panel.OnDraw(Renderer spriterenderer, Double elapsedGameTime, Single opacity) at EmptyKeys.UserInterface.UIElement.Draw(Renderer spriterenderer, Double elapsedGameTime, Single opacity) at EmptyKeys.UserInterface.Controls.ContentPresenter.OnDraw(Renderer spriterenderer, Double elapsedGameTime, Single opacity) at EmptyKeys.UserInterface.UIElement.Draw(Renderer spriterenderer, Double elapsedGameTime, Single opacity) at EmptyKeys.UserInterface.Controls.Border.OnDraw(Renderer spriterenderer, Double elapsedGameTime, Single opacity) at EmptyKeys.UserInterface.UIElement.Draw(Renderer spriterenderer, Double elapsedGameTime, Single opacity) at EmptyKeys.UserInterface.Controls.Control.OnDraw(Renderer spriterenderer, Double elapsedGameTime, Single opacity) at EmptyKeys.UserInterface.UIElement.Draw(Renderer spriterenderer, Double elapsedGameTime, Single opacity) at EmptyKeys.UserInterface.Controls.Panel.OnDraw(Renderer spriterenderer, Double elapsedGameTime, Single opacity) at EmptyKeys.UserInterface.UIElement.Draw(Renderer spriterenderer, Double elapsedGameTime, Single opacity) at EmptyKeys.UserInterface.Controls.ContentPresenter.OnDraw(Renderer spriterenderer, Double elapsedGameTime, Single opacity) at EmptyKeys.UserInterface.UIElement.Draw(Renderer spriterenderer, Double elapsedGameTime, Single opacity) at EmptyKeys.UserInterface.Controls.Border.OnDraw(Renderer spriterenderer, Double elapsedGameTime, Single opacity) at EmptyKeys.UserInterface.UIElement.Draw(Renderer spriterenderer, Double elapsedGameTime, Single opacity) at EmptyKeys.UserInterface.Controls.Control.OnDraw(Renderer spriterenderer, Double elapsedGameTime, Single opacity) at EmptyKeys.UserInterface.UIElement.Draw(Renderer spriterenderer, Double elapsedGameTime, Single opacity) at EmptyKeys.UserInterface.Controls.UIRoot.Draw(Double elapsedGameTime) at BasicUI_MonoGame_Win_Desktop.Game1.Draw(GameTime gameTime) in c:\Users\paul.cunningham\Downloads\UI_Examples-1.6.5.0\UI_Examples-1.6.5.0\BasicUI_MonoGame\BasicUI_MonoGame_Win_Desktop\Game1.cs:line 149 at Microsoft.Xna.Framework.Game.DoDraw(GameTime gameTime) at Microsoft.Xna.Framework.Game.Tick() at MonoGame.Framework.WinFormsGameWindow.RunLoop() at MonoGame.Framework.WinFormsGamePlatform.RunLoop() at Microsoft.Xna.Framework.Game.Run(GameRunBehavior runBehavior) at Microsoft.Xna.Framework.Game.Run() at BasicUI_MonoGame_Win_Desktop.Program.Main() in c:\Users\paul.cunningham\Downloads\UI_Examples-1.6.5.0\UI_Examples-1.6.5.0\BasicUI_MonoGame\BasicUI_MonoGame_Win_Desktop\Program.cs:line 22 at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args) at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart()

EmptyKeys commented 9 years ago

No, that's a bug. Fix in next release planed for next Monday.

PumpkinPaul commented 9 years ago

Ok, thanks for that.

Been working on Finder - uses a DataGrid for rendering. Not sure if key_press style events are supported yet so just blagged a button on there temporarily.

Finder Window

Looking forward to trying the new version :-) Is TreeView in there and custom Data Grid columns? Think I read that you'd been working on both.

I'm still not sure how I will show the individual windows - did I read you were planning some sort of positional windowing system? That might help.

I'm thinking of offering a number of solutions: External WPF, External EmptyKeys (DX only for now), Internal EmptyKeys, No UI (plots. profiler). Lots more work though!

EmptyKeys commented 9 years ago

You can do

<TextBox Name="searchInput" Text="{Binding Path=SearchText}">
    <TextBox.InputBindings>
       <KeyBinding Key="Enter" Command="{Binding SearchCommand}" />
    </TextBox.InputBindings>
</TextBox>

TreeView and custom Data Grid columns are done and ready for next release.

Window system is already implemented (next version will have window resize feature). You can use WindowViewModel, check this thread - http://emptykeys.com/Community/aft/33

PumpkinPaul commented 9 years ago

Nice one!

PS - I just needed to add window.IsVisible = true; and then the creator is called and bingo WINDOWS! :-)

PumpkinPaul commented 9 years ago

Some styling issues but...

Finder Window

juancampa commented 9 years ago

This is looking great! Nicely done @PumpkinPaul

PumpkinPaul commented 9 years ago

Cheers :-)

All this is in a separate demo application at the moment and running on Windows. The real proof is when I try to integrate it back into Gearset and run on the Mac.

PumpkinPaul commented 9 years ago

Added a master opacity setting for all debug windows.

Finder Window

Feel like it's starting to come together now.

I'll have a look at Bender next - I won't be too disappointed if I can't get that in as is as I feel that's the least useful of the tools. I am keen to have a go at Inspector when the next version of EmptyKeys is available - I'm predicting quite a battle there :-)

PumpkinPaul commented 9 years ago

Hacked the binaries from my test EmptyKeys project into my minimal Gearset solution.

Gearset and EmptyKeys

Next I need to add the source UI and content files and merge the view models. Then remove all surplus references and code and hopefully make the choice of UI configurable.

I'll keep spamming progress to this issue :-)

EmptyKeys commented 9 years ago

Looks good. Looking at Inspector XAML, maybe it will not be that hard. I implemented TreeView bit more MVVM way, so you don't need those crazy HierarchicalDataTemplate. :)

PumpkinPaul commented 9 years ago

EmptyKeys user interface / UI project files now added to Gearset. This is all happening in this branch by the way... https://github.com/PumpkinPaul/Gearset/tree/MonoGame

I now need to figure out how to best structure the calls into the two different UIs and consolidate the different view models without having #if scattered throughout the projects.

e.g.

public class LoggerWindowViewModel : WindowViewModel { public class StreamItem : BindableBase {

vs

public class LoggerManager : Gear { } public class StreamItem : IComparable<StreamItem>, INotifyPropertyChanged { }

Current thinking is to split the UI into separate projects (WPF and EmptyKeys) and add implementations for BindableBase / WindowViewModel where they are missing.

PumpkinPaul commented 9 years ago

So I've begun to split off the WPF and EmptyKeys views and models. I'm not happy with how it's structured presently but I'm making progress extracting the UI from Gearset itself.

Here a screenshot showing current Gearset UI (green highlight) and the views I've moved into the new project (blue highlight); Profiler, Logger and Widget done so far.

Gearset old and new UI

There's a new version of EmptyKeys available now so when I'm feeling brave I'll have a go at InspectorWPF

juancampa commented 9 years ago

Looking awesome, this is very impressive!

PumpkinPaul commented 9 years ago

Cheers :-)

Just experimenting with a Visual Studio dark theme style.

Gearset dark styleI

juancampa commented 9 years ago

Looks good, if you wanna keep it like that I'm cool with it. If Unity has a separate color scheme for Pro vs. Free why can't we have different color schemes for Open Source vs. Proprietary :)

PumpkinPaul commented 9 years ago

I think all of the WPF files have now been moved into the Gearset WPF area and removed from the 'minimal' project that will form the basis for the ports to other MonoGame platforms. I already have the proof of concept EmptyKeys UI in that project so it will now be a case of fleshing out the missing windows and making it a bit more user friendly.

Then the last thing I have to do is get content building and referenced for each of the platforms :-)

It's been a tough old task but I believe I've broken the back of it now. Proof will be running it on my Mac.

PumpkinPaul commented 9 years ago

@EmptyKeys Struggling to style the UI windows! Help :-)

This nearly works - but the triggers don't do anything and the Content doesn't accept mouse events. I constructed this by hand looking at the C# in Reflector

<Style BasedOn="{StaticResource {x:Type Window}}" TargetType="{x:Type Window}">
        <Setter Property="Background" Value="{DynamicResource WindowBackgroundBrush}"></Setter>
        <Setter Property="Foreground" Value="{DynamicResource WindowTextColor}"></Setter>
        <Setter Property="SnapsToDevicePixels" Value="true"></Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Window">
                    <!-- border -->
                    <Border BorderThickness="2" BorderBrush="{DynamicResource WindowBorderBrush}" Background="{DynamicResource WindowBackgroundBrush}">
                        <!-- grid -->
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" />
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                            </Grid.RowDefinitions>

                            <!-- border2 -->
                            <Border Grid.Row="0" Name="PART_WindowTitleBorder" Background="{DynamicResource WindowBorderBrush}">
                                <!-- contentPresenter -->
                                <ContentPresenter SnapsToDevicePixels="True" Content="{TemplateBinding Title}" IsHitTestVisible="true" Name="PART_WindowTitle" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="1">
                                </ContentPresenter>
                                <!--<TextBlock Text="{Binding Title}" IsHitTestVisible="False" Name="PART_WindowTitle" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="1"></TextBlock>-->
                            </Border>
                            <ScrollViewer Grid.Row="1" Margin="4" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Disabled">
                                <ContentPresenter SnapsToDevicePixels="True" Width="{TemplateBinding Width}" Height="{TemplateBinding Height}" Content="{TemplateBinding Content}" IsHitTestVisible="False" Name="PART_WindowContent" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="1">

                                </ContentPresenter>
                            </ScrollViewer>
                            <!-- border3 -->
                            <Border Grid.Row="2" Name="PART_WindowResizeBorder" Background="{DynamicResource WindowResizeThumb}" HorizontalAlignment="Right" Width="8" Height="8">
                            </Border>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
PumpkinPaul commented 9 years ago

@EmptyKeys

I also tried firing up Reflector and blagging the WindowStyle class

_loggerWindow.Style = WindowStyle.CreateWindowStyle();

but the delegate never gets called to create the template. So I assume I get the default. Does it need an ApplyTemplate() somewhere?

Note: _loggerWindow is a UserControl and I set up the window...

var loggerTemplate = new DataTemplate(typeof(LoggerWindowViewModel), parent =>
{
    _loggerWindow.Parent = parent;
    return _loggerWindow;
});
_gearsetUI.Resources.Add(loggerTemplate.DataTemplateKey, loggerTemplate);
EmptyKeys commented 9 years ago

Window itself is created in UIRoot, so it's bit tricky. I had to make some proprietary solution, because WPF doesn't have anything like this. You could override whole Style, but there is much easier way. Create just Control Template in XAML resource dictionary

`

`

DataTemplate for your WindowViewModel for example

<DataTemplate DataType="{x:Type ui:PlanetToolTipViewModel}"> ... something here ... </DataTemplate>

WindowViewModel class has 2nd contructor so you can do

public PlanetToolTipViewModel(HudViewModel hud, Planet planet) : base("ToolTip_WindowTemplate") { }

This will use that custom Control Template for final window. Good to know that you will not have some features if you don't include 'PART_WindowTitleBorder' element (moving window) and 'PART_WindowResizeBorder' element (resizing window).

I use this feature for ingame ToolTips and it's bit of workaround so it's SUPER fast.

EmptyKeys commented 9 years ago

BTW IsHitTestVisible="False" means that element will not get any mouse hit.

PumpkinPaul commented 9 years ago

Arrrgghh, so frustrating! Can't get it working - I either get Title or Content - never both. Haven't managed to get the DataTemplate working so bunged the controls in the ControlTemplate. SADFACE

EmptyKeys commented 9 years ago

OK I will make you simple example tomorrow :)

PumpkinPaul commented 9 years ago

BINGO! I've manged to do it in code! I just replaced the typeof(Window) style in the Resource Dictionary and the delegate gets called now.

I'd still be interested in a XAML solution (if you have time)

EmptyKeys commented 9 years ago

there you go :) https://github.com/EmptyKeys/UI_Examples/commit/21fc73b5e88699742d35329436f734ea803bafbb

PumpkinPaul commented 9 years ago

Cheers for that example - I still wasn't able to get it to work using the XAML approach - the code method works though so I'll stick with that for now.

Inspector now 'extracted' from 'core' Gearset so now I can go ahead and attempt to implement an EmptyKeys version

*while doing this I broke WPF Inspector and it took me all day to figure out what the problem was :-)

PumpkinPaul commented 9 years ago

@EmptyKeys What is the correct method to get/set window dimensions? I want to save the locations and dimensions in update so that I can reapply next time the game is run. Setting in WindowViewModel on init and then reading from there makes the windows smaller each time I run. Might be related to margin / padding / header height discrepancies

EmptyKeys commented 9 years ago

just Width/Height ... those are not related to Padding/Margin and UI change them only if you resize window or when window is outside Viewport

For example i use this in constructor Top = 100; Left = 300; Height = 600; Width = 550; MinWidth = 370; MinHeight = 480;

PumpkinPaul commented 9 years ago

I'm checking the WindowViewModel.Height property in Update and it doesn't change when I resize the window :-(