mirror of
https://github.com/Stone-Red-Code/Markdowser.git
synced 2026-09-04 09:06:15 +02:00
Add F11 fullscreen functionality
This commit is contained in:
@@ -29,6 +29,7 @@ public partial class MainWindowViewModel : ViewModelBase
|
||||
|
||||
private ContentViewModelBase content;
|
||||
private TabItem currentTab = null!;
|
||||
private WindowState windowState;
|
||||
private bool showSidePanel;
|
||||
private bool isBusy;
|
||||
private int progress;
|
||||
@@ -52,6 +53,12 @@ public partial class MainWindowViewModel : ViewModelBase
|
||||
}
|
||||
}
|
||||
|
||||
public WindowState WindowState
|
||||
{
|
||||
get => windowState;
|
||||
set => this.RaiseAndSetIfChanged(ref windowState, value);
|
||||
}
|
||||
|
||||
public ContentViewModelBase Content
|
||||
{
|
||||
get => content;
|
||||
@@ -143,6 +150,8 @@ public partial class MainWindowViewModel : ViewModelBase
|
||||
this.RaisePropertyChanged(nameof(CloseTabEnabled));
|
||||
});
|
||||
|
||||
public ICommand ToggleFullScreen => ReactiveCommand.Create(() => WindowState = WindowState == WindowState.FullScreen ? WindowState.Normal : WindowState.FullScreen);
|
||||
|
||||
private MarkdownContentViewModel DefaultContent => new("New Tab", new StringBuilder()
|
||||
.AppendLine($"}-Transparent.png)")
|
||||
.AppendLine()
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
x:DataType="vm:MainWindowViewModel"
|
||||
Icon="{Binding Icon}"
|
||||
Title="{Binding Title}"
|
||||
Loaded="Window_Loaded">
|
||||
Loaded="Window_Loaded" WindowState="{Binding WindowState}">
|
||||
|
||||
<Design.DataContext>
|
||||
<!-- This only sets the DataContext for the previewer in an IDE,
|
||||
@@ -32,6 +32,7 @@
|
||||
|
||||
<Window.KeyBindings>
|
||||
<KeyBinding Gesture="Ctrl+R" Command="{Binding Browse}" />
|
||||
<KeyBinding Gesture="F5" Command="{Binding Browse}" />
|
||||
<KeyBinding Gesture="Alt+Home" Command="{StaticResource HomeCommand}" />
|
||||
<KeyBinding Gesture="Alt+H" Command="{StaticResource HomeCommand}" />
|
||||
<KeyBinding Gesture="Alt+Left" Command="{Binding Back}" />
|
||||
@@ -39,6 +40,7 @@
|
||||
<KeyBinding Gesture="Ctrl+T" Command="{Binding NewTab}" />
|
||||
<KeyBinding Gesture="Ctrl+W" Command="{Binding CloseTab}" />
|
||||
<KeyBinding Gesture="Alt+S" Command="{Binding ToggleSidePanel}" />
|
||||
<KeyBinding Gesture="F11" Command="{Binding ToggleFullScreen}" />
|
||||
</Window.KeyBindings>
|
||||
|
||||
<Grid RowDefinitions="Auto, *, Auto">
|
||||
|
||||
Reference in New Issue
Block a user