mirror of
https://github.com/libretro/MesenCE.git
synced 2026-11-10 03:02:05 -10:00
Also fixes DX11.0 support (for Win7 PCs that aren't fully updated), which stopped working after the recent variable refresh rate changes
56 lines
996 B
C#
56 lines
996 B
C#
using Dock.Controls.DeferredContentControl;
|
|
using Dock.Model.Mvvm.Controls;
|
|
using Mesen.Debugger.Utilities;
|
|
using System;
|
|
|
|
namespace Mesen.Debugger.ViewModels.DebuggerDock
|
|
{
|
|
public class BaseToolContainerViewModel : Tool, IDeferredContentPresentation
|
|
{
|
|
public virtual object? HelpContent { get; } = null;
|
|
|
|
public bool DeferContentPresentation => false;
|
|
|
|
public event EventHandler? Selected;
|
|
|
|
public override void OnSelected()
|
|
{
|
|
Selected?.Invoke(this, EventArgs.Empty);
|
|
}
|
|
}
|
|
|
|
public class ToolContainerViewModel<T> : BaseToolContainerViewModel
|
|
{
|
|
private T? _model;
|
|
|
|
public T? Model
|
|
{
|
|
get => _model;
|
|
set
|
|
{
|
|
_model = value;
|
|
OnPropertyChanged(nameof(Model));
|
|
}
|
|
}
|
|
|
|
public override object? HelpContent
|
|
{
|
|
get
|
|
{
|
|
if(Model is IToolHelpTooltip help) {
|
|
return help.HelpTooltip;
|
|
}
|
|
return null;
|
|
}
|
|
}
|
|
|
|
public ToolContainerViewModel(string name)
|
|
{
|
|
Id = name;
|
|
Title = name;
|
|
CanPin = false;
|
|
CanFloat = false;
|
|
}
|
|
}
|
|
}
|