【问题标题】:Windows 8.1 XAML - LayoutTransformWindows 8.1 XAML - 布局转换
【发布时间】:2014-02-27 02:42:57
【问题描述】:

我正在尝试使用 LayoutTransform 属性将 Windows 8.1/VS2013 模板中的某些文本旋转 90 度。

我知道 LayoutTransform 不在 WinRT XAML 中,因此我按照 igrali 的 blog 上的说明在 Windows 8 WinRT XAML 中使用布局转换,但 Visual Studio 一直说:

'名称 Layout Transformer" 命名空间中不存在 “使用:Transforming.Common。”

这是因为由于 Windows 8.1 的变化,我需要做一些不同的事情吗?

【问题讨论】:

  • 您的标题指的是 LayoutTransform,但错误消息显示“LayoutTransformer”带有 -er。有错别字吗?
  • LayoutTransform 是我从 igrali.com/2012/09/17/layout-transform-in-windows-8-winrt-xaml 下载的类的名称。在这个类中有一个名为 LayoutTransform 的方法,我试图从我的 XAML 代码中使用它,这样我就可以将 LayoutTransform 属性设置为一个元素。
  • 你的项目中是否包含了 Igor 所写的类?
  • 是的,我试图在我的 XAML 代码中链接到它

标签: c# windows-runtime custom-controls winrt-xaml windows-8.1


【解决方案1】:

感谢大家的建议。我最终发现了如何做到这一点。我只需要确保在 app.xaml 和 mainpage.xaml 中的样式上方有正确的名称空间。我刚刚将模板中已包含的 common 的命名空间复制到 app.xaml 中。

【讨论】:

    【解决方案2】:

    也许你可以试试这个:

    <TextBlock Text="Sample Text">
        <TextBlock.RenderTransform>
            <RotateTransform Angle="90"/>
        </TextBlock.RenderTransform>
    </TextBlock>
    

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-05-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多