For example I'm using this technique:
XAML
<Button x:Name="playButton" Content="Play with rabbit" With="20" Height="20"/>
MainPage.xaml.cs
public Button _PlayButton
{
get { return playButton; }
}
PlayerControl.cs
//received instance of MainPage class to "_mainPage"
public Button Play
{
_mainPage._PlayButton.Content = "Who care about this text?";
//play logic
}
I'm looking for the best practice. Where I can read deeply about this scope?
There's no best practice. It all depends on your requirements. Approaches I've used in various places for similar tasks:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.