我有一个Windows通用应用程序,我正在使用DirectX渲染场景.我想使用Scrollviewer,因此我在Scrollviewer后面渲染我的场景,并希望根据Scrollviewer计算场景变换.它到目前为止工作正常,特别是翻译和滚动.但是当我放大时,场景会在两种特殊情况下跳跃:
或多或少我使用以下代码:
float zoom = scrollViewer.ZoomFactor;
float inverseZoom = 1f / scrollViewer.ZoomFactor;
float scaledContentW = Document.Size.X * scrollViewer.ZoomFactor;
float scaledContentH = Document.Size.Y * scrollViewer.ZoomFactor;
float translateX;
float translateY;
if (scaledContentW < scrollViewer.ViewportWidth)
{
translateX = ((float)scrollViewer.ViewportWidth * inverseZoom - Document.Size.X) * 0.5f;
}
else
{
translateX = -inverseZoom * (float)scrollViewer.HorizontalOffset;
}
if (scaledContentH < scrollViewer.ViewportHeight)
{
translateY = ((float)scrollViewer.ViewportHeight * inverseZoom - Document.Size.Y) * 0.5f;
}
else
{
translateY = -inverseZoom * (float)scrollViewer.VerticalOffset;
}
float visibleX = inverseZoom …Run Code Online (Sandbox Code Playgroud) AdaptiveTrigger是否可以在DataTemplate中工作?
这是我用来自定义我的ShellNavigation的代码,除了视觉状态之外它工作得很好.它们不会触发任何东西.
<shell:ShellHeadView x:Key="ShellHeadView_01">
<shell:ShellHeadView.ContentTemplate>
<DataTemplate>
<Grid Margin="20,0">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup>
<VisualState x:Name="GreenBackgroundVisualState">
<VisualState.Setters>
<Setter Target="headViewLeft.Background" Value="Green" />
</VisualState.Setters>
<VisualState.StateTriggers>
<AdaptiveTrigger MinWindowWidth="1000"/>
</VisualState.StateTriggers>
</VisualState>
<VisualState x:Name="OrangeBackgroundVisualState">
<VisualState.Setters>
<Setter Target="headViewLeft.Background" Value="Orange" />
</VisualState.Setters>
<VisualState.StateTriggers>
<AdaptiveTrigger MinWindowWidth="2000"/>
</VisualState.StateTriggers>
</VisualState>
<VisualState x:Name="RedBackgroundVisualState">
<VisualState.Setters>
<Setter Target="headViewLeft.Background" Value="Red" />
</VisualState.Setters>
<VisualState.StateTriggers>
<AdaptiveTrigger MinWindowWidth="3000"/>
</VisualState.StateTriggers>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Grid Grid.Column="0" x:Name="headViewLeft" Width="100" Height="90">
</Grid>
Run Code Online (Sandbox Code Playgroud) 我已经在Windows Phone 8.1 Silverlight App和UWP中创建了一个椭圆,我想用动画波填充它,为此,我正在遵循这个解决方案
但它适用于WPF,所以我无法使用像"Visual Brush"这样的控件.
我想用类似于此的波填充椭圆(忽略图像中的50%) -
这是我的eliipse
<Ellipse Name="WaveEllipse" Grid.Column="1" Grid.Row="0" VerticalAlignment="Top"
Stroke="{StaticResource PhoneAccentBrush}"
StrokeThickness="4"
Width="225"
Height="225">
</Ellipse>
Run Code Online (Sandbox Code Playgroud)
视觉刷上的任何替代品?主要是我想在Windows Phone 8.1 Silverlight中实现它,但是如果它在WP平台上不可用,我将切换到UWP
我们正在开发一个UWP应用程序,它需要能够将项目从一个GridView拖动到另一个GridView.在测试此功能时,我们遇到了多次灾难性故障0x80000FFFF.

经过近2天的研究,我们无法找到解决问题的方法.我们发现这些故障发生了,当为GridView设置了ItemTemplate时,项目被拖出.
甚至尝试从Microsoft"XamlDragAndDrop"提供的官方拖放示例,(https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/XamlDragAndDrop),当你拖动Scenario1中的项目时源ListView到目标ListView(~30-50)次,你也会遇到失败.
之前有其他人遇到过这个问题吗?我们非常感谢任何建议!
我们开发的机器运行Windows 10 Enterprise,版本1803,操作系统版本17134.285.
在官方GitHub回购中打开了一个问题. https://github.com/Microsoft/Windows-universal-samples/issues/977
我录制了一个样本崩溃的小视频. https://1drv.ms/v/s!AiZ-jksNqbXLi9kZPPfSeGmQr_YeHg
在释放模式下运行时,它会在之前崩溃,并且在显示热图部分中打开重绘功能时也会崩溃.
我正在使用C#和XAML开发Windows 10应用程序.我有一个ListView,我想更改所选项目的默认HighLight颜色.我看到很多代码示例(像这样),但都是为WP8或Win8设计的,我试图实现这些,但它们对我不起作用.
一般来说,我很难修改控件的默认主题,因为我找不到有用的文档.如果有人可以帮助我突出颜色并且还推荐我很好的文档,那将是很棒的.
挣扎着冻结应用程序的错误,只发生在平板电脑上(从不在我的笔记本电脑上).似乎与快速切换汉堡菜单有关.我有一个堆栈跟踪,导致第三方控制,但我得到的10次中的9次是以下.只有一些"异步空白",我无法避免它们(覆盖事件)和其他日志记录,我相信问题出在XAML中(方法是记录进入/退出):
未指定的错误:System.Runtime.InteropServices.COMException(0x80004005):未指定的错误
在Oceaneering.Commons.Utilities.Logger.CoreApplication_UnhandledErrorDetected(Object sender,UnhandledErrorDetectedEventArgs e)上的Windows.ApplicationModel.Core.UnhandledError.Propagate()中出现未指定的错误
设置如下:
CoreApplication.UnhandledErrorDetected += CoreApplication_UnhandledErrorDetected;
Run Code Online (Sandbox Code Playgroud)
接收方法是:
try {
e.UnhandledError.Propagate();
}
catch (Exception ex){
logChannel.LogMessage(string.Format("Unhandled Exception: {0}:{1}", ex.Message, ex.ToString()));
SaveToFileAsync().Wait();
}
Run Code Online (Sandbox Code Playgroud)
我可以做些什么来收集更多信息?谢谢!
win-universal-app windows-10-mobile uwp windows-10-universal
我正在创建一个针对Windows Phone和Windows Desktop的Windows 10通用应用程序,我面临的问题是当通过package.manifest文件向应用程序添加启动画面时,没有选项添加适合手机的启动画面纵向(见下图),
当我在手机上部署应用程序时,会出现如下所示的启动画面.
splash-screen win-universal-app windows-10 windows-10-mobile uwp
我找不到Windows 10通用应用程序的任何记录器,我已经尝试过log4net,Microsoft企业库,Nlog但是在Windows 10 Universal平台上都没有支持它们.
谁能建议我为Windows 10 UWP做好记录器?
如何以现代通用方式打包可移植.NET库?假设我有一个AnyCPU程序集,我希望它可用于任何支持.NET Core API表面的.NET平台,例如.NET Framework 4.6和通用Windows平台.
这是一系列问题和答案,记录了我对现代NuGet包创作主题的研究结果,特别关注NuGet 3引入的变化.您可能还对一些相关问题感兴趣:
我尝试将一些Windows Phone 8项目移植到当前的UWP,并且陷入了我在旧项目中使用的代码片段.
private void Restaurant_Tap(object sender, System.Windows.Input.GestureEventArgs e)
{
string types = "restaurant";
string title = "restaurant";
string url = string.Format("/NearbyPlaces.xaml?latitude={0}&longitude={1}&types={2}&title={3}", LocationLatitude.Text, LocationLangitude.Text, types, title);
NavigationService.Navigate(new Uri(url, UriKind.Relative));
}
Run Code Online (Sandbox Code Playgroud)
在该代码中,我使用NavigationService将一些参数传递给另一个页面.我不能再使用NaigationService了,因为UWP不支持它.我已经尝试在我的UWP项目中使用它,但我认为它只支持传递一个参数CMIIW.
private void restaurant_tapped(object sender, TappedRoutedEventArgs e)
{
string types = "restaurant";
string title = "restaurant";
Frame.Navigate(typeof(placeResult), latLoc.Text, longLoc.Text, types, title);
}
Run Code Online (Sandbox Code Playgroud)
该代码给我一个错误,因为它需要5个参数,即+2重载.我的问题是如何以正确的方式在UWP项目中传递一些参数?