mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 03:48:56 +00:00
Router - Added reload
Workshop - Added image management to existing entries Workshop - Fixed pagination in layouts page
This commit is contained in:
1 parent
19082481c3
commit
78b96deeab
25 files changed
+328
-100
No files matched your search
@@ -7,16 +7,17 @@
|
||||
x:Class="Artemis.UI.Screens.Debugger.Routing.RoutingDebugView"
|
||||
x:DataType="routing:RoutingDebugViewModel">
|
||||
|
||||
<Grid RowDefinitions="Auto,Auto,*" ColumnDefinitions="*,Auto">
|
||||
<Grid RowDefinitions="Auto,Auto,*" ColumnDefinitions="*,Auto,Auto">
|
||||
<TextBox Grid.Row="0" Grid.Column="0" Watermark="Enter a route to navigate to" Text="{CompiledBinding Route}">
|
||||
<TextBox.KeyBindings>
|
||||
<KeyBinding Gesture="Enter" Command="{CompiledBinding Navigate}"></KeyBinding>
|
||||
</TextBox.KeyBindings>
|
||||
</TextBox>
|
||||
<Button Grid.Row="0" Grid.Column="1" Margin="5 0 0 0" Command="{CompiledBinding Navigate}">Navigate</Button>
|
||||
<Button Grid.Row="0" Grid.Column="1" Margin="5 0 0 0" Command="{CompiledBinding Reload}">Reload</Button>
|
||||
<Button Grid.Row="0" Grid.Column="2" Margin="5 0 0 0" Command="{CompiledBinding Navigate}">Navigate</Button>
|
||||
|
||||
<TextBlock Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 15">Navigation logs</TextBlock>
|
||||
<ScrollViewer Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" Name="LogsScrollViewer" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto">
|
||||
<TextBlock Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="3" Margin="0 15">Navigation logs</TextBlock>
|
||||
<ScrollViewer Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="3" Name="LogsScrollViewer" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto">
|
||||
<SelectableTextBlock
|
||||
Inlines="{CompiledBinding Lines}"
|
||||
FontFamily="{StaticResource RobotoMono}"
|
||||
|
||||
@@ -29,6 +29,7 @@ public partial class RoutingDebugViewModel : ActivatableViewModelBase
|
||||
{
|
||||
_router = router;
|
||||
DisplayName = "Routing";
|
||||
Reload = ReactiveCommand.CreateFromTask(ExecutReload);
|
||||
Navigate = ReactiveCommand.CreateFromTask(ExecuteNavigate, this.WhenAnyValue(vm => vm.Route).Select(r => !string.IsNullOrWhiteSpace(r)));
|
||||
|
||||
_formatter = new MessageTemplateTextFormatter(
|
||||
@@ -48,6 +49,7 @@ public partial class RoutingDebugViewModel : ActivatableViewModelBase
|
||||
}
|
||||
|
||||
public InlineCollection Lines { get; } = new();
|
||||
public ReactiveCommand<Unit, Unit> Reload { get; }
|
||||
public ReactiveCommand<Unit, Unit> Navigate { get; }
|
||||
|
||||
private void OnLogEventAdded(object? sender, LogEventEventArgs e)
|
||||
@@ -87,6 +89,18 @@ public partial class RoutingDebugViewModel : ActivatableViewModelBase
|
||||
if (Lines.Count > MAX_ENTRIES)
|
||||
Lines.RemoveRange(0, Lines.Count - MAX_ENTRIES);
|
||||
}
|
||||
|
||||
private async Task ExecutReload(CancellationToken arg)
|
||||
{
|
||||
try
|
||||
{
|
||||
await _router.Reload();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
}
|
||||
|
||||
private async Task ExecuteNavigate(CancellationToken arg)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user