C#UWP - 通知面板

时间:2017-04-08 12:46:53

标签: c# uwp

我正在学习c#(UWP)并在XAML中创建了一个通知文本块。

这是:

var request = NSFetchRequest<Coordinates>(entityName: "Coordinates")

... 

for result in results as! [Coordinates] {
   print(result.latitude)
   print(result.longitude)
}

有更好的方法吗?因为,现在我必须将此XAML复制到所有页面。

Mb是否动态生成?但我不知道怎么样,你能给我一个暗示吗?

BTW:这基本上是动画通知面板 enter image description here

谢谢

1 个答案:

答案 0 :(得分:0)

看看这个例子。它适用于Xamarin Apps,但样本是特定于UWP的。它会在屏幕底部显示通知,而不是其他所有内容。它可以在静态方法中调用。实际的示例应用程序可能有点令人困惑,但如果您了解Xamarin Forms的工作原理,您将能够提取您所需的内容。回购在这里。

https://github.com/MelbourneDeveloper/Adapt.Presentation

https://github.com/MelbourneDeveloper/Adapt.Presentation/blob/master/Adapt.Presentation.UWP/Adapt/Presentation/UWP/InAppNotification.xaml.cs

https://github.com/MelbourneDeveloper/Adapt.Presentation/blob/master/Adapt.Presentation.UWP/Adapt/Presentation/UWP/InAppNotification.xaml

相关问题