我试图让一个方法在视图完成加载后运行。我试图将命令绑定到Loaded
视图中的事件,但它无法运行。抛出的内部异常是
'在 'System.Windows.Data.Binding' 上提供值引发了异常。' 行号“14”和行位置“14”
<UserControl x:Class="Components.Map.MapView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:map="clr-namespace:Components.Map"
xmlns:controls="clr-namespace:Windows.Controls;assembly=Windows.Controls"
xmlns:ValidationRules="clr-namespace:Windows.Controls.ValidationRules;assembly=Windows.Controls"
xmlns:directGraphicsControl="clr-namespace:Windows.DirectGraphicsControl;assembly=Windows.DirectGraphicsControl"
xmlns:colorBar="clr-namespace:Components.Common.ColorBar;assembly=Components.Common"
xmlns:RefinedRibbonControls="clr-namespace:Components.Common.Controls.RefinedRibbonControls;assembly=Components.Common"
xmlns:UserControls="clr-namespace:Components.Common.UserControls;assembly=Components.Common"
xmlns:map1="clr-namespace:Models.Map;assembly=Models.Map"
xmlns:utilities="clr-namespace:Windows.Utilities;assembly=Windows.Utilities"
xmlns:system="clr-namespace:System;assembly=mscorlib"
Loaded="{Binding Path=MapControlViewModel.MapLoadedCommand}">
如何绑定到视图的Loaded
事件,以便在视图完成加载后运行某些东西?