canton7 / Stylet

A very lightweight but powerful ViewModel-First MVVM framework for WPF for .NET Framework and .NET Core, inspired by Caliburn.Micro.
MIT License
981 stars 143 forks source link

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

Closed kaisame closed 2 years ago

kaisame commented 3 years ago

`

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

`

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.”

canton7 commented 3 years ago

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