33using OnnxStack . UI . Dialogs ;
44using OnnxStack . UI . Models ;
55using OnnxStack . UI . Services ;
6+ using OnnxStack . UI . Views ;
67using System ;
78using System . ComponentModel ;
89using System . IO ;
@@ -25,7 +26,6 @@ public partial class PaintInputControl : UserControl, INotifyPropertyChanged
2526 private int _brushSize ;
2627 private bool _isEraserEnabled ;
2728 public DateTime _canvasLastUpdate ;
28- private int _canvasUpdatedelay = 250 ;
2929 private DrawingAttributes _brushAttributes ;
3030 private Color _selectedColor = Colors . Black ;
3131 private Brush _backgroundBrush = new SolidColorBrush ( Colors . White ) ;
@@ -54,6 +54,16 @@ public PaintInputControl()
5454 public AsyncRelayCommand CopyImageCommand { get ; }
5555 public AsyncRelayCommand PasteImageCommand { get ; }
5656
57+
58+ public OnnxStackUIConfig UISettings
59+ {
60+ get { return ( OnnxStackUIConfig ) GetValue ( UISettingsProperty ) ; }
61+ set { SetValue ( UISettingsProperty , value ) ; }
62+ }
63+ public static readonly DependencyProperty UISettingsProperty =
64+ DependencyProperty . Register ( "UISettings" , typeof ( OnnxStackUIConfig ) , typeof ( PaintInputControl ) ) ;
65+
66+
5767 public ImageInput InputImage
5868 {
5969 get { return ( ImageInput ) GetValue ( InputImageProperty ) ; }
@@ -412,7 +422,7 @@ private async void PaintCanvas_PreviewMouseMove(object sender, MouseEventArgs e)
412422 {
413423 if ( DateTime . Now > _canvasLastUpdate )
414424 {
415- _canvasLastUpdate = DateTime . Now . AddMilliseconds ( _canvasUpdatedelay ) ;
425+ _canvasLastUpdate = DateTime . Now . AddMilliseconds ( UISettings . RealtimeRefreshRate ) ;
416426 await SaveCanvas ( ) ;
417427 }
418428 }
0 commit comments