private void ListItemClicked(int position) { //this way we don't load twice, but you might want to modify this a bit. if (position == oldPosition) { return; } oldPosition = position; Android.Support.V4.App.Fragment fragment = null; switch (position) { case 0: fragment = DevHome.NewInstance(); break; case 1: fragment = LivePlay.NewInstance(); break; case 2: fragment = DeviceManager.NewInstance(); break; } SupportFragmentManager.BeginTransaction() .Replace(Resource.Id.content_frame, fragment) .Commit(); }
private async void OpenLivePlay_Click(object sender, RoutedEventArgs e) { var p = new LivePlay(); await p.Init(); p.Show(); LivePreviewOpen = true; }