删除MainViewModel 里的兼容占位属性

This commit is contained in:
zhengxuan.zhang
2026-05-16 14:00:06 +08:00
parent 0ccf9c529e
commit 09ac6db6ab
3 changed files with 30 additions and 15 deletions
@@ -173,6 +173,12 @@ namespace XplorePlane.ViewModels
public bool IsUsingLiveDetectorSource => _mainViewportService.CurrentSourceMode == MainViewportSourceMode.LiveDetector; public bool IsUsingLiveDetectorSource => _mainViewportService.CurrentSourceMode == MainViewportSourceMode.LiveDetector;
// Temporary compatibility properties to avoid startup binding errors before
// NavigationPropertyPanelView replaces the inherited DataContext with its own ViewModel.
public BitmapSource CameraImageSource => null;
public string CameraStatusText => string.Empty;
public string CameraPixelCoord => string.Empty;
public string DataRootPath public string DataRootPath
{ {
get => _dataRootPath; get => _dataRootPath;
+7 -10
View File
@@ -66,7 +66,7 @@
<telerik:RadRibbonGroup <telerik:RadRibbonGroup
telerik:ScreenTip.Title="Clipboard" telerik:ScreenTip.Title="Clipboard"
Header="文件" Header="文件"
IsEnabled="{Binding Path=ClipboardGroup.IsEnabled}"> >
<telerik:RadRibbonGroup.Variants> <telerik:RadRibbonGroup.Variants>
<telerik:GroupVariant Priority="0" Variant="Large" /> <telerik:GroupVariant Priority="0" Variant="Large" />
</telerik:RadRibbonGroup.Variants> </telerik:RadRibbonGroup.Variants>
@@ -390,7 +390,7 @@
</telerik:RadRibbonGroup> </telerik:RadRibbonGroup>
<telerik:RadRibbonGroup Header="高级模块" IsEnabled="{Binding Path=CellsGroup.IsEnabled}"> <telerik:RadRibbonGroup Header="高级模块">
<telerik:RadRibbonGroup.Variants> <telerik:RadRibbonGroup.Variants>
<telerik:GroupVariant Priority="0" Variant="Large" /> <telerik:GroupVariant Priority="0" Variant="Large" />
</telerik:RadRibbonGroup.Variants> </telerik:RadRibbonGroup.Variants>
@@ -415,24 +415,22 @@
</telerik:RadRibbonTab> </telerik:RadRibbonTab>
<telerik:RadRibbonTab Header="3D扫描"> <telerik:RadRibbonTab Header="3D扫描">
<telerik:RadRibbonGroup Header="扫描模式" IsEnabled="{Binding Path=LinksGroup.IsEnabled}"> <telerik:RadRibbonGroup Header="扫描模式">
<telerik:RadRibbonGroup.Variants> <telerik:RadRibbonGroup.Variants>
<telerik:GroupVariant Priority="0" Variant="Large" /> <telerik:GroupVariant Priority="0" Variant="Large" />
</telerik:RadRibbonGroup.Variants> </telerik:RadRibbonGroup.Variants>
<telerik:RadRibbonButton <telerik:RadRibbonButton
telerik:ScreenTip.Description="Create a link in your document for quick access to webpages and files.&#13;&#13;Hyperlinks can also take you to places in your document." telerik:ScreenTip.Description="Create a link in your document for quick access to webpages and files.&#13;&#13;Hyperlinks can also take you to places in your document."
telerik:ScreenTip.Title="Add a Hyperlink" telerik:ScreenTip.Title="Add a Hyperlink"
Command="{Binding Path=ShowHyperlinkDialog.Command}"
Content="快速扫描" Content="快速扫描"
IsEnabled="{Binding Path=ShowHyperlinkDialog.IsEnabled}" IsEnabled="False"
Size="Large" Size="Large"
SmallImage="/Assets/Icons/quick-scan.png" /> SmallImage="/Assets/Icons/quick-scan.png" />
<telerik:RadRibbonButton <telerik:RadRibbonButton
telerik:ScreenTip.Description="Create a link in your document for quick access to webpages and files.&#13;&#13;Hyperlinks can also take you to places in your document." telerik:ScreenTip.Description="Create a link in your document for quick access to webpages and files.&#13;&#13;Hyperlinks can also take you to places in your document."
telerik:ScreenTip.Title="Add a Hyperlink" telerik:ScreenTip.Title="Add a Hyperlink"
Command="{Binding Path=ShowHyperlinkDialog.Command}"
Content="螺旋扫描" Content="螺旋扫描"
IsEnabled="{Binding Path=ShowHyperlinkDialog.IsEnabled}" IsEnabled="False"
Size="Large" Size="Large"
SmallImage="/Assets/Icons/spiral.png" /> SmallImage="/Assets/Icons/spiral.png" />
</telerik:RadRibbonGroup> </telerik:RadRibbonGroup>
@@ -455,11 +453,10 @@
<telerik:RadRibbonGroup <telerik:RadRibbonGroup
telerik:ScreenTip.Description="Show the Alignment tab of the Format Cells dialog box." telerik:ScreenTip.Description="Show the Alignment tab of the Format Cells dialog box."
telerik:ScreenTip.Title="Format Cells: Alignment" telerik:ScreenTip.Title="Format Cells: Alignment"
DialogLauncherCommand="{Binding Path=ShowFormatCellsDialog.Command}"
DialogLauncherCommandParameter="Alignment" DialogLauncherCommandParameter="Alignment"
DialogLauncherVisibility="{Binding Path=ShowFormatCellsDialog.IsEnabled, Converter={StaticResource BoolToVisibilityValueConverter}}" DialogLauncherVisibility="Collapsed"
Header="硬件" Header="硬件"
IsEnabled="{Binding Path=AlignmentGroup.IsEnabled}"> IsEnabled="True">
<telerik:RadRibbonGroup.Variants> <telerik:RadRibbonGroup.Variants>
<telerik:GroupVariant Priority="0" Variant="Large" /> <telerik:GroupVariant Priority="0" Variant="Large" />
</telerik:RadRibbonGroup.Variants> </telerik:RadRibbonGroup.Variants>
@@ -13,20 +13,32 @@ namespace XplorePlane.Views
public NavigationPropertyPanelView() public NavigationPropertyPanelView()
{ {
InitializeComponent(); InitializeComponent();
ResolveViewModel();
Loaded += OnLoaded; Loaded += OnLoaded;
} }
private void OnLoaded(object sender, RoutedEventArgs e) private void OnLoaded(object sender, RoutedEventArgs e)
{ {
if (DataContext is NavigationPropertyPanelViewModel) return; ResolveViewModel();
}
private void ResolveViewModel()
{
if (DataContext is NavigationPropertyPanelViewModel viewModel)
{
_viewModel = viewModel;
return;
}
var bootstrapper = AppBootstrapper.Instance; var bootstrapper = AppBootstrapper.Instance;
if (bootstrapper != null) if (bootstrapper == null)
{ {
return;
}
_viewModel = bootstrapper.Container.Resolve<NavigationPropertyPanelViewModel>(); _viewModel = bootstrapper.Container.Resolve<NavigationPropertyPanelViewModel>();
DataContext = _viewModel; DataContext = _viewModel;
} }
}
/// <summary> /// <summary>
/// 双击相机图像时,计算并显示点击位置的像素坐标。 /// 双击相机图像时,计算并显示点击位置的像素坐标。