C# 如何在windows phone 7应用程序中添加微调器
我的应用程序中有一个页面,其中的数据来自web服务。代码是:C# 如何在windows phone 7应用程序中添加微调器,c#,windows-phone-7,C#,Windows Phone 7,我的应用程序中有一个页面,其中的数据来自web服务。代码是: public about() { InitializeComponent(); KejriwalService.aapSoapClient myclient = new KejriwalService.aapSoapClient(); myclient.getarvindAboutCompleted += new EventHandler<KejriwalService.getarvindAboutCo
public about()
{
InitializeComponent();
KejriwalService.aapSoapClient myclient = new KejriwalService.aapSoapClient();
myclient.getarvindAboutCompleted += new EventHandler<KejriwalService.getarvindAboutCompletedEventArgs>(myclient_getarvindAboutCompleted);
myclient.getarvindAboutAsync();
}
void myclient_getarvindAboutCompleted(object sender, KejriwalService.getarvindAboutCompletedEventArgs e)
{
var data = e.Result;
XElement xml = XElement.Parse(data);
aboutview.Text = xml.Elements("UserDetails").Elements("about_details").First().Value;
}
public about()
{
初始化组件();
KejriwalService.aapSoapClient myclient=新的KejriwalService.aapSoapClient();
myclient.getarvindAboutCompleted+=新事件处理程序(myclient_getarvindAboutCompleted);
myclient.getarvindAboutAsync();
}
void myclient_getarvindAboutCompleted(对象发送方,KejriwalService.getarvindAboutCompletedEventArgs e)
{
var数据=e.结果;
XElement xml=XElement.Parse(数据);
aboutview.Text=xml.Elements(“UserDetails”).Elements(“about_details”).First().Value;
}
由于数据来自web,我想添加一个微调器,该微调器将一直运行到数据出现为止。任何人都可以帮助我如何做这个特殊的页面
我的xaml文件是:
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,12,12,0">
<Button Click="Image_Phone" BorderThickness="0" Margin="197,155,0,518" HorizontalAlignment="Left" Width="93">
<Button.Background>
<ImageBrush Stretch="Fill" ImageSource="Image/phone.png"/>
</Button.Background>
</Button>
<Button x:Name="Email" BorderThickness="0" Click="Image_Email" Margin="277,155,85,518">
<Button.Background>
<ImageBrush Stretch="Fill" ImageSource="Image/email.png"/>
</Button.Background>
</Button>
<Button x:Name="Home" BorderThickness="0" Click="Image_Home" Margin="0,155,-12,518" HorizontalAlignment="Right" Width="102">
<Button.Background>
<ImageBrush Stretch="Fill" ImageSource="Image/Home-icon.png"/>
</Button.Background>
</Button>
<Button x:Name="previous" BorderThickness="0" Click="Image_Back" Margin="0,0,354,673" HorizontalAlignment="Right" Width="102">
<Button.Background>
<ImageBrush Stretch="Fill" ImageSource="Image/Previous.png"/>
</Button.Background>
</Button>
<ScrollViewer Margin="0,256,0,6" HorizontalScrollBarVisibility="Visible" VerticalScrollBarVisibility="Auto" AllowDrop="False" ManipulationMode="Control">
<TextBlock HorizontalAlignment="Left" Name="aboutview" Text="" TextWrapping="Wrap" VerticalAlignment="Top" Width="439" FontSize="18" FontStyle="Normal" FontWeight="ExtraBlack" Foreground="Black"/>
</ScrollViewer>
<Image Height="172" HorizontalAlignment="Left" Margin="24,78,0,0" Name="image1" Source="Image/icon.png" Stretch="Fill" VerticalAlignment="Top" Width="155" />
<TextBlock Height="34" HorizontalAlignment="Left" Margin="196,78,0,0" Name="textBlock1" Text="Contact No:" VerticalAlignment="Top" Width="147" FontSize="24" Foreground="Black" FontWeight="Bold"/>
<TextBlock Height="36" HorizontalAlignment="Left" Margin="197,118,0,0" Name="textBlock2" Text="+91-9718500606" VerticalAlignment="Top" Width="191" FontSize="24" Foreground="Black" FontWeight="Bold" />
</Grid>
</Grid>
如果ProgressBar符合您的要求,我建议您使用ProgressBar(或WP工具包中的更好的PerformanceProgressBar)。您可以将此代码段添加到ContentPanel网格中的某个位置:
<ProgressBar Name="progressName"
IsIndeterminate="True"
Visibility="Collapsed"/>
您的代码应该如下所示:
public about()
{
InitializeComponent();
KejriwalService.aapSoapClient myclient = new KejriwalService.aapSoapClient();
myclient.getarvindAboutCompleted += new EventHandler<KejriwalService.getarvindAboutCompletedEventArgs>(myclient_getarvindAboutCompleted);
myclient.getarvindAboutAsync();
progressName.Visibility = System.Windows.Visibility.Visible;
}
void myclient_getarvindAboutCompleted(object sender, KejriwalService.getarvindAboutCompletedEventArgs e)
{
var data = e.Result;
XElement xml = XElement.Parse(data);
aboutview.Text = xml.Elements("UserDetails").Elements("about_details").First().Value;
progressName.Visibility = System.Windows.Visibility.Collapsed;
}
public about()
{
初始化组件();
KejriwalService.aapSoapClient myclient=新的KejriwalService.aapSoapClient();
myclient.getarvindAboutCompleted+=新事件处理程序(myclient_getarvindAboutCompleted);
myclient.getarvindAboutAsync();
progressName.Visibility=System.Windows.Visibility.Visible;
}
void myclient_getarvindAboutCompleted(对象发送方,KejriwalService.getarvindAboutCompletedEventArgs e)
{
var数据=e.结果;
XElement xml=XElement.Parse(数据);
aboutview.Text=xml.Elements(“UserDetails”).Elements(“about_details”).First().Value;
progressName.Visibility=System.Windows.Visibility.Collapsed;
}
订阅telerik rad controls。它带有一个忙指示器,只需要设置为可见。就这样