状态栏右下角显示图像像素坐标和灰度
This commit is contained in:
@@ -17,13 +17,19 @@ namespace XplorePlane.Views
|
||||
{
|
||||
private MainViewModel _mainVm;
|
||||
|
||||
private void SetStatus(string msg)
|
||||
private MainViewModel GetMainVm()
|
||||
{
|
||||
if (_mainVm == null)
|
||||
{
|
||||
try { _mainVm = ContainerLocator.Current?.Resolve<MainViewModel>(); } catch { }
|
||||
}
|
||||
if (_mainVm != null) _mainVm.StatusMessage = msg;
|
||||
return _mainVm;
|
||||
}
|
||||
|
||||
private void SetStatus(string msg)
|
||||
{
|
||||
var vm = GetMainVm();
|
||||
if (vm != null) vm.StatusMessage = msg;
|
||||
}
|
||||
|
||||
public ViewportPanelView()
|
||||
@@ -113,6 +119,15 @@ namespace XplorePlane.Views
|
||||
}, Prism.Events.ThreadOption.UIThread);
|
||||
}
|
||||
catch { }
|
||||
|
||||
// 光标信息:从 RoiCanvas.CursorInfo 同步到 MainViewModel
|
||||
var cursorInfoDesc = System.ComponentModel.DependencyPropertyDescriptor.FromProperty(
|
||||
PolygonRoiCanvas.CursorInfoProperty, typeof(PolygonRoiCanvas));
|
||||
cursorInfoDesc?.AddValueChanged(RoiCanvas, (s, e) =>
|
||||
{
|
||||
var vm = GetMainVm();
|
||||
if (vm != null) vm.CursorInfoText = RoiCanvas.CursorInfo;
|
||||
});
|
||||
}
|
||||
|
||||
private void OnDataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
|
||||
|
||||
Reference in New Issue
Block a user