winrt-xaml - Windows 通用可调整大小网格

标签 winrt-xaml uwp

我做了很多研究,但许多建议已经过时(WinRT),我需要允许我的应用程序用户水平而不是垂直调整网格大小,但我根本找不到允许这样做的事件或任何东西!

最佳答案

当然。

如果你有这个:

<Grid Width="200" Height="100" Background="Lime"
        ManipulationDelta="Grid_ManipulationDelta" ManipulationMode="TranslateX" />

你可以这样做:

private void Grid_ManipulationDelta(object sender, Windows.UI.Xaml.Input.ManipulationDeltaRoutedEventArgs e)
{
    var grid = sender as Grid;
    grid.Width = grid.ActualWidth + e.Delta.Translation.X;
}

看起来像这样:

enter image description here

祝你好运!

关于winrt-xaml - Windows 通用可调整大小网格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35139646/

相关文章:

c# - 如何像报纸一样将长文本分成几栏?

c# - 打包项目错误 : 'Conflicting values for resource' and 'Duplicate Entry'

xaml - 为 Windows 应用商店应用学习 xaml 的最佳资源?

build - 如何在升级 Windows 10 版本后通过 3 个步骤修复 Windows 10 appx (uwp)

c# - 使用 UWP C# 的 Hololens 条码读取器

c# - 在 Windows 8.1 中使用搜索框时如何优雅地处理 TaskCanceledException

xaml - 在 Windows 通用应用程序 (UWP) 中使用 Tab 和 Alter Tab 时生成 "global::System.Diagnostics.Debugger.Break()"错误

windows-8 - metro (XAML/C#) : detect installation and/or first run

c# - WinRT 许可

c# - 如何从 WinRT WebView 控件获取重定向 URL