canton7 / Stylet

A very lightweight but powerful ViewModel-First MVVM framework for WPF for .NET Framework and .NET Core, inspired by Caliburn.Micro.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

when TabControl and Frame are used,viewmodel do not carry out

kaisame opened this issue · comments

<TabControl> <TabItem Header="OnePage"> <Frame Source="/StyletStudy;component/Pages/Test1View.xaml" /> </TabItem> <TabItem Header="TwoPage"> <Frame NavigationUIVisibility="Hidden" Source="/StyletStudy;component/Pages/Test2View.xaml" /> </TabItem> </TabControl>

frame switch to Test1View page,but Test1ViewModel do not carry out.

Program tips:
View.ActionTarget not set on control System.Windows.Controls.Button (method ShowInfo). This probably means the control hasn't inherited it from a parent, e.g. because a ContextMenu or Popup sits in the visual tree. You will need so set 's:View.ActionTarget' explicitly. See the wiki section "Actions" for more details.”

Use conductors for navigation, not frames. See https://github.com/canton7/Stylet/wiki/Screens-and-Conductors