feat: add LargeMessageBoxControl and improve MessageBox functionality

This commit is contained in:
2026-01-22 16:48:21 +08:00
parent 975757dbb8
commit c0a9852f9e
5 changed files with 319 additions and 18 deletions

View File

@@ -133,15 +133,22 @@ public class Marquee : ContentControl
private void TimerOnTick(object? sender, System.EventArgs e)
{
if (Presenter is null) return;
var layoutValues = Dispatcher.UIThread.Invoke(GetLayoutValues);
var location = UpdateLocation(layoutValues);
if (location is null) return;
Dispatcher.UIThread.Post(() =>
try
{
Canvas.SetTop(Presenter, location.Value.top);
Canvas.SetLeft(Presenter, location.Value.left);
}, DispatcherPriority.Render);
if (Presenter is null) return;
var layoutValues = Dispatcher.UIThread.Invoke(GetLayoutValues);
var location = UpdateLocation(layoutValues);
if (location is null) return;
Dispatcher.UIThread.Post(() =>
{
Canvas.SetTop(Presenter, location.Value.top);
Canvas.SetLeft(Presenter, location.Value.left);
}, DispatcherPriority.Render);
}
catch (Exception exception)
{
// pass
}
}
private void InvalidatePresenterPosition()
@@ -277,4 +284,4 @@ struct LayoutValues
public Direction Direction { get; set; }
public HorizontalAlignment HorizontalAlignment { get; set; }
public VerticalAlignment VerticalAlignment { get; set; }
}
}