我想在数据库中插入或删除后刷新listView ..我搜索,我发现notifyDataSetChanged()但我不知道如何使用它..
有人可以解释一下如何做到这一点?即使以不同的方式......
我想将一个合理的文本放入文本块但是给我一个错误.为什么?我能解决吗?
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
<TextBlock Height="220"
HorizontalAlignment="Left"
Margin="102,174,0,0"
Name="textBlock1"
Text="TextBlock sdfg asfgbfgb adf ab afg g "
TextAlignment="Justify"
VerticalAlignment="Top"
Width="255" />
</Grid>
Run Code Online (Sandbox Code Playgroud) 我将xml文件从互联网下载到内存电话..我想查看是否可以通过互联网连接进行下载,如果没有则发送消息.如果不是,我想看看内存中是否已存在xml文件..如果存在,则应用程序不会进行下载.
问题是我不知道如何使"if"条件查看该文件是否存在.
我有这个代码:
public MainPage()
{
public MainPage()
{
if (NetworkInterface.GetIsNetworkAvailable())
{
InitializeComponent();
WebClient downloader = new WebClient();
Uri xmlUri = new Uri("http://dl.dropbox.com/u/32613258/file_xml.xml", UriKind.Absolute);
downloader.DownloadStringCompleted += new DownloadStringCompletedEventHandler(Downloaded);
downloader.DownloadStringAsync(xmlUri);
}
else
{
MessageBox.Show("The internet connection is not available");
}
}
void Downloaded(object sender, DownloadStringCompletedEventArgs e)
{
if (e.Result == null || e.Error != null)
{
MessageBox.Show("There was an error downloading the xml-file");
}
else
{
IsolatedStorageFile myIsolatedStorage = IsolatedStorageFile.GetUserStoreForApplication();
var stream = new IsolatedStorageFileStream("xml_file.xml", FileMode.Create, FileAccess.Write, myIsolatedStorage);
using (StreamWriter writeFile …Run Code Online (Sandbox Code Playgroud)