在我的Windows 8商店应用程序中,我在页面上有一个" 发送电子邮件"按钮,用户可以单击它并向我们发送电子邮件以进行一些常规查询.
我需要预先加载电子邮件正文中的一些文本,但我似乎无法添加换行符.我试着Environment.NewLine和"\r\n".它们都不起作用.
var mailto = new Uri("mailto:?to=james.jones@example.com&subject=Hello world&body=Hi," + Environment.NewLine + "Can you please ...");
await Windows.System.Launcher.LaunchUriAsync(mailto);
Run Code Online (Sandbox Code Playgroud)
当我运行它时,我得到"嗨,你能不能......".换行符被省略.
在我的Windows Phone应用程序的主页面中,用户可以单击按钮来执行某些操作,这将触发实时磁贴更新.
我遇到的问题是,如果用户点击按钮然后快速点击手机的后退按钮,实时图块有时将无法正常呈现.这个问题很少发生,但确实发生了,当它发生时它看起来很糟糕......

我实现实时磁贴的方法是,创建一个与实时磁贴完全相同的用户控件,然后将其保存到隔离存储中.然后检索它并将其存储在FliptileData对象中.最后,我在ShellTile上调用Update方法.请参阅以下代码片段以演示该过程.
// the function that saves the user control to isolated storage
public Uri SaveJpegToIsolatedStorage(FrameworkElement tile, string suffix, int tileWidth = 336, int tileHeight = 336)
{
var bmp = new WriteableBitmap(tileWidth, tileHeight);
// Force the content to layout itself properly
tile.Measure(new Size(tileWidth, tileHeight));
tile.Arrange(new Rect(0, 0, tileWidth, tileHeight));
bmp.Render(tile, null);
bmp.Invalidate();
// Obtain the virtual store for the application
IsolatedStorageFile myStore = IsolatedStorageFile.GetUserStoreForApplication();
using (IsolatedStorageFileStream fileStream = new IsolatedStorageFileStream(IsolatedStorageFileName + suffix, FileMode.Create, myStore))
{
try
{ …Run Code Online (Sandbox Code Playgroud) 所以,当我从BUILD观看这段视频时,我觉得这很容易......

但我似乎无法通过执行以下操作来更改我的WP Silverlight 8.1应用程序的磁贴.
const string xml = "<tile>"
+ "<visual>"
+ "<binding template='TileSquareText01'>"
+ "<text id='1'>testing 123</text>"
+ "</binding> "
+ "</visual>"
+ "</tile>";
var xmlDoc = new XmlDocument();
xmlDoc.LoadXml(xml);
var tileNotification = new TileNotification(xmlDoc);
TileUpdateManager.CreateTileUpdaterForApplication().Update(tileNotification);
Run Code Online (Sandbox Code Playgroud)
请注意我还创建了一个具有完全相同代码的Windows RunTime Windows Phone 8.1,它工作得很好.
在msdn上,它清楚地表明TileUpdateManager支持Windows Phone Silverlight 8.1.所以我真的不知道这里缺少什么.
live-tile windows-runtime windows-phone-8 windows-phone-8.1 windows-phone-sl-8.1
在Windows 10中,我们有一种通过设置来推迟xaml渲染的新方法
x:DeferLoadStrategy="Lazy" 在xaml.
但是,我没有找到任何文档来说明如何在代码隐藏中实现相同的功能.我想要这个的原因是我需要以某种方式完全隐藏元素(即从视觉树中删除它以提高动画性能).
有任何想法吗?
xaml windows-runtime winrt-xaml win-universal-app windows-10
我使用 Blend 更改了一些控件的样式,它自动生成了一些样式。但对于一些随机用户会出现此错误:
找不到名称/键为 PivotPreviousButtonBorderBrush [行:0 位置:0] 的资源
关键有时是ListViewItemBackground等。
为什么某些设备中缺少这些默认资源?如何预防?谢谢。
这是我的2个传感器监视器的下一个项目.我设计了一个简单的UI来显示传感器值.
我需要有关发展方向的建议.特别是动画.
动画1
我用Blend-VS2017做了这个.但今天是我用UWP动画的第一天..... 我真的很担心我的技能.
和Blend一样,我这样做....但要继续这个动画,它并不好.因为这只是5秒动画.如果我只重复这个,那就不美了.因为在重复点,用户发现动画重复.
动画2
它是背景流动的......红色+橙色.
我用混合制作它,但重复一遍,我不知道..我不能复制很多矩形.
要制作这个2动画,我需要什么类/功能?或者我应该使用混合功能?
在开始开发之前,我需要建议我应该学习的东西....
我有一堂课,以替代项目的背景颜色,但是如果删除项目,则背景颜色不会更新。删除项目后是否可以刷新背景颜色?
备用颜色的代码。类列表视图:
public class AlternatingRowListView : ListView
{
protected override void PrepareContainerForItemOverride(DependencyObject element, object item)
{
base.PrepareContainerForItemOverride(element, item);
var listViewItem = element as ListViewItem;
if (listViewItem != null)
{
var index = IndexFromContainer(element);
if (index % 2 == 0)
{
listViewItem.Background = new SolidColorBrush(Colors.LightBlue);
}
else
{
listViewItem.Background = new SolidColorBrush(Colors.Transparent);
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
代码xaml:
<local:AlternatingRowListView x:Name="listview">
<ListViewItem>item 1</ListViewItem>
<ListViewItem>item 2</ListViewItem>
<ListViewItem>item 3</ListViewItem>
<ListViewItem>item 4</ListViewItem>
<local:AlternatingRowListView.ItemTemplate>
<DataTemplate>
</DataTemplate>
</local:AlternatingRowListView.ItemTemplate>
</local:AlternatingRowListView>
Run Code Online (Sandbox Code Playgroud)
提前致谢。
我有一个Image在Scrollviewer...
<ScrollViewer x:Name="Scrollster" ZoomMode="Enabled" MinZoomFactor="1" MaxZoomFactor="4"
HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" ManipulationMode="All">
<Image x:Name="Img" Source="{x:Bind ImgSource}" Stretch="UniformToFill" PointerPressed="Img_PointerPressed"/>
</ScrollViewer>
Run Code Online (Sandbox Code Playgroud)
当我用鼠标指针拖动图像时,我想移动图像!
我试过了:
private void Img_PointerPressed(object sender,PointerRoutedEventArgs e)
{
var p = e.Pointer;
}
Run Code Online (Sandbox Code Playgroud)
但我无法获得指针位置来改变scrollviewer位置.
我的代码出了什么问题?我做得对吗?
我正在尝试将 HorizontalAlignment 和 VerticalAlignment 设置为 Center,以便 RelativePanel 正好位于 UWP 应用程序的中间。在RelativePanel 中有子项,子项应该在RelativePanel内居中。它应该看起来像:
如您所见,RelativePanel 位于中间,子项位于彼此之上并居中。我试过这个 XAML 代码:
<RelativePanel x:Name="relativePanel1" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock x:Name="textBlock1" Text="Yo, waddup? Enter your GUID to continue" IsTextSelectionEnabled="True" FontFamily="Chiller" FontSize="72" HorizontalAlignment="Center" VerticalAlignment="Center" />
<TextBox x:Name="textBox1" AcceptsReturn="True" HorizontalAlignment="Center" InputScope="Text" PlaceholderText="{}{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}" RelativePanel.Below="textBlock1" VerticalAlignment="Center" />
</RelativePanel>
Run Code Online (Sandbox Code Playgroud)
这是调试时的样子: