2013-09-27 25 views
0

我正在開發一個windows phone 8應用程序,我需要禁用webservice加載時的背景按鈕。 是否有任何能夠禁用使用C#在Windows Phone 8中的背景按鈕?禁用windows phone 8中的背景按鈕c#

+0

顯示你的工作.. –

+0

可能重複的[Windows Phone:如何禁用按鈕背景時按下編程?](http://stackoverflow.com/questions/17965926/windows-phone-how-to-disable- button-background-when-is-press-programmatically) –

+0

這不是我想要的。我的意思是讓應用程序進入後臺的開始菜單(我如何禁用它) – Roy

回答

0

將此LoadCompleted="htmlLoadCompleted"放入您的Web服務中。並像我的下面的代碼創建按鈕。

<Button x:Name="CoverImage" Content="Loading..." Opacity="0.5" /> 

C#代碼:

private void htmlLoadCompleted(object sender, NavigationEventArgs e) 
{ 
    this.CoverImage.Visibility = Visibility.Collapsed; 
} 
0

您可以通過Web服務調用增加透明度完成1.0可見後該按鈕的不透明度降低到0.0 &禁用按鈕。

如果您希望該用戶無法與屏幕進行交互,那麼最好使用coding4fun工具包的進度疊加。

在上次網格結束之前,只需在XAML文件中寫下代碼即可。

<Code4funToolkit:ProgressOverlay Name="progressOverlay" Visibility="Collapsed"> 
     <StackPanel> 
      <TextBlock HorizontalAlignment="Center" x:Name="txtprogressbar" Text="Loading functionality" FontSize="20" FontWeight="Bold" TextAlignment="Left" TextWrapping="Wrap" ></TextBlock> 
      <ProgressBar HorizontalAlignment="Left" FlowDirection="LeftToRight" IsIndeterminate="True" Visibility="Visible" Foreground="White" Height="15" x:Name="standardProgressBar" Width="464" /> 
     </StackPanel> 
    </Code4funToolkit:ProgressOverlay> 

當你想限制用戶交互只寫下面的代碼。

progressOverlay.Show(); 

要禁用覆蓋寫入

progressOverlay.Hide(); 

建議: - coding4fun工具的進步覆蓋是比較可行的選項,當你正在處理Web服務&其響應。