Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data-Bound Properties in Xeto Designer Design Mode/Preview #8

Open
RotsiserMho opened this issue Jun 10, 2018 · 3 comments
Open

Data-Bound Properties in Xeto Designer Design Mode/Preview #8

RotsiserMho opened this issue Jun 10, 2018 · 3 comments

Comments

@RotsiserMho
Copy link

Is it possible to preview data-bound controls with dummy data in the designer in Visual Studio for Mac? With WPF and Visual Studio for Windows I've used MVVM Light and ViewModelBase.IsInDesignModeStatic to set up dummy values for data-bound properties on my ViewModels that show up in the Visual Studio designer (and Blend). Is something similar possible with Eto? If not, what is the recommended way to preview data-bound UI to get a feel for layout, size, etc.

Thanks!

@cwensley
Copy link
Member

@RotsiserMho at this time it is not built-in, though you could possibly create an instance of your dummy view model via something like:

DataContext="{local:MyViewModel IsInDesignMode=True}"

public class MyViewModel
{
  public bool IsInDesignMode { get; set; }
  }
}

This would only work on VS 2017 for Windows, however as the VS for Mac addin cannot currently instantiate classes in the local project.

Hope this helps!

@RotsiserMho
Copy link
Author

Ah, got it. What's preventing the Mac addin from doing this? Has it simply not been implemented or does Visual Studio for Mac not support that kind of thing?

Thanks!

@cwensley
Copy link
Member

It doesn't work because Gtk# (in use by VS for Mac) doesn't support creating controls in an AppDomain, so each time you change your code it would have to load the changed assemblies into the main AppDomain, which would bloat VS for Mac's memory usage quite quickly.. Not sure what to do to get around that.. possibly spawn a separate (hidden) process, render the output, and capture it as an image perhaps..

@cwensley cwensley transferred this issue from picoe/Eto May 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants