在我的应用程序中,我使用UI MediaElement.但是,当我单击Windows键时,音乐停止.
我试过用:
MediaControl.PlayPressed += MediaControl_PlayPressed;
MediaControl.PausePressed += MediaControl_PausePressed;
MediaControl.PlayPauseTogglePressed += MediaControl_PlayPauseTogglePressed;
MediaControl.StopPressed += MediaControl_StopPressed;
Run Code Online (Sandbox Code Playgroud)
我设置了源MediaElement:
media.Source = new Uri("http://stream-hq.mp3.zdn.vn/fsgggsfdlwjglwjAAAAA/2a3f830202ea6d29bc7c5a5146401566/4ff5620a/2011/12/27/a/4/a4fcc199a184a93cfeb0fe35642c53bf.mp3", UriKind.RelativeOrAbsolute);
Run Code Online (Sandbox Code Playgroud)
请帮我!
在项目中,我使用HttpWebRequest来下载Feeds:
HttpWebRequest request;
public void getFeeds()
{
request = (HttpWebRequest)WebRequest.Create("http://vnexpress.net/rss/gl/trang-chu.rss");
request.BeginGetResponse(ResponseCallBack, request);
}
SampleDataGroup group1;
private void ResponseCallBack(IAsyncResult result)
{
var request = (HttpWebRequest)result.AsyncState;
var response = request.EndGetResponse(result) as HttpWebResponse;
if (response != null && response.StatusCode == HttpStatusCode.OK)
{
var stream = response.GetResponseStream();
using (StreamReader reader = new StreamReader(stream))
{
string strReaderReader = reader.ReadToEnd();
XDocument doc = XDocument.Parse(strReaderReader);
var element = doc.Root.Element("channel").Elements("item");
group1 = new SampleDataGroup("Group-1",
"Hot News",
"Group Subtitle: 1",
"Assets/DarkGray.png",
"");
foreach (XElement x in element)
{
group1.Items.Add(new …Run Code Online (Sandbox Code Playgroud) 在项目i用户SQL CE中,我有表:
[Table]
public class Article : INotifyPropertyChanged, INotifyPropertyChanging
{
// Define _cid: private field, public property, and database column.
private int _aid;
[Column(DbType = "INT NOT NULL IDENTITY", IsDbGenerated = true, IsPrimaryKey = true)]
public int aid
{
get { return _aid; }
set
{
NotifyPropertyChanging("aid");
_aid = value;
NotifyPropertyChanged("aid");
}
}
// Define nameColor name: private field, public property, and database column.
private int _rid;
[Column]
public int rid
{
get { return _rid; }
set
{
NotifyPropertyChanging("rid"); …Run Code Online (Sandbox Code Playgroud) 我想在窗口手机7中使用Dipose缓存.在我的项目中,我有下载图像,使用后我通过以下方式处理图像:
Image.source = null;
Image = null;
Run Code Online (Sandbox Code Playgroud)
但内存不会恢复原状,例如:
下载后我设置了图像源:
img.source = new bitmapImage(new uri("http://diadiem.com/image/123.jpg"),UriKind.Relative);
Run Code Online (Sandbox Code Playgroud)
当下一页或LoadPage再次:我想要清除项目旧项目,并在缓存中补充内存.虽然我尝试了设置image.source= null,并设置控制Image = null.但记忆不会恢复原状.
请帮我!