|
|
@ -17,10 +17,14 @@ |
|
|
|
// DEALINGS IN THE SOFTWARE.
|
|
|
|
// DEALINGS IN THE SOFTWARE.
|
|
|
|
|
|
|
|
|
|
|
|
using System; |
|
|
|
using System; |
|
|
|
|
|
|
|
using System.Linq; |
|
|
|
using System.Threading.Tasks; |
|
|
|
using System.Threading.Tasks; |
|
|
|
|
|
|
|
using System.Windows; |
|
|
|
|
|
|
|
|
|
|
|
using ICSharpCode.ILSpy.TextView; |
|
|
|
using ICSharpCode.ILSpy.TextView; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
using TomsToolbox.Wpf; |
|
|
|
|
|
|
|
|
|
|
|
namespace ICSharpCode.ILSpy.ViewModels |
|
|
|
namespace ICSharpCode.ILSpy.ViewModels |
|
|
|
{ |
|
|
|
{ |
|
|
|
public class TabPageModel : PaneModel |
|
|
|
public class TabPageModel : PaneModel |
|
|
@ -96,6 +100,19 @@ namespace ICSharpCode.ILSpy.ViewModels |
|
|
|
tabPage.Title = Properties.Resources.Decompiling; |
|
|
|
tabPage.Title = Properties.Resources.Decompiling; |
|
|
|
action(textView); |
|
|
|
action(textView); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static void Focus(this TabPageModel tabPage) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (tabPage.Content is not FrameworkElement content) |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var focusable = content |
|
|
|
|
|
|
|
.VisualDescendantsAndSelf() |
|
|
|
|
|
|
|
.OfType<FrameworkElement>() |
|
|
|
|
|
|
|
.FirstOrDefault(item => item.Focusable); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
focusable?.Focus(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public interface IHaveState |
|
|
|
public interface IHaveState |
|
|
|