public MainPage()
{
InitializeComponent();
this.Loaded += new RoutedEventHandler(MainPage_Loaded);
}
void MainPage_Loaded(object sender, RoutedEventArgs e)
{
Verdienen v = new Verdienen(4, 3);
}
다음 : 공개 Verdienen (INT attesaInSecondiIniziale = 20, INT attesaInSecondiFinale = 8) { this.AttesaInSecondiIniziale = attesaInSecondiIniziale; this.AttesaInSecondiIniziale = attesaInSecondiFinale; MostraPerQuestaSezione = false;
popup = new Popup();
Border border = new Border();
border.Background = new SolidColorBrush(Colors.LightGray);
border.Margin = new Thickness(3);
StackPanel panelVerticale = new StackPanel();
panelVerticale.Orientation = Orientation.Vertical;
AdControl control = new AdControl();
panelVerticale.Children.Add(control);
StackPanel panelOrizzontale = new StackPanel();
panelOrizzontale.Orientation = Orientation.Horizontal;
Button bAltreApp = new Button();
bAltreApp.Content = "";
bAltreApp.Tap += new EventHandler<GestureEventArgs>(bAltreApp_Tap);
Button bVota = new Button();
bVota.Tap += new EventHandler<GestureEventArgs>(bVota_Tap);
bVota.Content = "";
panelOrizzontale.Children.Add(bAltreApp);
panelOrizzontale.Children.Add(bVota);
panelVerticale.Children.Add(panelOrizzontale);
border.Child = panelVerticale;
popup.Child = border;
this.ShowPopup();
}
private async **System.Threading.Tasks.TaskEx** ShowPopup()
{
do
{
Debug.WriteLine("thread iniziato. pausa cominciata");
await System.Threading.Tasks.TaskEx.Delay(1000 * this.AttesaInSecondiIniziale);
Debug.WriteLine("thread: fine pausa");
popup.IsOpen = true;
await System.Threading.Tasks.TaskEx.Delay(1000 * this.AttesaInSecondiFinale);
popup.IsOpen = false;
} while (MostraPerQuestaSezione);
}
이 코드에 팝업이 표시되지 않는 이유는 무엇입니까? 참고 : 일부 필수 코드가 없습니다! 편집 : System.Threading.Tasks.TaskEx이 오류 ("비동기 메서드의 반환 상태는 void, 작업 또는 작업이어야 함")로 표시되어 있습니다.
경우 ShowPopup의 코드 ? – zzfima
코드를 업그레이드했습니다. 제발, 또 한번 보자! – Spode