Stylet.StyletInvalidViewTypeException
See original GitHub issueHello. I get this exception says that View doesn’t derive from the Window class. But I call .ShowDialog from Conductor<IScreen>.Collection.OneActive derives from Window. Window’s ViewModel:
public class MainViewModel : Conductor<IScreen>.Collection.OneActive
{
private ErrorBoxViewModel errorBox;
private readonly IWindowManager windowManager;
public MainViewModel(IWindowManager windowManager)
{
this.windowManager = windowManager;
}
public void ShowError(string message)
{
if (errorBox != null)
errorBox.RequestClose();
errorBox = new ErrorBoxViewModel(message);
this.windowManager.ShowDialog(errorBox);
}
}
In another view model derives from UserControl I call:
(Conductor as MainViewModel).ShowError("some string");
ErrorBoxViewModel view model derives from UserControl as well:
public class ErrorBoxViewModel : Screen
{
public string Message { get; private set; }
public ErrorBoxViewModel(string message)
{
this.Message = message;
}
protected override void OnActivate()
{
base.OnActivate();
}
protected override void OnDeactivate()
{
base.OnDeactivate();
}
public void CloseWithSuccess()
{
this.RequestClose(true);
}
}
Any Idea what’s wrong?
Issue Analytics
- State:
- Created 7 years ago
- Comments:12 (7 by maintainers)
Top Results From Across the Web
ViewManager.cs - canton7/Stylet
A very lightweight but powerful ViewModel-First MVVM framework for WPF for .NET Framework and .NET Core, inspired by Caliburn.Micro.
Read more >RecyclerView Adapter is repeating values at wrong places
I am displaying 17 CardViews. I am using RecyclerView to achieve the same. Each CardView shows a common data (format). Depending on data ......
Read more >Give an explicit error message when unsupported view type used
JenkinsJobsException : Unrecognized view type: list-view (supported types are: list, pipeline) Change-Id: ... tests/xml_config/exceptions/invalid_view.yaml.
Read more >SubtitleView.ViewType
ShowBuffering · SubtitleView.ViewType. androidx.media3.ui.leanback ... Invalid · PagingSource.LoadResult. ... androidx.wear.watchface.style.
Read more >InvalidTemplateStructureException Class | Documents for ...
The exception that is thrown when a data template structure is invalid. Object Model. Syntax. Visual Basic; C#.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
So not as a Window at all?
You’ll want to put both the TabControl and the overlay in the same Grid, so that the overlay is placed on top of the TabControl. Something like this (untested, might have errors):
Cool!