如何将Windows 8应用程序中的实时图块的背景图像更改为本地图像?我使用的模板的XML是:
<tile>
<visual>
<binding template="TileWideImageAndText01">
<image id="1" src="image1.png" alt="alt text"/>
<text id="1">Text Field 1</text>
</binding>
</visual>
</tile>
Run Code Online (Sandbox Code Playgroud)
对于文本,我使用
XmlDocument xmltile= Windows.UI.Notifications.TileUpdateManager.GetTemplateContent(Windows.UI.Notifications.TileTemplateType.TileWideImageAndText01);
xmltile.GetElementsByTagName("text")[0].AppendChild(xmltile.CreateTextNode("73°F, Mostly Cloudy"));
TileNotification tileupdate = new Windows.UI.Notifications.TileNotification(xmltile);
Windows.UI.Notifications.TileUpdateManager.CreateTileUpdaterForApplication().Update(tileupdate);
Run Code Online (Sandbox Code Playgroud)
但是图像怎么样?
我想添加一个类库,使用System.Windows.Forms命名空间到我的Windows 8应用程序.当我添加命名空间并构建解决方案时,我收到一个错误:
Cannot find type System.Resources.ResourceSet in module mscorlib.dll.
Run Code Online (Sandbox Code Playgroud)
是否可以添加System.Windows.Forms?
我有一个带有图像资源的WPF应用程序.当我构建程序时,bin文件夹中有一个名为"resources"的目录,其中包含我的图像.如果我在没有文件夹的情况下运行程序,它会崩溃.如何在应用程序中嵌入资源,以便它可以独立运行?
如何在Windows Phone 8上制作适用于IE10 Mobile的固定div?我目前使用的代码是:
<div style="position:fixed;width:100%;background-color:blue;">
test
</div>
Run Code Online (Sandbox Code Playgroud)
这只是部分有效.当用户滚动时,div滑回其原始位置.它在横向方向上根本不起作用.有没有其他方法可以使Internet Explorer 10移动设备上支持的固定div不移动?
我最近能够使用以下方法成功将Image的源设置为GIF图像:
image.Source = new BitmapImage(new Uri("http://imageurl/image.gif")
Run Code Online (Sandbox Code Playgroud)
我目前必须使用大量额外代码将GIF图像转换为PNG图像,因为Windows Phone 7不支持GIF图像.这是Windows Phone 8中新的官方支持功能吗?它真的支持GIF图像,还是我的体验出现了某种故障?(也许是一个真正采用PNG格式的GIF文件)我想知道因为我无法通过搜索找到这个功能,所有出现的都是WP7相关的内容.我认为这将是一个如此大的改进,它会被提到某个地方.
我如何更新Windows Phone应用程序中的UI,包括while,fore,for等循环?
我希望能够使用
element.style.opacity += 0.1;
Run Code Online (Sandbox Code Playgroud)
要么
element.style.opacity = element.style.opacity + 0.1;
Run Code Online (Sandbox Code Playgroud)
但这不起作用.不透明度不会改变.如果我将不透明度设置为静态值,例如
element.style.opacity = 0.5;
Run Code Online (Sandbox Code Playgroud)
它确实有效.我究竟做错了什么?
我想在Windows Phone应用程序中非异步下载数据.我会创建一个下载程序类,并在其中有一个简单的方法从URL下载字符串.在其他平台上,我会使用:
public class TextDownloader
{
public string GetString(string url)
{
WebClient web = new WebClient();
string s = web.DownloadString("http://www.google.com");
return s;
}
}
Run Code Online (Sandbox Code Playgroud)
它会很好用:简单,最小的代码.但是,该WebClient.DownloadString方法在Windows Phone 7上不可用,也没有很多WebRequest选项.有没有其他方法可以在Windows Phone中异步下载数据?我宁愿不必为下载和错误创建多个事件,只需要一个简单的方法返回一个值或抛出一个异常.
如何将标头添加到Windows Phone Web浏览器控件?我想添加两个标题,fore和back.现在我用这个添加一个标题:
browser.Navigate(newUrl, null, "fore:red");
Run Code Online (Sandbox Code Playgroud)
见文档
但是我如何将两个标题分开呢?该Navigate方法的第三个参数称为extraHeaders,它意味着不止一个,但我不知道如何将它们分开.
c# webbrowser-control windows-phone-7 windows-phone windows-phone-8
我正在尝试在我的Silverlight for Windows Phone 7应用程序中播放音频.我有一个MP3音频文件,其构建操作设置为资源.要播放声音,我使用:
SoundEffectInstance sfi = null;
...
Stream source = Application.GetResourceStream(new Uri("/Bird Calls;component/Crow.mp3", UriKind.Relative)).Stream;
Microsoft.Xna.Framework.Audio.SoundEffect effect = SoundEffect.FromStream(source);
sfi = effect.CreateInstance();
sfi.Play();
Run Code Online (Sandbox Code Playgroud)
此代码在SoundEffect.FromStream方法中抛出InvalidOperationException.
c# audio invalidoperationexception windows-phone-7 soundeffect
c# ×8
windows-8 ×2
asynchronous ×1
audio ×1
css ×1
download ×1
exe ×1
gif ×1
html ×1
javascript ×1
live-tile ×1
opacity ×1
reference ×1
resources ×1
silverlight ×1
soundeffect ×1
webclient ×1
winforms ×1
wpf ×1
xaml ×1