我正在尝试在页面中放置一个集线器,但似乎 Binding 无法正常运行。我使用了 Template10 Hamburger 示例并尝试在主页中放置一个集线器。在我测试时,我只是将现有的堆栈面板封装在集线器部分内,但它似乎破坏了按钮单击事件的绑定。
构建时出错:
你调用的对象是空的
<HubSection>
<DataTemplate>
<StackPanel Grid.Row="1" VerticalAlignment="Top" Orientation="Horizontal"
Padding="12,8,0,0">
<controls:Resizer>
<TextBox Width="200" MinWidth="200" MinHeight="60"
Margin="0" Header="Parameter to pass"
Text="{Binding Value, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
TextWrapping="Wrap">
<Interactivity:Interaction.Behaviors>
<Behaviors:TextBoxEnterKeyBehavior>
<Core:CallMethodAction MethodName="GotoDetailsPage" TargetObject="{Binding}" />
</Behaviors:TextBoxEnterKeyBehavior>
<Core:EventTriggerBehavior>
<Behaviors:FocusAction />
</Core:EventTriggerBehavior>
</Interactivity:Interaction.Behaviors>
</TextBox>
</controls:Resizer>
<Button Margin="12,0" VerticalAlignment="Bottom"
Click="{x:Bind ViewModel.GotoDetailsPage}" Content="Submit" />
</StackPanel>
</DataTemplate>
</HubSection>